instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
What is the person born in Australia, rick springfield notable for?
CREATE TABLE table_34689 ( "Name" text, "Born \u2013 Died" text, "Notable for" text, "Connection with Australia" text, "Connection with America" text )
SELECT "Notable for" FROM table_34689 WHERE "Connection with Australia" = 'born in australia' AND "Name" = 'rick springfield'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the person born in Australia, rick springfield notable for? ### Input: CREATE TABLE table_34689 ( "Name" text, "Born \u2013 Died" text, "Notable for" text, "Connection with Australia" text, "Connection with America" text ) ### Response: SELECT "Notable for" FROM table_34689 WHERE "Connection with Australia" = 'born in australia' AND "Name" = 'rick springfield'
what is the number of patients whose admission year is less than 2182 and lab test fluid is blood?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( 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 ) 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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Blood"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission year is less than 2182 and lab test fluid is blood? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( 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 ) 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Blood"
provide the number of patients whose admission location is clinic referral/premature and primary disease is sepsis?
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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "SEPSIS"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission location is clinic referral/premature and primary disease is sepsis? ### Input: 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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "SEPSIS"
What were the January ( F) temperatures in the Corner Brook location?
CREATE TABLE table_21980_1 ( january__°f_ VARCHAR, location VARCHAR )
SELECT january__°f_ FROM table_21980_1 WHERE location = "Corner Brook"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were the January ( F) temperatures in the Corner Brook location? ### Input: CREATE TABLE table_21980_1 ( january__°f_ VARCHAR, location VARCHAR ) ### Response: SELECT january__°f_ FROM table_21980_1 WHERE location = "Corner Brook"
What is the average age for all managers?
CREATE TABLE manager ( Age INTEGER )
SELECT AVG(Age) FROM manager
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average age for all managers? ### Input: CREATE TABLE manager ( Age INTEGER ) ### Response: SELECT AVG(Age) FROM manager
what is the time/retired when the laps is 55?
CREATE TABLE table_name_96 ( time_retired VARCHAR, laps VARCHAR )
SELECT time_retired FROM table_name_96 WHERE laps = 55
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the time/retired when the laps is 55? ### Input: CREATE TABLE table_name_96 ( time_retired VARCHAR, laps VARCHAR ) ### Response: SELECT time_retired FROM table_name_96 WHERE laps = 55
Which location has the top amount of 'Drugs' crime conducted?
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text )
SELECT location FROM greatermanchestercrime WHERE type LIKE "%Drug%" GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1
greatermanchestercrime
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which location has the top amount of 'Drugs' crime conducted? ### Input: CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text ) ### Response: SELECT location FROM greatermanchestercrime WHERE type LIKE "%Drug%" GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1
Best Algerian stack overflow users.
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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( 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 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 )
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Age, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?1##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR UPPER(Location) LIKE UPPER('%Algiers%') OR UPPER(Location) LIKE UPPER('DZ') OR UPPER(Location) LIKE UPPER('% %')) ORDER BY Reputation DESC LIMIT 2000
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Best Algerian stack overflow users. ### Input: 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( 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 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 ) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Age, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?1##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR UPPER(Location) LIKE UPPER('%Algiers%') OR UPPER(Location) LIKE UPPER('DZ') OR UPPER(Location) LIKE UPPER('% %')) ORDER BY Reputation DESC LIMIT 2000
what's the number of patients who had a tpn d11.5 intake a year before?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom 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 d_items ( row_id number, itemid number, label text, linksto 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 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 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 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d11.5' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')))
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the number of patients who had a tpn d11.5 intake a year before? ### Input: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom 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 d_items ( row_id number, itemid number, label text, linksto 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 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 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 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d11.5' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')))
What is the fewest area in Derrynanool townland?
CREATE TABLE table_31495 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
SELECT MIN("Area( acres )") FROM table_31495 WHERE "Townland" = 'Derrynanool'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the fewest area in Derrynanool townland? ### Input: CREATE TABLE table_31495 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text ) ### Response: SELECT MIN("Area( acres )") FROM table_31495 WHERE "Townland" = 'Derrynanool'
How many times was the mens u20 recorded when the Womens 40 were Sydney Scorpions def North Queensland Cyclones?
CREATE TABLE table_16724844_1 ( mens_u20 VARCHAR, womens_40 VARCHAR )
SELECT COUNT(mens_u20) FROM table_16724844_1 WHERE womens_40 = "Sydney Scorpions def North Queensland Cyclones"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times was the mens u20 recorded when the Womens 40 were Sydney Scorpions def North Queensland Cyclones? ### Input: CREATE TABLE table_16724844_1 ( mens_u20 VARCHAR, womens_40 VARCHAR ) ### Response: SELECT COUNT(mens_u20) FROM table_16724844_1 WHERE womens_40 = "Sydney Scorpions def North Queensland Cyclones"
Who was the winner of the mechelen > mechelen route?
CREATE TABLE table_60903 ( "Stage" text, "Route" text, "Distance" text, "Date" text, "Winner" text )
SELECT "Winner" FROM table_60903 WHERE "Route" = 'mechelen > mechelen'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the winner of the mechelen > mechelen route? ### Input: CREATE TABLE table_60903 ( "Stage" text, "Route" text, "Distance" text, "Date" text, "Winner" text ) ### Response: SELECT "Winner" FROM table_60903 WHERE "Route" = 'mechelen > mechelen'
has patient 002-4486 been ordered chlorhexidine gluconate 0.12%, morphine 4 mg/ml syringe : 1 ml syringe, or amlodipine 5 mg tab during this month?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 )
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND medication.drugname IN ('morphine 4 mg/ml syringe : 1 ml syringe', 'chlorhexidine gluconate 0.12%', 'amlodipine 5 mg tab') AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 002-4486 been ordered chlorhexidine gluconate 0.12%, morphine 4 mg/ml syringe : 1 ml syringe, or amlodipine 5 mg tab during this month? ### Input: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 ) ### Response: SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND medication.drugname IN ('morphine 4 mg/ml syringe : 1 ml syringe', 'chlorhexidine gluconate 0.12%', 'amlodipine 5 mg tab') AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
What is 4:30 pm, when Noon is 'Local Programs', and when 11:00 am is 'Local Programs'?
CREATE TABLE table_61154 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" text )
SELECT "4:30 pm" FROM table_61154 WHERE "noon" = 'local programs' AND "11:00 am" = 'local programs'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is 4:30 pm, when Noon is 'Local Programs', and when 11:00 am is 'Local Programs'? ### Input: CREATE TABLE table_61154 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" text ) ### Response: SELECT "4:30 pm" FROM table_61154 WHERE "noon" = 'local programs' AND "11:00 am" = 'local programs'
What position did the person finish in with a notes of junior men individual 5.64km?
CREATE TABLE table_name_95 ( position VARCHAR, notes VARCHAR )
SELECT position FROM table_name_95 WHERE notes = "junior men individual 5.64km"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What position did the person finish in with a notes of junior men individual 5.64km? ### Input: CREATE TABLE table_name_95 ( position VARCHAR, notes VARCHAR ) ### Response: SELECT position FROM table_name_95 WHERE notes = "junior men individual 5.64km"
How many episodes were written by Jack Burditt & Robert Carlock
CREATE TABLE table_1378 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real )
SELECT COUNT("Production code") FROM table_1378 WHERE "Written by" = 'Jack Burditt & Robert Carlock'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many episodes were written by Jack Burditt & Robert Carlock ### Input: CREATE TABLE table_1378 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) ### Response: SELECT COUNT("Production code") FROM table_1378 WHERE "Written by" = 'Jack Burditt & Robert Carlock'
What was the type of ballot measure with the description of Department of Industry and Public Works Amendment?
CREATE TABLE table_27953 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
SELECT "type" FROM table_27953 WHERE "description" = 'Department of Industry and Public Works Amendment'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the type of ballot measure with the description of Department of Industry and Public Works Amendment? ### Input: CREATE TABLE table_27953 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) ### Response: SELECT "type" FROM table_27953 WHERE "description" = 'Department of Industry and Public Works Amendment'
How much parking is in Van Nuys at the Sepulveda station?
CREATE TABLE table_2093995_1 ( parking VARCHAR, city__neighborhood VARCHAR, stations VARCHAR )
SELECT parking FROM table_2093995_1 WHERE city__neighborhood = "Van Nuys" AND stations = "Sepulveda"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much parking is in Van Nuys at the Sepulveda station? ### Input: CREATE TABLE table_2093995_1 ( parking VARCHAR, city__neighborhood VARCHAR, stations VARCHAR ) ### Response: SELECT parking FROM table_2093995_1 WHERE city__neighborhood = "Van Nuys" AND stations = "Sepulveda"
Please list the age and famous title of artists in descending order of age.
CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text )
SELECT famous_title, age FROM artist ORDER BY age DESC
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please list the age and famous title of artists in descending order of age. ### Input: CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) ### Response: SELECT famous_title, age FROM artist ORDER BY age DESC
What was the average number of laps completed by KTM riders, with times of +56.440 and grid values under 11?
CREATE TABLE table_name_92 ( laps INTEGER, grid VARCHAR, manufacturer VARCHAR, time_retired VARCHAR )
SELECT AVG(laps) FROM table_name_92 WHERE manufacturer = "ktm" AND time_retired = "+56.440" AND grid < 11
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the average number of laps completed by KTM riders, with times of +56.440 and grid values under 11? ### Input: CREATE TABLE table_name_92 ( laps INTEGER, grid VARCHAR, manufacturer VARCHAR, time_retired VARCHAR ) ### Response: SELECT AVG(laps) FROM table_name_92 WHERE manufacturer = "ktm" AND time_retired = "+56.440" AND grid < 11
Tell me the network for 13 january 2009
CREATE TABLE table_name_80 ( network VARCHAR, premiere VARCHAR )
SELECT network FROM table_name_80 WHERE premiere = "13 january 2009"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the network for 13 january 2009 ### Input: CREATE TABLE table_name_80 ( network VARCHAR, premiere VARCHAR ) ### Response: SELECT network FROM table_name_80 WHERE premiere = "13 january 2009"
What's the website for the yamagata international documentary film festival?
CREATE TABLE table_name_27 ( website VARCHAR, name VARCHAR )
SELECT website FROM table_name_27 WHERE name = "yamagata international documentary film festival"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the website for the yamagata international documentary film festival? ### Input: CREATE TABLE table_name_27 ( website VARCHAR, name VARCHAR ) ### Response: SELECT website FROM table_name_27 WHERE name = "yamagata international documentary film festival"
What is the name of the person that was appointed on 13 May 2009?
CREATE TABLE table_name_74 ( replaced_by VARCHAR, date_of_appointment VARCHAR )
SELECT replaced_by FROM table_name_74 WHERE date_of_appointment = "13 may 2009"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the person that was appointed on 13 May 2009? ### Input: CREATE TABLE table_name_74 ( replaced_by VARCHAR, date_of_appointment VARCHAR ) ### Response: SELECT replaced_by FROM table_name_74 WHERE date_of_appointment = "13 may 2009"
Which away team's Venue is western oval?
CREATE TABLE table_10284 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_10284 WHERE "Venue" = 'western oval'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which away team's Venue is western oval? ### Input: CREATE TABLE table_10284 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Response: SELECT "Away team" FROM table_10284 WHERE "Venue" = 'western oval'
give me the number of patients whose age is less than 62 and diagnoses short title is esophageal reflux?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, 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 ) 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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.short_title = "Esophageal reflux"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose age is less than 62 and diagnoses short title is esophageal reflux? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, 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 ) 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.short_title = "Esophageal reflux"
what is the image quality when the multiple sessions is x, the authentication is and the date is may 15, 2007?
CREATE TABLE table_name_32 ( image_quality VARCHAR, date VARCHAR, multiple_sessions VARCHAR, authentication VARCHAR )
SELECT image_quality FROM table_name_32 WHERE multiple_sessions = "x" AND authentication = "✓" AND date = "may 15, 2007"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the image quality when the multiple sessions is x, the authentication is and the date is may 15, 2007? ### Input: CREATE TABLE table_name_32 ( image_quality VARCHAR, date VARCHAR, multiple_sessions VARCHAR, authentication VARCHAR ) ### Response: SELECT image_quality FROM table_name_32 WHERE multiple_sessions = "x" AND authentication = "✓" AND date = "may 15, 2007"
is patient 027-4674 ever diagnosed with anything during the last year?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-4674')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is patient 027-4674 ever diagnosed with anything during the last year? ### Input: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) ### Response: SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-4674')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
Who holds the time of 17:11.572?
CREATE TABLE table_name_83 ( race VARCHAR, time VARCHAR )
SELECT race FROM table_name_83 WHERE time = "17:11.572"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who holds the time of 17:11.572? ### Input: CREATE TABLE table_name_83 ( race VARCHAR, time VARCHAR ) ### Response: SELECT race FROM table_name_83 WHERE time = "17:11.572"
Who directed 'hey now hey now perry'S girlfriend's back'?
CREATE TABLE table_3099 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
SELECT "Directed by" FROM table_3099 WHERE "Title" = 'Hey Now Hey Now Perry''s Girlfriend''s Back'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed 'hey now hey now perry'S girlfriend's back'? ### Input: CREATE TABLE table_3099 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) ### Response: SELECT "Directed by" FROM table_3099 WHERE "Title" = 'Hey Now Hey Now Perry''s Girlfriend''s Back'
when was the first time patient 011-31236's procedure was performed in 2101?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31236')) AND STRFTIME('%y', treatment.treatmenttime) = '2101' ORDER BY treatment.treatmenttime LIMIT 1
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time patient 011-31236's procedure was performed in 2101? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ### Response: SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31236')) AND STRFTIME('%y', treatment.treatmenttime) = '2101' ORDER BY treatment.treatmenttime LIMIT 1
When kumbha is the international alphabet of sanskrit transliteration what is the gloss?
CREATE TABLE table_22517 ( "Number" real, "Sanskrit" text, "International Alphabet of Sanskrit Transliteration" text, "Sanskrit gloss" text, "Western name" text, "Greek" text, "Gloss" text, "Tattva (Element)" text, "Quality" text, "Ruling Planet" text )
SELECT "Gloss" FROM table_22517 WHERE "International Alphabet of Sanskrit Transliteration" = 'Kumbha'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When kumbha is the international alphabet of sanskrit transliteration what is the gloss? ### Input: CREATE TABLE table_22517 ( "Number" real, "Sanskrit" text, "International Alphabet of Sanskrit Transliteration" text, "Sanskrit gloss" text, "Western name" text, "Greek" text, "Gloss" text, "Tattva (Element)" text, "Quality" text, "Ruling Planet" text ) ### Response: SELECT "Gloss" FROM table_22517 WHERE "International Alphabet of Sanskrit Transliteration" = 'Kumbha'
How much money does the player with a 68-67-69-71=275 score have?
CREATE TABLE table_60214 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
SELECT "Money ( \u00a3 )" FROM table_60214 WHERE "Score" = '68-67-69-71=275'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much money does the player with a 68-67-69-71=275 score have? ### Input: CREATE TABLE table_60214 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) ### Response: SELECT "Money ( \u00a3 )" FROM table_60214 WHERE "Score" = '68-67-69-71=275'
were any medications prescribed to patient 27038 when they came to the hospital last time?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 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 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 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: were any medications prescribed to patient 27038 when they came to the hospital last time? ### Input: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 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 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 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
Which Rank has a Player of matt ruth?
CREATE TABLE table_13632 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text )
SELECT SUM("Rank") FROM table_13632 WHERE "Player" = 'matt ruth'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Rank has a Player of matt ruth? ### Input: CREATE TABLE table_13632 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text ) ### Response: SELECT SUM("Rank") FROM table_13632 WHERE "Player" = 'matt ruth'
what is the venue where the scores are 15.13 (103) 8.4 (52)?
CREATE TABLE table_16703 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
SELECT "Venue" FROM table_16703 WHERE "Scores" = '15.13 (103) – 8.4 (52)'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the venue where the scores are 15.13 (103) 8.4 (52)? ### Input: CREATE TABLE table_16703 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text ) ### Response: SELECT "Venue" FROM table_16703 WHERE "Scores" = '15.13 (103) – 8.4 (52)'
A bar chart for returning the number of the lot details of lots that belong to investors with details 'l'?, I want to rank by the how many lot details in descending.
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) )
SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY COUNT(lot_details) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for returning the number of the lot details of lots that belong to investors with details 'l'?, I want to rank by the how many lot details in descending. ### Input: CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) ### Response: SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY COUNT(lot_details) DESC
how many patients have medicaid health insurance?
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 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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have medicaid health insurance? ### Input: 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 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid"
What are the number of different course codes?
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text )
SELECT COUNT(DISTINCT crs_code) FROM class
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of different course codes? ### Input: CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) ### Response: SELECT COUNT(DISTINCT crs_code) FROM class
The Reputation of Voters in This Election.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
SELECT u.Reputation FROM Badges AS b LEFT JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'Constituent' AND CAST((JULIANDAY(Date) - JULIANDAY('2018-08-06')) * 1440.0 AS INT) > 0
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The Reputation of Voters in This Election. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) ### Response: SELECT u.Reputation FROM Badges AS b LEFT JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'Constituent' AND CAST((JULIANDAY(Date) - JULIANDAY('2018-08-06')) * 1440.0 AS INT) > 0
What are the name and population of each county?
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text )
SELECT county_name, population FROM county
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the name and population of each county? ### Input: CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) ### Response: SELECT county_name, population FROM county
What is the number of weeks where the venue was memorial stadium and the attendance was less than 41,252?
CREATE TABLE table_name_36 ( week VARCHAR, venue VARCHAR, attendance VARCHAR )
SELECT COUNT(week) FROM table_name_36 WHERE venue = "memorial stadium" AND attendance < 41 OFFSET 252
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of weeks where the venue was memorial stadium and the attendance was less than 41,252? ### Input: CREATE TABLE table_name_36 ( week VARCHAR, venue VARCHAR, attendance VARCHAR ) ### Response: SELECT COUNT(week) FROM table_name_36 WHERE venue = "memorial stadium" AND attendance < 41 OFFSET 252
was the attendance more or less in the saturday , april 13th game compared to the saturday , may 11th
CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
SELECT (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, april 13') > (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, may 11')
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the attendance more or less in the saturday , april 13th game compared to the saturday , may 11th ### Input: CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number ) ### Response: SELECT (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, april 13') > (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, may 11')
among patients admitted in the year less than 2203, how many of them were aged below 70?
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 ) 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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" AND demographic.admityear < "2203"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients admitted in the year less than 2203, how many of them were aged below 70? ### Input: 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 ) 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" AND demographic.admityear < "2203"
What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007?
CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE manager_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number ) CREATE TABLE manager_award ( player_id text, award_id text, year number, league_id text, tie text, notes number ) CREATE TABLE batting ( player_id text, year number, stint number, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, hbp number, sh number, sf number, g_idp number ) CREATE TABLE fielding_outfield ( player_id text, year number, stint number, glf number, gcf number, grf number ) CREATE TABLE postseason ( year number, round text, team_id_winner text, league_id_winner text, team_id_loser text, league_id_loser text, wins number, losses number, ties number ) CREATE TABLE park ( park_id text, park_name text, park_alias text, city text, state text, country text ) CREATE TABLE manager ( player_id text, year number, team_id text, league_id text, inseason number, g number, w number, l number, rank number, plyr_mgr text ) CREATE TABLE college ( college_id text, name_full text, city text, state text, country text ) CREATE TABLE team_half ( year number, league_id text, team_id text, half number, div_id text, div_win text, rank number, g number, w number, l number ) CREATE TABLE manager_half ( player_id text, year number, team_id text, league_id text, inseason number, half number, g number, w number, l number, rank number ) CREATE TABLE fielding ( player_id text, year number, stint number, team_id text, league_id text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, pb number, wp number, sb number, cs number, zr number ) CREATE TABLE player ( player_id text, birth_year number, birth_month number, birth_day number, birth_country text, birth_state text, birth_city text, death_year number, death_month number, death_day number, death_country text, death_state text, death_city text, name_first text, name_last text, name_given text, weight number, height number, bats text, throws text, debut text, final_game text, retro_id text, bbref_id text ) CREATE TABLE player_college ( player_id text, college_id text, year number ) CREATE TABLE team ( year number, league_id text, team_id text, franchise_id text, div_id text, rank number, g number, ghome number, w number, l number, div_win text, wc_win text, lg_win text, ws_win text, r number, ab number, h number, double number, triple number, hr number, bb number, so number, sb number, cs number, hbp number, sf number, ra number, er number, era number, cg number, sho number, sv number, ipouts number, ha number, hra number, bba number, soa number, e number, dp number, fp number, name text, park text, attendance number, bpf number, ppf number, team_id_br text, team_id_lahman45 text, team_id_retro text ) CREATE TABLE team_franchise ( franchise_id text, franchise_name text, active text, na_assoc text ) CREATE TABLE appearances ( year number, team_id text, league_id text, player_id text, g_all number, gs number, g_batting number, g_defense number, g_p number, g_c number, g_1b number, g_2b number, g_3b number, g_ss number, g_lf number, g_cf number, g_rf number, g_of number, g_dh number, g_ph number, g_pr number ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots number, needed number, votes number, inducted text, category text, needed_note text ) CREATE TABLE fielding_postseason ( player_id text, year number, team_id text, league_id text, round text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, tp number, pb number, sb number, cs number ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE pitching ( player_id text, year number, stint number, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, baopp number, era number, ibb number, wp number, hbp number, bk number, bfp number, gf number, r number, sh number, sf number, g_idp number ) CREATE TABLE pitching_postseason ( player_id text, year number, round text, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, baopp text, era number, ibb number, wp number, hbp number, bk number, bfp number, gf number, r number, sh number, sf number, g_idp number ) CREATE TABLE home_game ( year number, league_id text, team_id text, park_id text, span_first text, span_last text, games number, openings number, attendance number ) CREATE TABLE batting_postseason ( year number, round text, player_id text, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, hbp number, sh number, sf number, g_idp number ) CREATE TABLE all_star ( player_id text, year number, game_num number, game_id text, team_id text, league_id text, gp number, starting_pos number ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number )
SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007? ### Input: CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE manager_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number ) CREATE TABLE manager_award ( player_id text, award_id text, year number, league_id text, tie text, notes number ) CREATE TABLE batting ( player_id text, year number, stint number, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, hbp number, sh number, sf number, g_idp number ) CREATE TABLE fielding_outfield ( player_id text, year number, stint number, glf number, gcf number, grf number ) CREATE TABLE postseason ( year number, round text, team_id_winner text, league_id_winner text, team_id_loser text, league_id_loser text, wins number, losses number, ties number ) CREATE TABLE park ( park_id text, park_name text, park_alias text, city text, state text, country text ) CREATE TABLE manager ( player_id text, year number, team_id text, league_id text, inseason number, g number, w number, l number, rank number, plyr_mgr text ) CREATE TABLE college ( college_id text, name_full text, city text, state text, country text ) CREATE TABLE team_half ( year number, league_id text, team_id text, half number, div_id text, div_win text, rank number, g number, w number, l number ) CREATE TABLE manager_half ( player_id text, year number, team_id text, league_id text, inseason number, half number, g number, w number, l number, rank number ) CREATE TABLE fielding ( player_id text, year number, stint number, team_id text, league_id text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, pb number, wp number, sb number, cs number, zr number ) CREATE TABLE player ( player_id text, birth_year number, birth_month number, birth_day number, birth_country text, birth_state text, birth_city text, death_year number, death_month number, death_day number, death_country text, death_state text, death_city text, name_first text, name_last text, name_given text, weight number, height number, bats text, throws text, debut text, final_game text, retro_id text, bbref_id text ) CREATE TABLE player_college ( player_id text, college_id text, year number ) CREATE TABLE team ( year number, league_id text, team_id text, franchise_id text, div_id text, rank number, g number, ghome number, w number, l number, div_win text, wc_win text, lg_win text, ws_win text, r number, ab number, h number, double number, triple number, hr number, bb number, so number, sb number, cs number, hbp number, sf number, ra number, er number, era number, cg number, sho number, sv number, ipouts number, ha number, hra number, bba number, soa number, e number, dp number, fp number, name text, park text, attendance number, bpf number, ppf number, team_id_br text, team_id_lahman45 text, team_id_retro text ) CREATE TABLE team_franchise ( franchise_id text, franchise_name text, active text, na_assoc text ) CREATE TABLE appearances ( year number, team_id text, league_id text, player_id text, g_all number, gs number, g_batting number, g_defense number, g_p number, g_c number, g_1b number, g_2b number, g_3b number, g_ss number, g_lf number, g_cf number, g_rf number, g_of number, g_dh number, g_ph number, g_pr number ) CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots number, needed number, votes number, inducted text, category text, needed_note text ) CREATE TABLE fielding_postseason ( player_id text, year number, team_id text, league_id text, round text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, tp number, pb number, sb number, cs number ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE pitching ( player_id text, year number, stint number, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, baopp number, era number, ibb number, wp number, hbp number, bk number, bfp number, gf number, r number, sh number, sf number, g_idp number ) CREATE TABLE pitching_postseason ( player_id text, year number, round text, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, baopp text, era number, ibb number, wp number, hbp number, bk number, bfp number, gf number, r number, sh number, sf number, g_idp number ) CREATE TABLE home_game ( year number, league_id text, team_id text, park_id text, span_first text, span_last text, games number, openings number, attendance number ) CREATE TABLE batting_postseason ( year number, round text, player_id text, team_id text, league_id text, g number, ab number, r number, h number, double number, triple number, hr number, rbi number, sb number, cs number, bb number, so number, ibb number, hbp number, sh number, sf number, g_idp number ) CREATE TABLE all_star ( player_id text, year number, game_num number, game_id text, team_id text, league_id text, gp number, starting_pos number ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number ) ### Response: SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
find out the average age of patients whose marital status is single and ethnicity is hispanic/latino - puerto rican.
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 ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find out the average age of patients whose marital status is single and ethnicity is hispanic/latino - puerto rican. ### Input: 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 ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
What year was finish Toulouse, and stage was larger than 12?
CREATE TABLE table_66233 ( "Year" real, "Stage" real, "Start" text, "Finish" text, "Leader at the summit" text )
SELECT SUM("Year") FROM table_66233 WHERE "Finish" = 'toulouse' AND "Stage" > '12'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was finish Toulouse, and stage was larger than 12? ### Input: CREATE TABLE table_66233 ( "Year" real, "Stage" real, "Start" text, "Finish" text, "Leader at the summit" text ) ### Response: SELECT SUM("Year") FROM table_66233 WHERE "Finish" = 'toulouse' AND "Stage" > '12'
WHICH Outcome IS ON 18 july 1993?
CREATE TABLE table_36288 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Outcome" FROM table_36288 WHERE "Date" = '18 july 1993'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHICH Outcome IS ON 18 july 1993? ### Input: CREATE TABLE table_36288 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) ### Response: SELECT "Outcome" FROM table_36288 WHERE "Date" = '18 july 1993'
since 2105, what are the top four most frequent diagnoses that patients were given during the same hospital encounter after being diagnosed with ventricular tachycardia - sustained?
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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ventricular tachycardia - sustained' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 2105, what are the top four most frequent diagnoses that patients were given during the same hospital encounter after being diagnosed with ventricular tachycardia - sustained? ### Input: 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) ### Response: SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ventricular tachycardia - sustained' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4
What is the total number of Wins, when Draws is less than 2?
CREATE TABLE table_name_48 ( wins VARCHAR, draws INTEGER )
SELECT COUNT(wins) FROM table_name_48 WHERE draws < 2
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Wins, when Draws is less than 2? ### Input: CREATE TABLE table_name_48 ( wins VARCHAR, draws INTEGER ) ### Response: SELECT COUNT(wins) FROM table_name_48 WHERE draws < 2
what was the first type of hospital admission type of patient 3939?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 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 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 3939 ORDER BY admissions.admittime LIMIT 1
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first type of hospital admission type of patient 3939? ### Input: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 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 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Response: SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 3939 ORDER BY admissions.admittime LIMIT 1
What year was the USS Cambridge laid down?
CREATE TABLE table_66047 ( "Hull Number" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text )
SELECT "Laid down" FROM table_66047 WHERE "Name" = 'uss cambridge'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the USS Cambridge laid down? ### Input: CREATE TABLE table_66047 ( "Hull Number" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text ) ### Response: SELECT "Laid down" FROM table_66047 WHERE "Name" = 'uss cambridge'
What is the rank of Lee Trevino, who had less than 27 wins?
CREATE TABLE table_name_89 ( rank INTEGER, player VARCHAR, wins VARCHAR )
SELECT SUM(rank) FROM table_name_89 WHERE player = "lee trevino" AND wins < 27
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank of Lee Trevino, who had less than 27 wins? ### Input: CREATE TABLE table_name_89 ( rank INTEGER, player VARCHAR, wins VARCHAR ) ### Response: SELECT SUM(rank) FROM table_name_89 WHERE player = "lee trevino" AND wins < 27
How many courses for each office? Show me a bar chart, could you show by the x-axis in desc please?
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int )
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many courses for each office? Show me a bar chart, could you show by the x-axis in desc please? ### Input: CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) ### Response: SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC
what's the cancelable with bubbles being yes
CREATE TABLE table_1507852_5 ( cancelable VARCHAR, bubbles VARCHAR )
SELECT cancelable FROM table_1507852_5 WHERE bubbles = "Yes"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the cancelable with bubbles being yes ### Input: CREATE TABLE table_1507852_5 ( cancelable VARCHAR, bubbles VARCHAR ) ### Response: SELECT cancelable FROM table_1507852_5 WHERE bubbles = "Yes"
to which religious background does the patient with patient id 6983 belong to?
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( 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 )
SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: to which religious background does the patient with patient id 6983 belong to? ### Input: 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( 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 ) ### Response: SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983"
What is the highest numbered pick from round 7?
CREATE TABLE table_37107 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
SELECT MAX("Pick") FROM table_37107 WHERE "Round" = '7'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest numbered pick from round 7? ### Input: CREATE TABLE table_37107 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text ) ### Response: SELECT MAX("Pick") FROM table_37107 WHERE "Round" = '7'
list patient identifications of patients who were diagnosed with ac/chr syst/dia hrt fail since 2 years ago.
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 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 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 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text )
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 = 'ac/chr syst/dia hrt fail') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year'))
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list patient identifications of patients who were diagnosed with ac/chr syst/dia hrt fail since 2 years ago. ### Input: 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 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 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 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) ### Response: 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 = 'ac/chr syst/dia hrt fail') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year'))
What was the date of the premiere that had a 20.9 rating?
CREATE TABLE table_name_38 ( premiere VARCHAR, rating VARCHAR )
SELECT premiere FROM table_name_38 WHERE rating = "20.9"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the premiere that had a 20.9 rating? ### Input: CREATE TABLE table_name_38 ( premiere VARCHAR, rating VARCHAR ) ### Response: SELECT premiere FROM table_name_38 WHERE rating = "20.9"
What are the number of the dates in which the mean sea level pressure was between 30.3 and 31?
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, max_wind_Speed_mph INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT )
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of the dates in which the mean sea level pressure was between 30.3 and 31? ### Input: CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, max_wind_Speed_mph INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) ### Response: SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
count the number of patients whose marital status is married and age is less than 31?
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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age < "31"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose marital status is married and age is less than 31? ### Input: 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age < "31"
How many field goals did Donald Green score?
CREATE TABLE table_28062 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
SELECT COUNT("Field goals") FROM table_28062 WHERE "Player" = 'Donald Green'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many field goals did Donald Green score? ### Input: CREATE TABLE table_28062 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) ### Response: SELECT COUNT("Field goals") FROM table_28062 WHERE "Player" = 'Donald Green'
Please list the location and the winning aircraft name.
CREATE TABLE aircraft ( Aircraft VARCHAR, Aircraft_ID VARCHAR ) CREATE TABLE MATCH ( Location VARCHAR, Winning_Aircraft VARCHAR )
SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please list the location and the winning aircraft name. ### Input: CREATE TABLE aircraft ( Aircraft VARCHAR, Aircraft_ID VARCHAR ) CREATE TABLE MATCH ( Location VARCHAR, Winning_Aircraft VARCHAR ) ### Response: SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft
Which is the LMS SPR when the car number was 15?
CREATE TABLE table_name_60 ( lms_spr VARCHAR, car_no VARCHAR )
SELECT lms_spr FROM table_name_60 WHERE car_no = "15"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which is the LMS SPR when the car number was 15? ### Input: CREATE TABLE table_name_60 ( lms_spr VARCHAR, car_no VARCHAR ) ### Response: SELECT lms_spr FROM table_name_60 WHERE car_no = "15"
Which Run 4 has a Run 3 of 1:26.63?
CREATE TABLE table_77470 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
SELECT "Run 4" FROM table_77470 WHERE "Run 3" = '1:26.63'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Run 4 has a Run 3 of 1:26.63? ### Input: CREATE TABLE table_77470 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text ) ### Response: SELECT "Run 4" FROM table_77470 WHERE "Run 3" = '1:26.63'
how many patients died in or before 2115?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients died in or before 2115? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0"
Before 1956, what Chassis has Gordini Straight-4 engine with 3 points?
CREATE TABLE table_80101 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
SELECT "Chassis" FROM table_80101 WHERE "Year" < '1956' AND "Engine" = 'gordini straight-4' AND "Points" = '3'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Before 1956, what Chassis has Gordini Straight-4 engine with 3 points? ### Input: CREATE TABLE table_80101 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) ### Response: SELECT "Chassis" FROM table_80101 WHERE "Year" < '1956' AND "Engine" = 'gordini straight-4' AND "Points" = '3'
count the number of times that patient 031-15666 has received a anion gap test in the lab since 157 months ago.
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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) 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 )
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-157 month')
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of times that patient 031-15666 has received a anion gap test in the lab since 157 months ago. ### Input: 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) 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 ) ### Response: SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-157 month')
What is the rank of American Pie 2?
CREATE TABLE table_name_4 ( rank INTEGER, title VARCHAR )
SELECT MIN(rank) FROM table_name_4 WHERE title = "american pie 2"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank of American Pie 2? ### Input: CREATE TABLE table_name_4 ( rank INTEGER, title VARCHAR ) ### Response: SELECT MIN(rank) FROM table_name_4 WHERE title = "american pie 2"
What's the total for the wc belgrade event with 10 rank points?
CREATE TABLE table_60905 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
SELECT "Total" FROM table_60905 WHERE "Event" = 'wc belgrade' AND "Rank points" = '10'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the total for the wc belgrade event with 10 rank points? ### Input: CREATE TABLE table_60905 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text ) ### Response: SELECT "Total" FROM table_60905 WHERE "Event" = 'wc belgrade' AND "Rank points" = '10'
count the number of patients whose admission location is emergency room admit and age is less than 85?
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 ) 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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.age < "85"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose admission location is emergency room admit and age is less than 85? ### Input: 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 ) 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.age < "85"
What year was the comp 33?
CREATE TABLE table_54933 ( "Year" text, "Team" text, "Comp" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text )
SELECT "Year" FROM table_54933 WHERE "Comp" = '33'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the comp 33? ### Input: CREATE TABLE table_54933 ( "Year" text, "Team" text, "Comp" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text ) ### Response: SELECT "Year" FROM table_54933 WHERE "Comp" = '33'
Which date has a Record of 22-22?
CREATE TABLE table_15615 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Date" FROM table_15615 WHERE "Record" = '22-22'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which date has a Record of 22-22? ### Input: CREATE TABLE table_15615 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) ### Response: SELECT "Date" FROM table_15615 WHERE "Record" = '22-22'
What round did the spartak moscow club play?
CREATE TABLE table_name_12 ( round VARCHAR, club VARCHAR )
SELECT round FROM table_name_12 WHERE club = "spartak moscow"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What round did the spartak moscow club play? ### Input: CREATE TABLE table_name_12 ( round VARCHAR, club VARCHAR ) ### Response: SELECT round FROM table_name_12 WHERE club = "spartak moscow"
Who is the manager whose rank is 16?
CREATE TABLE table_72293 ( "Season" text, "League" text, "Rank" real, "Games" real, "Points" real, "GF" real, "GA" real, "Manager" text, "Top Scorer" text, "Goals" real )
SELECT "Manager" FROM table_72293 WHERE "Rank" = '16'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the manager whose rank is 16? ### Input: CREATE TABLE table_72293 ( "Season" text, "League" text, "Rank" real, "Games" real, "Points" real, "GF" real, "GA" real, "Manager" text, "Top Scorer" text, "Goals" real ) ### Response: SELECT "Manager" FROM table_72293 WHERE "Rank" = '16'
Was there HDTV when the service was Priv ?
CREATE TABLE table_20385 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text )
SELECT "HDTV" FROM table_20385 WHERE "Television service" = 'PRIVÈ'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Was there HDTV when the service was Priv ? ### Input: CREATE TABLE table_20385 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text ) ### Response: SELECT "HDTV" FROM table_20385 WHERE "Television service" = 'PRIVÈ'
what's the builder where withdrawn is 1954 1958
CREATE TABLE table_1181375_1 ( builder VARCHAR, withdrawn VARCHAR )
SELECT builder FROM table_1181375_1 WHERE withdrawn = "1954–1958"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the builder where withdrawn is 1954 1958 ### Input: CREATE TABLE table_1181375_1 ( builder VARCHAR, withdrawn VARCHAR ) ### Response: SELECT builder FROM table_1181375_1 WHERE withdrawn = "1954–1958"
Give me a bar chart that the x-axis is the services and the Y is the count(services), and could you show bars from low to high order?
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) 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 )
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart that the x-axis is the services and the Y is the count(services), and could you show bars from low to high order? ### Input: CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) 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 ) ### Response: SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services
How many different roles are there in the club 'Bootup Baltimore'?
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text )
SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different roles are there in the club 'Bootup Baltimore'? ### Input: CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) ### Response: SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
What is the date of the Outback Steakhouse Pro-Am Tournament?
CREATE TABLE table_name_94 ( date VARCHAR, tournament VARCHAR )
SELECT date FROM table_name_94 WHERE tournament = "outback steakhouse pro-am"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date of the Outback Steakhouse Pro-Am Tournament? ### Input: CREATE TABLE table_name_94 ( date VARCHAR, tournament VARCHAR ) ### Response: SELECT date FROM table_name_94 WHERE tournament = "outback steakhouse pro-am"
what is patient 025-66662's gender?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 )
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '025-66662'
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is patient 025-66662's gender? ### Input: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 ) ### Response: SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '025-66662'
What stadium was the December 29, 2008 game played at?
CREATE TABLE table_41009 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text )
SELECT "Stadium" FROM table_41009 WHERE "Date" = 'december 29, 2008'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What stadium was the December 29, 2008 game played at? ### Input: CREATE TABLE table_41009 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text ) ### Response: SELECT "Stadium" FROM table_41009 WHERE "Date" = 'december 29, 2008'
What is the smallest number of third place earned for the Es Sahel at a rank less than 3?
CREATE TABLE table_name_37 ( third INTEGER, club VARCHAR, rank VARCHAR )
SELECT MIN(third) FROM table_name_37 WHERE club = "es sahel" AND rank < 3
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest number of third place earned for the Es Sahel at a rank less than 3? ### Input: CREATE TABLE table_name_37 ( third INTEGER, club VARCHAR, rank VARCHAR ) ### Response: SELECT MIN(third) FROM table_name_37 WHERE club = "es sahel" AND rank < 3
Name the club for when tries for is 32
CREATE TABLE table_17625749_1 ( club VARCHAR, tries_for VARCHAR )
SELECT club FROM table_17625749_1 WHERE tries_for = "32"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the club for when tries for is 32 ### Input: CREATE TABLE table_17625749_1 ( club VARCHAR, tries_for VARCHAR ) ### Response: SELECT club FROM table_17625749_1 WHERE tries_for = "32"
What position is the player Jordan Fransoo in?
CREATE TABLE table_17209 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
SELECT "Position" FROM table_17209 WHERE "Player" = 'Jordan Fransoo'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What position is the player Jordan Fransoo in? ### Input: CREATE TABLE table_17209 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text ) ### Response: SELECT "Position" FROM table_17209 WHERE "Player" = 'Jordan Fransoo'
Venue of klfa stadium, cheras, and a Score of 3-3 had what competition?
CREATE TABLE table_name_71 ( competition VARCHAR, venue VARCHAR, score VARCHAR )
SELECT competition FROM table_name_71 WHERE venue = "klfa stadium, cheras" AND score = "3-3"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Venue of klfa stadium, cheras, and a Score of 3-3 had what competition? ### Input: CREATE TABLE table_name_71 ( competition VARCHAR, venue VARCHAR, score VARCHAR ) ### Response: SELECT competition FROM table_name_71 WHERE venue = "klfa stadium, cheras" AND score = "3-3"
For the top 3 days with the largest max gust speeds, show the date and average temperature with a bar chart.
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, max_wind_Speed_mph INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER )
SELECT date, mean_temperature_f FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the top 3 days with the largest max gust speeds, show the date and average temperature with a bar chart. ### Input: CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, max_wind_Speed_mph INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER ) ### Response: SELECT date, mean_temperature_f FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
how many tv shows did natalia oreiro between 1998 and 2002 ?
CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text )
SELECT COUNT("title") FROM table_204_871 WHERE "ano" >= 1998 AND "ano" <= 2002
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many tv shows did natalia oreiro between 1998 and 2002 ? ### Input: CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text ) ### Response: SELECT COUNT("title") FROM table_204_871 WHERE "ano" >= 1998 AND "ano" <= 2002
What is the date when Grimsby Town is the home team?
CREATE TABLE table_8011 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Date" FROM table_8011 WHERE "Home team" = 'grimsby town'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date when Grimsby Town is the home team? ### Input: CREATE TABLE table_8011 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) ### Response: SELECT "Date" FROM table_8011 WHERE "Home team" = 'grimsby town'
When 4744 is the avg. trips per mile (x1000) what is the current stock?
CREATE TABLE table_21956 ( "Name" text, "Map colour" text, "First operated" real, "Type" text, "Length" text, "No. Sta" real, "Current Stock" text, "Future Stock" text, "Trips per annum (\u00d71000)" real, "Avg. trips per mile (\u00d71000)" real )
SELECT "Current Stock" FROM table_21956 WHERE "Avg. trips per mile (\u00d71000)" = '4744'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When 4744 is the avg. trips per mile (x1000) what is the current stock? ### Input: CREATE TABLE table_21956 ( "Name" text, "Map colour" text, "First operated" real, "Type" text, "Length" text, "No. Sta" real, "Current Stock" text, "Future Stock" text, "Trips per annum (\u00d71000)" real, "Avg. trips per mile (\u00d71000)" real ) ### Response: SELECT "Current Stock" FROM table_21956 WHERE "Avg. trips per mile (\u00d71000)" = '4744'
What is the current series where the new series began in June 2011?
CREATE TABLE table_1000181_1 ( current_series VARCHAR, notes VARCHAR )
SELECT current_series FROM table_1000181_1 WHERE notes = "New series began in June 2011"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the current series where the new series began in June 2011? ### Input: CREATE TABLE table_1000181_1 ( current_series VARCHAR, notes VARCHAR ) ### Response: SELECT current_series FROM table_1000181_1 WHERE notes = "New series began in June 2011"
the cheapest flights between BOSTON and PHILADELPHIA which arrive between 3 and 1700 o'clock on tuesday
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) OR (date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT (flight.arrival_time < flight.departure_time))) AND (flight.arrival_time <= 1700 AND flight.arrival_time >= 1500)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias1, days AS DAYSalias1, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE (((((FLIGHTalias1.arrival_time < FLIGHTalias1.departure_time) AND DATE_DAYalias1.day_number = 22 AND DATE_DAYalias1.month_number = 3 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code) OR (DATE_DAYalias1.day_number = 22 AND DATE_DAYalias1.month_number = 3 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND NOT (FLIGHTalias1.arrival_time < FLIGHTalias1.departure_time))) AND (FLIGHTalias1.arrival_time <= 1700 AND FLIGHTalias1.arrival_time >= 1500)) AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'PHILADELPHIA' AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'BOSTON' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: the cheapest flights between BOSTON and PHILADELPHIA which arrive between 3 and 1700 o'clock on tuesday ### Input: CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) OR (date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT (flight.arrival_time < flight.departure_time))) AND (flight.arrival_time <= 1700 AND flight.arrival_time >= 1500)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias1, days AS DAYSalias1, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE (((((FLIGHTalias1.arrival_time < FLIGHTalias1.departure_time) AND DATE_DAYalias1.day_number = 22 AND DATE_DAYalias1.month_number = 3 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code) OR (DATE_DAYalias1.day_number = 22 AND DATE_DAYalias1.month_number = 3 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND NOT (FLIGHTalias1.arrival_time < FLIGHTalias1.departure_time))) AND (FLIGHTalias1.arrival_time <= 1700 AND FLIGHTalias1.arrival_time >= 1500)) AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'PHILADELPHIA' AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'BOSTON' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
which team did this team face against next after beating minnesota on january 29 of this season ?
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
SELECT "opponent" FROM table_204_795 WHERE "date" > (SELECT "date" FROM table_204_795 WHERE "date" = 'january 29, 1949') ORDER BY "date" LIMIT 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which team did this team face against next after beating minnesota on january 29 of this season ? ### Input: CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number ) ### Response: SELECT "opponent" FROM table_204_795 WHERE "date" > (SELECT "date" FROM table_204_795 WHERE "date" = 'january 29, 1949') ORDER BY "date" LIMIT 1
What date had a versus of source: cricinfo.com?
CREATE TABLE table_54709 ( "Catches" text, "Player" text, "Versus" text, "Venue" text, "Date" text )
SELECT "Date" FROM table_54709 WHERE "Versus" = 'source: cricinfo.com'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date had a versus of source: cricinfo.com? ### Input: CREATE TABLE table_54709 ( "Catches" text, "Player" text, "Versus" text, "Venue" text, "Date" text ) ### Response: SELECT "Date" FROM table_54709 WHERE "Versus" = 'source: cricinfo.com'
what's the grand finalist where winners is collingwood
CREATE TABLE table_16698 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
SELECT "Grand Finalist" FROM table_16698 WHERE "Winners" = 'Collingwood'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the grand finalist where winners is collingwood ### Input: CREATE TABLE table_16698 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text ) ### Response: SELECT "Grand Finalist" FROM table_16698 WHERE "Winners" = 'Collingwood'
What is the Venue with the Friendly Competition?
CREATE TABLE table_12283 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT "Venue" FROM table_12283 WHERE "Competition" = 'friendly'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Venue with the Friendly Competition? ### Input: CREATE TABLE table_12283 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) ### Response: SELECT "Venue" FROM table_12283 WHERE "Competition" = 'friendly'
Find the number of dorms for each gender in a bar chart, I want to show by the x axis from high to low please.
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER )
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY gender DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of dorms for each gender in a bar chart, I want to show by the x axis from high to low please. ### Input: CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) ### Response: SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY gender DESC
what was the name of the output that patient 002-7771 got last until 1929 days ago?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1929 day') ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the output that patient 002-7771 got last until 1929 days ago? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ### Response: SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1929 day') ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1
what are the top three most common laboratory tests that followed in the same hospital encounter for patients who were given ins drug-elut coronry st until 2103?
CREATE TABLE diagnoses_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 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 d_items ( row_id number, itemid number, label text, linksto 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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_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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins drug-elut coronry st') AND STRFTIME('%y', procedures_icd.charttime) <= '2103') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime, admissions.hadm_id FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) <= '2103') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 3)
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top three most common laboratory tests that followed in the same hospital encounter for patients who were given ins drug-elut coronry st until 2103? ### Input: CREATE TABLE diagnoses_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 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 d_items ( row_id number, itemid number, label text, linksto 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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_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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) ### Response: SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins drug-elut coronry st') AND STRFTIME('%y', procedures_icd.charttime) <= '2103') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime, admissions.hadm_id FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) <= '2103') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 3)
What was the score of the match played on 5 September 2001?
CREATE TABLE table_name_38 ( score VARCHAR, date VARCHAR )
SELECT score FROM table_name_38 WHERE date = "5 september 2001"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the match played on 5 September 2001? ### Input: CREATE TABLE table_name_38 ( score VARCHAR, date VARCHAR ) ### Response: SELECT score FROM table_name_38 WHERE date = "5 september 2001"
What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and 0 drawn?
CREATE TABLE table_69759 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text )
SELECT SUM("Played") FROM table_69759 WHERE "First game" < '2000' AND "Lost" < '21' AND "Drawn" < '0'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and 0 drawn? ### Input: CREATE TABLE table_69759 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text ) ### Response: SELECT SUM("Played") FROM table_69759 WHERE "First game" < '2000' AND "Lost" < '21' AND "Drawn" < '0'