instruction
stringlengths 20
309
| input
stringlengths 45
7.14k
| response
stringlengths 24
2.22k
| source
stringclasses 15
values | text
stringlengths 337
7.52k
|
---|---|---|---|---|
How much Area (km 2) has a Common of collegno, and a Population smaller than 50137? | CREATE TABLE table_name_60 (
area__km_2__ VARCHAR,
common_of VARCHAR,
population VARCHAR
) | SELECT COUNT(area__km_2__) FROM table_name_60 WHERE common_of = "collegno" AND population < 50137 | 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 Area (km 2) has a Common of collegno, and a Population smaller than 50137? ### Input: CREATE TABLE table_name_60 (
area__km_2__ VARCHAR,
common_of VARCHAR,
population VARCHAR
) ### Response: SELECT COUNT(area__km_2__) FROM table_name_60 WHERE common_of = "collegno" AND population < 50137 |
What 7:00 has a 10:00 of dirty sexy money? | CREATE TABLE table_67978 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) | SELECT "7:00" FROM table_67978 WHERE "10:00" = 'dirty sexy money' | 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 7:00 has a 10:00 of dirty sexy money? ### Input: CREATE TABLE table_67978 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) ### Response: SELECT "7:00" FROM table_67978 WHERE "10:00" = 'dirty sexy money' |
Did I mark all my questions as accepted?. | 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 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
) | SELECT Id AS "post_link", * FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND OwnerUserId = '##ownerid##' | 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: Did I mark all my questions as accepted?. ### Input: 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 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
) ### Response: SELECT Id AS "post_link", * FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND OwnerUserId = '##ownerid##' |
If the driver is Milka Duno, what is the name of the team? | CREATE TABLE table_21872 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
) | SELECT "Team" FROM table_21872 WHERE "Driver" = 'Milka Duno' | 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: If the driver is Milka Duno, what is the name of the team? ### Input: CREATE TABLE table_21872 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
) ### Response: SELECT "Team" FROM table_21872 WHERE "Driver" = 'Milka Duno' |
In what place did Dave Barr score? | CREATE TABLE table_8817 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Place" FROM table_8817 WHERE "Player" = 'dave barr' | 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: In what place did Dave Barr score? ### Input: CREATE TABLE table_8817 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) ### Response: SELECT "Place" FROM table_8817 WHERE "Player" = 'dave barr' |
What is the average laps for a grid larger than 2, for a ferrari that got in an accident? | CREATE TABLE table_name_87 (
laps INTEGER,
constructor VARCHAR,
grid VARCHAR,
time_retired VARCHAR
) | SELECT AVG(laps) FROM table_name_87 WHERE grid > 2 AND time_retired = "accident" AND constructor = "ferrari" | 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 laps for a grid larger than 2, for a ferrari that got in an accident? ### Input: CREATE TABLE table_name_87 (
laps INTEGER,
constructor VARCHAR,
grid VARCHAR,
time_retired VARCHAR
) ### Response: SELECT AVG(laps) FROM table_name_87 WHERE grid > 2 AND time_retired = "accident" AND constructor = "ferrari" |
how many patients are diagnosed with primary disease copd exacerbation? | 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 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
)
CREATE TABLE procedures (
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.diagnosis = "COPD EXACERBATION" | 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 are diagnosed with primary disease copd exacerbation? ### 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 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
)
CREATE TABLE procedures (
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.diagnosis = "COPD EXACERBATION" |
What Country's Content is TV Locale? | CREATE TABLE table_40678 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | SELECT "Country" FROM table_40678 WHERE "Content" = 'tv locale' | 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 Country's Content is TV Locale? ### Input: CREATE TABLE table_40678 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) ### Response: SELECT "Country" FROM table_40678 WHERE "Content" = 'tv locale' |
Who had the high rebounds when the record was 14 7? | CREATE TABLE table_29843 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "High rebounds" FROM table_29843 WHERE "Record" = '14–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: Who had the high rebounds when the record was 14 7? ### Input: CREATE TABLE table_29843 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT "High rebounds" FROM table_29843 WHERE "Record" = '14–7' |
Name the money for p draig harrington | CREATE TABLE table_68355 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | SELECT "Money ( \u00a3 )" FROM table_68355 WHERE "Player" = 'pádraig harrington' | 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: Name the money for p draig harrington ### Input: CREATE TABLE table_68355 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) ### Response: SELECT "Money ( \u00a3 )" FROM table_68355 WHERE "Player" = 'pádraig harrington' |
Which Date has a Record of 19 16 8? | CREATE TABLE table_64405 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | SELECT "Date" FROM table_64405 WHERE "Record" = '19–16–8' | 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 19 16 8? ### Input: CREATE TABLE table_64405 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) ### Response: SELECT "Date" FROM table_64405 WHERE "Record" = '19–16–8' |
Which Monday Mona/Mani also had a Thursday Thunor/Thor of Tongersdei? | CREATE TABLE table_66876 (
"Sunday Sunna/S\u00f3l" text,
"Monday Mona/ M\u00e1ni" text,
"Tuesday Tiw/ Tyr" text,
"Wednesday Woden / Odin" text,
"Thursday Thunor / Thor" text,
"Friday Frige or Freya" text,
"Saturday Saturn" text
) | SELECT "Monday Mona/ M\u00e1ni" FROM table_66876 WHERE "Thursday Thunor / Thor" = 'tongersdei' | 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 Monday Mona/Mani also had a Thursday Thunor/Thor of Tongersdei? ### Input: CREATE TABLE table_66876 (
"Sunday Sunna/S\u00f3l" text,
"Monday Mona/ M\u00e1ni" text,
"Tuesday Tiw/ Tyr" text,
"Wednesday Woden / Odin" text,
"Thursday Thunor / Thor" text,
"Friday Frige or Freya" text,
"Saturday Saturn" text
) ### Response: SELECT "Monday Mona/ M\u00e1ni" FROM table_66876 WHERE "Thursday Thunor / Thor" = 'tongersdei' |
What's the loss for September 16? | CREATE TABLE table_79725 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | SELECT "Loss" FROM table_79725 WHERE "Date" = 'september 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: What's the loss for September 16? ### Input: CREATE TABLE table_79725 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) ### Response: SELECT "Loss" FROM table_79725 WHERE "Date" = 'september 16' |
Name the number of week for game site being memorial stadium for buffalo bills | CREATE TABLE table_14940519_1 (
week VARCHAR,
game_site VARCHAR,
opponent VARCHAR
) | SELECT COUNT(week) FROM table_14940519_1 WHERE game_site = "Memorial Stadium" AND opponent = "Buffalo Bills" | 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 number of week for game site being memorial stadium for buffalo bills ### Input: CREATE TABLE table_14940519_1 (
week VARCHAR,
game_site VARCHAR,
opponent VARCHAR
) ### Response: SELECT COUNT(week) FROM table_14940519_1 WHERE game_site = "Memorial Stadium" AND opponent = "Buffalo Bills" |
Where did the Vit ria de Set bal club place in the 2006-2007 season? | CREATE TABLE table_51904 (
"Club" text,
"Head Coach" text,
"City" text,
"Stadium" text,
"2006-2007 season" text
) | SELECT "2006-2007 season" FROM table_51904 WHERE "Club" = 'vitória de setúbal' | 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: Where did the Vit ria de Set bal club place in the 2006-2007 season? ### Input: CREATE TABLE table_51904 (
"Club" text,
"Head Coach" text,
"City" text,
"Stadium" text,
"2006-2007 season" text
) ### Response: SELECT "2006-2007 season" FROM table_51904 WHERE "Club" = 'vitória de setúbal' |
How many students does each advisor have. Show scatter chart. | 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 Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
) | SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor | 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 students does each advisor have. Show scatter chart. ### Input: 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 Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
) ### Response: SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor |
tell me the maximum hospital cost if there is a gstr/ddnts nos w hmrhg this year? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 d_labitems (
row_id number,
itemid number,
label 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_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
) | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.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 = 'gstr/ddnts nos w hmrhg')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS t1 | 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: tell me the maximum hospital cost if there is a gstr/ddnts nos w hmrhg this year? ### Input: CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 d_labitems (
row_id number,
itemid number,
label 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_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
) ### Response: SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.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 = 'gstr/ddnts nos w hmrhg')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS t1 |
Name the birth of the person married 24 may 1935 | CREATE TABLE table_68311 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Ceased to be Consort" text,
"Spouse" text
) | SELECT "Birth" FROM table_68311 WHERE "Marriage" = '24 may 1935' | 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: Name the birth of the person married 24 may 1935 ### Input: CREATE TABLE table_68311 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Ceased to be Consort" text,
"Spouse" text
) ### Response: SELECT "Birth" FROM table_68311 WHERE "Marriage" = '24 may 1935' |
How many attended during the game with a score of 80-94? | CREATE TABLE table_name_52 (
attendance INTEGER,
score VARCHAR
) | SELECT SUM(attendance) FROM table_name_52 WHERE score = "80-94" | 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 attended during the game with a score of 80-94? ### Input: CREATE TABLE table_name_52 (
attendance INTEGER,
score VARCHAR
) ### Response: SELECT SUM(attendance) FROM table_name_52 WHERE score = "80-94" |
Draw a bar chart of asset make versus the number of asset make, and display in asc by the X. | CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DATETIME,
other_visit_details VARCHAR(255)
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
asset_disposed_date DATETIME,
other_asset_details VARCHAR(255)
)
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
) | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make | 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: Draw a bar chart of asset make versus the number of asset make, and display in asc by the X. ### Input: CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DATETIME,
other_visit_details VARCHAR(255)
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
asset_disposed_date DATETIME,
other_asset_details VARCHAR(255)
)
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
) ### Response: SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make |
How many cop apps in the season with fewer than 12 league apps? | CREATE TABLE table_32374 (
"Season" text,
"Team" text,
"League Apps" real,
"League Goals" real,
"Cup Apps" real,
"Cup Goals" real
) | SELECT SUM("Cup Apps") FROM table_32374 WHERE "League Apps" < '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: How many cop apps in the season with fewer than 12 league apps? ### Input: CREATE TABLE table_32374 (
"Season" text,
"Team" text,
"League Apps" real,
"League Goals" real,
"Cup Apps" real,
"Cup Goals" real
) ### Response: SELECT SUM("Cup Apps") FROM table_32374 WHERE "League Apps" < '12' |
What competition has the club villareal? | CREATE TABLE table_name_89 (
competition VARCHAR,
club VARCHAR
) | SELECT competition FROM table_name_89 WHERE club = "villareal" | 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 competition has the club villareal? ### Input: CREATE TABLE table_name_89 (
competition VARCHAR,
club VARCHAR
) ### Response: SELECT competition FROM table_name_89 WHERE club = "villareal" |
when was joe clark first elected ? | CREATE TABLE table_203_214 (
id number,
"member" text,
"party" text,
"electorate" text,
"state" text,
"first elected" text
) | SELECT "first elected" FROM table_203_214 WHERE "member" = 'joe clark' | 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: when was joe clark first elected ? ### Input: CREATE TABLE table_203_214 (
id number,
"member" text,
"party" text,
"electorate" text,
"state" text,
"first elected" text
) ### Response: SELECT "first elected" FROM table_203_214 WHERE "member" = 'joe clark' |
Bar graph to show how many nationality from different nationality, list in desc by the total number. | CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) 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: Bar graph to show how many nationality from different nationality, list in desc by the total number. ### Input: CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) ### Response: SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC |
what are the top five frequent prescribed drugs that were prescribed to patients aged 20s in the same hospital encounter after they had been diagnosed with quadriplegia-partial until 2104? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime 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 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 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 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'quadriplegia-partial' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.age BETWEEN 20 AND 29 AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5 | 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 are the top five frequent prescribed drugs that were prescribed to patients aged 20s in the same hospital encounter after they had been diagnosed with quadriplegia-partial until 2104? ### Input: CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime 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 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 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 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) ### Response: SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'quadriplegia-partial' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.age BETWEEN 20 AND 29 AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5 |
In which venue did the competition on 11 October 2008 take place? | CREATE TABLE table_14524 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | SELECT "Venue" FROM table_14524 WHERE "Date" = '11 october 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: In which venue did the competition on 11 October 2008 take place? ### Input: CREATE TABLE table_14524 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) ### Response: SELECT "Venue" FROM table_14524 WHERE "Date" = '11 october 2008' |
Display a bar chart for what are the different card types, and how many cards are there of each? | CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
) | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code | 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: Display a bar chart for what are the different card types, and how many cards are there of each? ### Input: CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
) ### Response: SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code |
count the number of patients whose days of hospital stay is greater than 17 and diagnoses long title is diabetes with renal manifestations, type i [juvenile type], not stated as uncontrolled? | 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 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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.long_title = "Diabetes with renal manifestations, type I [juvenile type], not stated as uncontrolled" | 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 days of hospital stay is greater than 17 and diagnoses long title is diabetes with renal manifestations, type i [juvenile type], not stated as uncontrolled? ### 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 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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.long_title = "Diabetes with renal manifestations, type I [juvenile type], not stated as uncontrolled" |
give me the number of patients less than 45 years who were hospitalized for more than 20 days. | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
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 < "45" AND demographic.days_stay > "20" | 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 less than 45 years who were hospitalized for more than 20 days. ### 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
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 < "45" AND demographic.days_stay > "20" |
Which venue does Mardan sponsor? | CREATE TABLE table_17356873_1 (
venue VARCHAR,
shirt_sponsor VARCHAR
) | SELECT venue FROM table_17356873_1 WHERE shirt_sponsor = "Mardan" | 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 venue does Mardan sponsor? ### Input: CREATE TABLE table_17356873_1 (
venue VARCHAR,
shirt_sponsor VARCHAR
) ### Response: SELECT venue FROM table_17356873_1 WHERE shirt_sponsor = "Mardan" |
Who was the runner-up in season five? | CREATE TABLE table_16331144_1 (
runner_up VARCHAR,
season VARCHAR
) | SELECT runner_up FROM table_16331144_1 WHERE season = "Five" | 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 was the runner-up in season five? ### Input: CREATE TABLE table_16331144_1 (
runner_up VARCHAR,
season VARCHAR
) ### Response: SELECT runner_up FROM table_16331144_1 WHERE season = "Five" |
what's the transmission where turbo is yes (mitsubishi td04-16t ) | CREATE TABLE table_16484 (
"Trim" text,
"Engine" text,
"Turbo" text,
"Fuel Delivery" text,
"Power" text,
"Torque" text,
"Transmission" text,
"Performance" text
) | SELECT "Transmission" FROM table_16484 WHERE "Turbo" = 'Yes (Mitsubishi TD04-16t )' | 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 transmission where turbo is yes (mitsubishi td04-16t ) ### Input: CREATE TABLE table_16484 (
"Trim" text,
"Engine" text,
"Turbo" text,
"Fuel Delivery" text,
"Power" text,
"Torque" text,
"Transmission" text,
"Performance" text
) ### Response: SELECT "Transmission" FROM table_16484 WHERE "Turbo" = 'Yes (Mitsubishi TD04-16t )' |
What is the lowest round of Ed Smith, who had a pick lower than 19? | CREATE TABLE table_35935 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | SELECT MIN("Round") FROM table_35935 WHERE "Player" = 'ed smith' AND "Pick" > '19' | 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 lowest round of Ed Smith, who had a pick lower than 19? ### Input: CREATE TABLE table_35935 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) ### Response: SELECT MIN("Round") FROM table_35935 WHERE "Player" = 'ed smith' AND "Pick" > '19' |
count the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and lab test fluid is urine? | 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
)
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Urine" | 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 primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and lab test fluid is urine? ### 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 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
)
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Urine" |
The plural abbreviation of ll. uses what plural word? | CREATE TABLE table_name_94 (
plural_word VARCHAR,
plural_abbreviation VARCHAR
) | SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = "ll." | 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: The plural abbreviation of ll. uses what plural word? ### Input: CREATE TABLE table_name_94 (
plural_word VARCHAR,
plural_abbreviation VARCHAR
) ### Response: SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = "ll." |
list flights from INDIANAPOLIS to MEMPHIS with fares on monday | 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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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 state (
state_code text,
state_name text,
country_name text
)
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 equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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 days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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 time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
) | SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND flight.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'MEMPHIS'))) AND flight.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'INDIANAPOLIS'))) AND fare.fare_basis_code IN (SELECT FARE_BASISalias0.fare_basis_code FROM fare_basis AS FARE_BASISalias0 WHERE FARE_BASISalias0.basis_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 21 AND DATE_DAYalias1.month_number = 2 AND DATE_DAYalias1.year = 1991))) 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: list flights from INDIANAPOLIS to MEMPHIS with fares on monday ### Input: 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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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 state (
state_code text,
state_name text,
country_name text
)
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 equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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 days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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 time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
) ### Response: SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND flight.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'MEMPHIS'))) AND flight.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'INDIANAPOLIS'))) AND fare.fare_basis_code IN (SELECT FARE_BASISalias0.fare_basis_code FROM fare_basis AS FARE_BASISalias0 WHERE FARE_BASISalias0.basis_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 21 AND DATE_DAYalias1.month_number = 2 AND DATE_DAYalias1.year = 1991))) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id |
What date is the 1:00 pm game at arrowhead stadium? | CREATE TABLE table_name_37 (
date VARCHAR,
time___et__ VARCHAR,
game_site VARCHAR
) | SELECT date FROM table_name_37 WHERE time___et__ = "1:00 pm" AND game_site = "arrowhead stadium" | 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 date is the 1:00 pm game at arrowhead stadium? ### Input: CREATE TABLE table_name_37 (
date VARCHAR,
time___et__ VARCHAR,
game_site VARCHAR
) ### Response: SELECT date FROM table_name_37 WHERE time___et__ = "1:00 pm" AND game_site = "arrowhead stadium" |
What is draft detail of the document with id 7? | CREATE TABLE addresses (
address_id number,
address_details text
)
CREATE TABLE circulation_history (
document_id number,
draft_number number,
copy_number number,
employee_id number
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
CREATE TABLE roles (
role_code text,
role_description text
)
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE document_drafts (
document_id number,
draft_number number,
draft_details text
)
CREATE TABLE ref_shipping_agents (
shipping_agent_code text,
shipping_agent_name text,
shipping_agent_description text
)
CREATE TABLE draft_copies (
document_id number,
draft_number number,
copy_number number
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
other_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE documents (
document_id number,
document_status_code text,
document_type_code text,
shipping_agent_code text,
receipt_date time,
receipt_number text,
other_details text
) | SELECT draft_details FROM document_drafts WHERE document_id = 7 | 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 is draft detail of the document with id 7? ### Input: CREATE TABLE addresses (
address_id number,
address_details text
)
CREATE TABLE circulation_history (
document_id number,
draft_number number,
copy_number number,
employee_id number
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
CREATE TABLE roles (
role_code text,
role_description text
)
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE document_drafts (
document_id number,
draft_number number,
draft_details text
)
CREATE TABLE ref_shipping_agents (
shipping_agent_code text,
shipping_agent_name text,
shipping_agent_description text
)
CREATE TABLE draft_copies (
document_id number,
draft_number number,
copy_number number
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
other_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE documents (
document_id number,
document_status_code text,
document_type_code text,
shipping_agent_code text,
receipt_date time,
receipt_number text,
other_details text
) ### Response: SELECT draft_details FROM document_drafts WHERE document_id = 7 |
What is the Jump 2 of the person that has a Jump 3 of 7.77? | CREATE TABLE table_32520 (
"Athlete Name" text,
"Jump 1" text,
"Jump 2" text,
"Jump 3" text,
"Best Jump" text
) | SELECT "Jump 2" FROM table_32520 WHERE "Jump 3" = '7.77' | 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 Jump 2 of the person that has a Jump 3 of 7.77? ### Input: CREATE TABLE table_32520 (
"Athlete Name" text,
"Jump 1" text,
"Jump 2" text,
"Jump 3" text,
"Best Jump" text
) ### Response: SELECT "Jump 2" FROM table_32520 WHERE "Jump 3" = '7.77' |
Give me a pie to show how many directed by from different directed by. | CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
) | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by | 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 pie to show how many directed by from different directed by. ### Input: CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
) ### Response: SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by |
What is Ariel 3's COSPAR ID? | CREATE TABLE table_name_3 (
cospar_id VARCHAR,
satellite VARCHAR
) | SELECT cospar_id FROM table_name_3 WHERE satellite = "ariel 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 Ariel 3's COSPAR ID? ### Input: CREATE TABLE table_name_3 (
cospar_id VARCHAR,
satellite VARCHAR
) ### Response: SELECT cospar_id FROM table_name_3 WHERE satellite = "ariel 3" |
in a year before d5 1/2ns, labetalol or insulin were prescribed for patient 10266? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE 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
) | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, '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: in a year before d5 1/2ns, labetalol or insulin were prescribed for patient 10266? ### Input: CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE 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
) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
Top 100 posts by view count. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name 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 PostTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
) | SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100 | 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: Top 100 posts by view count. ### Input: CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name 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 PostTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
) ### Response: SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100 |
What Chassis has g Tyres before 1987? | CREATE TABLE table_71124 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) | SELECT "Chassis" FROM table_71124 WHERE "Tyres" = 'g' AND "Year" < '1987' | 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 Chassis has g Tyres before 1987? ### Input: CREATE TABLE table_71124 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) ### Response: SELECT "Chassis" FROM table_71124 WHERE "Tyres" = 'g' AND "Year" < '1987' |
Which channel comes out of Israel? | CREATE TABLE table_name_83 (
channel VARCHAR,
country VARCHAR
) | SELECT channel FROM table_name_83 WHERE country = "israel" | 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 channel comes out of Israel? ### Input: CREATE TABLE table_name_83 (
channel VARCHAR,
country VARCHAR
) ### Response: SELECT channel FROM table_name_83 WHERE country = "israel" |
how many patients are diagnosed with nb obsrv suspct infect and tested under hematology category in lab? | 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 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "NB obsrv suspct infect" AND lab."CATEGORY" = "Hematology" | 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 are diagnosed with nb obsrv suspct infect and tested under hematology category in lab? ### Input: 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 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "NB obsrv suspct infect" AND lab."CATEGORY" = "Hematology" |
In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas? | CREATE TABLE table_name_83 (
year VARCHAR,
team VARCHAR,
tournament VARCHAR,
finish VARCHAR
) | SELECT year FROM table_name_83 WHERE tournament = "1st division el salvador" AND finish = "champion" AND team = "fas" | 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: In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas? ### Input: CREATE TABLE table_name_83 (
year VARCHAR,
team VARCHAR,
tournament VARCHAR,
finish VARCHAR
) ### Response: SELECT year FROM table_name_83 WHERE tournament = "1st division el salvador" AND finish = "champion" AND team = "fas" |
What is Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'? | CREATE TABLE table_name_76 (
accolade VARCHAR,
rank VARCHAR,
year VARCHAR,
publication VARCHAR
) | SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = "rolling stone" AND rank = 48 | 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 Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'? ### Input: CREATE TABLE table_name_76 (
accolade VARCHAR,
rank VARCHAR,
year VARCHAR,
publication VARCHAR
) ### Response: SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = "rolling stone" AND rank = 48 |
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | 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 those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. ### Input: CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) ### Response: SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
what are the flights and fares from BOSTON to PHILADELPHIA | CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description 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 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 ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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 days (
days_code varchar,
day_name varchar
)
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 month (
month_number int,
month_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
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_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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 restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
) | SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | 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: what are the flights and fares from BOSTON to PHILADELPHIA ### Input: CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description 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 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 ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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 days (
days_code varchar,
day_name varchar
)
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 month (
month_number int,
month_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
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_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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 restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
) ### Response: SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code |
what is the last treaty morocco ratified ? | CREATE TABLE table_203_109 (
id number,
"treaty" text,
"organization" text,
"introduced" number,
"signed" number,
"ratified" number
) | SELECT "treaty" FROM table_203_109 ORDER BY "ratified" DESC 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: what is the last treaty morocco ratified ? ### Input: CREATE TABLE table_203_109 (
id number,
"treaty" text,
"organization" text,
"introduced" number,
"signed" number,
"ratified" number
) ### Response: SELECT "treaty" FROM table_203_109 ORDER BY "ratified" DESC LIMIT 1 |
had patient 13806 been prescribed vancomycin hcl, phenylephrine or d5w (excel bag) until 2102? | 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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102' | 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: had patient 13806 been prescribed vancomycin hcl, phenylephrine or d5w (excel bag) until 2102? ### Input: 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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102' |
Name the 2012 for 2009 of 1r | CREATE TABLE table_58551 (
"Tournament" text,
"2009" text,
"2011" text,
"2012" text,
"2013" text
) | SELECT "2012" FROM table_58551 WHERE "2009" = '1r' | 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: Name the 2012 for 2009 of 1r ### Input: CREATE TABLE table_58551 (
"Tournament" text,
"2009" text,
"2011" text,
"2012" text,
"2013" text
) ### Response: SELECT "2012" FROM table_58551 WHERE "2009" = '1r' |
What nurses are on call with block floor 1 and block code 1? Tell me their names. | CREATE TABLE on_call (
nurse VARCHAR,
blockfloor VARCHAR,
blockcode VARCHAR
) | SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 | 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 nurses are on call with block floor 1 and block code 1? Tell me their names. ### Input: CREATE TABLE on_call (
nurse VARCHAR,
blockfloor VARCHAR,
blockcode VARCHAR
) ### Response: SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 |
Find posts with broken MathJax (single dollar sign). | 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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
)
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
) | SELECT Id AS "post_link", Body, CreationDate AS "date" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%' | 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: Find posts with broken MathJax (single dollar sign). ### Input: 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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
)
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
) ### Response: SELECT Id AS "post_link", Body, CreationDate AS "date" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%' |
how many patients whose admission type is urgent and primary disease is mesenteric ischemia? | 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_type = "URGENT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | 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 whose admission type is urgent and primary disease is mesenteric ischemia? ### 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_type = "URGENT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" |
What is the Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that 12.2 | CREATE TABLE table_name_15 (
right_ascension___j2000__ VARCHAR,
object_type VARCHAR,
apparent_magnitude VARCHAR
) | SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = "spiral galaxy" AND apparent_magnitude > 12.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 Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that 12.2 ### Input: CREATE TABLE table_name_15 (
right_ascension___j2000__ VARCHAR,
object_type VARCHAR,
apparent_magnitude VARCHAR
) ### Response: SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = "spiral galaxy" AND apparent_magnitude > 12.2 |
Who was the young rider classification when Alessandro Petacchi won? | CREATE TABLE table_30586 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
) | SELECT "Young rider classification" FROM table_30586 WHERE "Winner" = 'Alessandro Petacchi' | 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 young rider classification when Alessandro Petacchi won? ### Input: CREATE TABLE table_30586 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
) ### Response: SELECT "Young rider classification" FROM table_30586 WHERE "Winner" = 'Alessandro Petacchi' |
Total number of posts by months. | CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTags (
PostId number,
TagId 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 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 PostHistoryTypes (
Id number,
Name 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 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
) | SELECT COUNT(*) FROM Posts | 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: Total number of posts by months. ### Input: CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTags (
PostId number,
TagId 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 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 PostHistoryTypes (
Id number,
Name 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 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
) ### Response: SELECT COUNT(*) FROM Posts |
what are the four most frequently ordered lab tests for patients who had previously received ven cath renal dialysis within the same month, in 2104? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 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 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
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 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 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
) | 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 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 = 'ven cath renal dialysis') AND STRFTIME('%y', procedures_icd.charttime) = '2104') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) = '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 4) | 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 four most frequently ordered lab tests for patients who had previously received ven cath renal dialysis within the same month, in 2104? ### Input: CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 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 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
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 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 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
) ### 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 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 = 'ven cath renal dialysis') AND STRFTIME('%y', procedures_icd.charttime) = '2104') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) = '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 4) |
What is Status, when Newspaper/Magazine is Al-Thawra? | CREATE TABLE table_name_24 (
status VARCHAR,
newspaper_magazine VARCHAR
) | SELECT status FROM table_name_24 WHERE newspaper_magazine = "al-thawra" | 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 Status, when Newspaper/Magazine is Al-Thawra? ### Input: CREATE TABLE table_name_24 (
status VARCHAR,
newspaper_magazine VARCHAR
) ### Response: SELECT status FROM table_name_24 WHERE newspaper_magazine = "al-thawra" |
Where Date is september 13, 1998 what is result? | CREATE TABLE table_name_89 (
result VARCHAR,
date VARCHAR
) | SELECT result FROM table_name_89 WHERE date = "september 13, 1998" | 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: Where Date is september 13, 1998 what is result? ### Input: CREATE TABLE table_name_89 (
result VARCHAR,
date VARCHAR
) ### Response: SELECT result FROM table_name_89 WHERE date = "september 13, 1998" |
If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge? | CREATE TABLE table_28657 (
"Name / designation" text,
"Year of introduction" text,
"Country of origin" text,
"Primary cartridge" text,
"primary user" text
) | SELECT "Primary cartridge" FROM table_28657 WHERE "Year of introduction" = '1962' AND "Country of origin" = 'Denmark' | 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: If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge? ### Input: CREATE TABLE table_28657 (
"Name / designation" text,
"Year of introduction" text,
"Country of origin" text,
"Primary cartridge" text,
"primary user" text
) ### Response: SELECT "Primary cartridge" FROM table_28657 WHERE "Year of introduction" = '1962' AND "Country of origin" = 'Denmark' |
Which 3rd run has rank of 8? | CREATE TABLE table_79697 (
"Rank" real,
"Name" text,
"1st run" text,
"2nd run" text,
"3rd run" text,
"Total" real
) | SELECT "3rd run" FROM table_79697 WHERE "Rank" = '8' | 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 3rd run has rank of 8? ### Input: CREATE TABLE table_79697 (
"Rank" real,
"Name" text,
"1st run" text,
"2nd run" text,
"3rd run" text,
"Total" real
) ### Response: SELECT "3rd run" FROM table_79697 WHERE "Rank" = '8' |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | 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 all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time. ### Input: CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) ### Response: SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
What is the type of allergy Cat? | CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) | SELECT allergytype FROM allergy_type WHERE allergy = "Cat" | 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 is the type of allergy Cat? ### Input: CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) ### Response: SELECT allergytype FROM allergy_type WHERE allergy = "Cat" |
Which venue did Luke Blackwell serve as captain? | CREATE TABLE table_18796 (
"Season" real,
"Premiers" text,
"Runners Up" text,
"Score" text,
"Captain" text,
"Coach" text,
"Simpson Medal" text,
"Venue" text,
"Attendance" real,
"Umpires" text
) | SELECT "Venue" FROM table_18796 WHERE "Captain" = 'Luke Blackwell' | 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 venue did Luke Blackwell serve as captain? ### Input: CREATE TABLE table_18796 (
"Season" real,
"Premiers" text,
"Runners Up" text,
"Score" text,
"Captain" text,
"Coach" text,
"Simpson Medal" text,
"Venue" text,
"Attendance" real,
"Umpires" text
) ### Response: SELECT "Venue" FROM table_18796 WHERE "Captain" = 'Luke Blackwell' |
When the driver peter gethin has a grid less than 25, what is the average number of laps? | CREATE TABLE table_55351 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT AVG("Laps") FROM table_55351 WHERE "Driver" = 'peter gethin' AND "Grid" < '25' | 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 the driver peter gethin has a grid less than 25, what is the average number of laps? ### Input: CREATE TABLE table_55351 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) ### Response: SELECT AVG("Laps") FROM table_55351 WHERE "Driver" = 'peter gethin' AND "Grid" < '25' |
How many people attended the game when Larry Hughes(33) was the leading scorer and cleveland was visiting? | CREATE TABLE table_35910 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | SELECT SUM("Attendance") FROM table_35910 WHERE "Visitor" = 'cleveland' AND "Leading scorer" = 'larry hughes(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: How many people attended the game when Larry Hughes(33) was the leading scorer and cleveland was visiting? ### Input: CREATE TABLE table_35910 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) ### Response: SELECT SUM("Attendance") FROM table_35910 WHERE "Visitor" = 'cleveland' AND "Leading scorer" = 'larry hughes(33)' |
What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06) | CREATE TABLE table_489 (
"Celebrity" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Charity" text,
"Result" text,
"Raised" text
) | SELECT "Original Team" FROM table_489 WHERE "Result" = '08 Fired in week 10 (2008-03-06)' | 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 original team of the celebrity who had the result 08 fired in week 10 (2008-03-06) ### Input: CREATE TABLE table_489 (
"Celebrity" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Charity" text,
"Result" text,
"Raised" text
) ### Response: SELECT "Original Team" FROM table_489 WHERE "Result" = '08 Fired in week 10 (2008-03-06)' |
what is the total number of title ? | CREATE TABLE table_204_265 (
id number,
"no." number,
"title (latin)" text,
"title (english translation)" text,
"subject" text,
"date" text
) | SELECT COUNT("subject") FROM table_204_265 | 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: what is the total number of title ? ### Input: CREATE TABLE table_204_265 (
id number,
"no." number,
"title (latin)" text,
"title (english translation)" text,
"subject" text,
"date" text
) ### Response: SELECT COUNT("subject") FROM table_204_265 |
who won the south after esc geretsried did during the 2006-07 season ? | CREATE TABLE table_204_1 (
id number,
"season" text,
"north" text,
"south" text,
"east" text,
"west" text
) | SELECT "south" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE "south" = 'esc geretsried') + 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: who won the south after esc geretsried did during the 2006-07 season ? ### Input: CREATE TABLE table_204_1 (
id number,
"season" text,
"north" text,
"south" text,
"east" text,
"west" text
) ### Response: SELECT "south" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE "south" = 'esc geretsried') + 1 |
Where is the home ground for the club coached by nick pantsaras and founded before 1946? | CREATE TABLE table_44900 (
"Team" text,
"Coach" text,
"Home Ground" text,
"Location" text,
"Founded" real
) | SELECT "Home Ground" FROM table_44900 WHERE "Founded" < '1946' AND "Coach" = 'nick pantsaras' | 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: Where is the home ground for the club coached by nick pantsaras and founded before 1946? ### Input: CREATE TABLE table_44900 (
"Team" text,
"Coach" text,
"Home Ground" text,
"Location" text,
"Founded" real
) ### Response: SELECT "Home Ground" FROM table_44900 WHERE "Founded" < '1946' AND "Coach" = 'nick pantsaras' |
How many years were g Tyres and Minardi m187 used? | CREATE TABLE table_name_82 (
year INTEGER,
tyres VARCHAR,
chassis VARCHAR
) | SELECT AVG(year) FROM table_name_82 WHERE tyres = "g" AND chassis = "minardi m187" | 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 years were g Tyres and Minardi m187 used? ### Input: CREATE TABLE table_name_82 (
year INTEGER,
tyres VARCHAR,
chassis VARCHAR
) ### Response: SELECT AVG(year) FROM table_name_82 WHERE tyres = "g" AND chassis = "minardi m187" |
What was the result of the game against the Miami Dolphins held at the Riverfront Stadium? | CREATE TABLE table_78664 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Location" text
) | SELECT "Result" FROM table_78664 WHERE "Location" = 'riverfront stadium' AND "Opponent" = 'miami dolphins' | 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 result of the game against the Miami Dolphins held at the Riverfront Stadium? ### Input: CREATE TABLE table_78664 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Location" text
) ### Response: SELECT "Result" FROM table_78664 WHERE "Location" = 'riverfront stadium' AND "Opponent" = 'miami dolphins' |
Who directed the totle 'tjockare n vatten'? | CREATE TABLE table_20709 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production Code" real
) | SELECT "Directed by" FROM table_20709 WHERE "Title" = 'Tjockare än vatten' | 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 the totle 'tjockare n vatten'? ### Input: CREATE TABLE table_20709 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production Code" real
) ### Response: SELECT "Directed by" FROM table_20709 WHERE "Title" = 'Tjockare än vatten' |
When did the archbishop that was ordained a bishop on July 25, 1902 die? | CREATE TABLE table_44491 (
"Archbishop" text,
"Born" text,
"Ordained Priest" text,
"Ordained Bishop" text,
"Appointed Archbishop" text,
"Vacated throne" text,
"Died" text
) | SELECT "Died" FROM table_44491 WHERE "Ordained Bishop" = 'july 25, 1902' | 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 did the archbishop that was ordained a bishop on July 25, 1902 die? ### Input: CREATE TABLE table_44491 (
"Archbishop" text,
"Born" text,
"Ordained Priest" text,
"Ordained Bishop" text,
"Appointed Archbishop" text,
"Vacated throne" text,
"Died" text
) ### Response: SELECT "Died" FROM table_44491 WHERE "Ordained Bishop" = 'july 25, 1902' |
How many rain figures are provided for sunlight hours in 1966? | CREATE TABLE table_17829 (
"City/Town" text,
"July av. T" text,
"Rain" text,
"Days with rain (year/summer)" text,
"Days with frost" real,
"Sunlight hours" real
) | SELECT COUNT("Rain") FROM table_17829 WHERE "Sunlight hours" = '1966' | 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 rain figures are provided for sunlight hours in 1966? ### Input: CREATE TABLE table_17829 (
"City/Town" text,
"July av. T" text,
"Rain" text,
"Days with rain (year/summer)" text,
"Days with frost" real,
"Sunlight hours" real
) ### Response: SELECT COUNT("Rain") FROM table_17829 WHERE "Sunlight hours" = '1966' |
Show the different countries and the number of members from each with a bar chart, rank by the bar in ascending. | CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
) | SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country | 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: Show the different countries and the number of members from each with a bar chart, rank by the bar in ascending. ### Input: CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
) ### Response: SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country |
Bar chart of total number of height from each sex | CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
) | SELECT Sex, SUM(Height) FROM people GROUP BY Sex | 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: Bar chart of total number of height from each sex ### Input: CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
) ### Response: SELECT Sex, SUM(Height) FROM people GROUP BY Sex |
what was the first time until 05/2100 patient 002-52932 was prescribed a medication via a misc route? | 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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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 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
) | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND medication.routeadmin = 'misc' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2100-05' ORDER BY medication.drugstarttime 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 first time until 05/2100 patient 002-52932 was prescribed a medication via a misc route? ### Input: 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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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 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
) ### Response: SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND medication.routeadmin = 'misc' AND STRFTIME('%y-%m', medication.drugstarttime) <= '2100-05' ORDER BY medication.drugstarttime LIMIT 1 |
how many times have there been helps by damon stoudamire (13) | CREATE TABLE table_802 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT COUNT("Record") FROM table_802 WHERE "High assists" = 'Damon Stoudamire (13)' | 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 times have there been helps by damon stoudamire (13) ### Input: CREATE TABLE table_802 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT COUNT("Record") FROM table_802 WHERE "High assists" = 'Damon Stoudamire (13)' |
Show all payment method codes and the number of orders for each code. Visualize by pie chart. | CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Product_Description VARCHAR(255),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Addresses (
Address_ID VARCHAR(100),
Line_1 VARCHAR(255),
Line_2 VARCHAR(255),
City_Town VARCHAR(255),
State_County VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Order_Items (
Order_Item_ID INTEGER,
Order_ID INTEGER,
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Marketing_Regions (
Marketing_Region_Code CHAR(15),
Marketing_Region_Name VARCHAR(255),
Marketing_Region_Descriptrion VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255),
Order_Item_ID INTEGER
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR(15),
Service_Type_Description VARCHAR(255)
)
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGER,
Order_Item_ID INTEGER,
Product_ID INTEGER,
Order_Quantity INTEGER,
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Customer_Email_Address VARCHAR(255),
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Other_Details VARCHAR(255)
) | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code | 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: Show all payment method codes and the number of orders for each code. Visualize by pie chart. ### Input: CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Product_Description VARCHAR(255),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Addresses (
Address_ID VARCHAR(100),
Line_1 VARCHAR(255),
Line_2 VARCHAR(255),
City_Town VARCHAR(255),
State_County VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Order_Items (
Order_Item_ID INTEGER,
Order_ID INTEGER,
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Marketing_Regions (
Marketing_Region_Code CHAR(15),
Marketing_Region_Name VARCHAR(255),
Marketing_Region_Descriptrion VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255),
Order_Item_ID INTEGER
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_Type_Code CHAR(15),
Service_Type_Description VARCHAR(255)
)
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGER,
Order_Item_ID INTEGER,
Product_ID INTEGER,
Order_Quantity INTEGER,
Other_Item_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Customer_Email_Address VARCHAR(255),
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Other_Details VARCHAR(255)
) ### Response: SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and sort y axis in ascending order. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
) | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) | 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 all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and sort y axis in ascending order. ### Input: CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
) ### Response: SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) |
When was the film directed by Pen-Ek Ratanaruang released? | CREATE TABLE table_name_13 (
date VARCHAR,
director VARCHAR
) | SELECT date FROM table_name_13 WHERE director = "pen-ek ratanaruang" | 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: When was the film directed by Pen-Ek Ratanaruang released? ### Input: CREATE TABLE table_name_13 (
date VARCHAR,
director VARCHAR
) ### Response: SELECT date FROM table_name_13 WHERE director = "pen-ek ratanaruang" |
Which rider had a speed of 104.630mph? | CREATE TABLE table_52741 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | SELECT "Rider" FROM table_52741 WHERE "Speed" = '104.630mph' | 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 rider had a speed of 104.630mph? ### Input: CREATE TABLE table_52741 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) ### Response: SELECT "Rider" FROM table_52741 WHERE "Speed" = '104.630mph' |
what is the total number of apps and goals for luther blissett ? | CREATE TABLE table_204_340 (
id number,
"name" text,
"year inducted" number,
"position" text,
"apps" number,
"goals" number
) | SELECT "apps" + "goals" FROM table_204_340 WHERE "name" = 'luther blissett' | 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: what is the total number of apps and goals for luther blissett ? ### Input: CREATE TABLE table_204_340 (
id number,
"name" text,
"year inducted" number,
"position" text,
"apps" number,
"goals" number
) ### Response: SELECT "apps" + "goals" FROM table_204_340 WHERE "name" = 'luther blissett' |
Parts Plus sponsors what driver? | CREATE TABLE table_name_21 (
driver_s_ VARCHAR,
primary_sponsor_s_ VARCHAR
) | SELECT driver_s_ FROM table_name_21 WHERE primary_sponsor_s_ = "parts plus" | 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: Parts Plus sponsors what driver? ### Input: CREATE TABLE table_name_21 (
driver_s_ VARCHAR,
primary_sponsor_s_ VARCHAR
) ### Response: SELECT driver_s_ FROM table_name_21 WHERE primary_sponsor_s_ = "parts plus" |
What is the place when the performance is 60.73m? | CREATE TABLE table_name_65 (
place VARCHAR,
performance VARCHAR
) | SELECT place FROM table_name_65 WHERE performance = "60.73m" | 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 place when the performance is 60.73m? ### Input: CREATE TABLE table_name_65 (
place VARCHAR,
performance VARCHAR
) ### Response: SELECT place FROM table_name_65 WHERE performance = "60.73m" |
What year was Sam Kazman a producer? | CREATE TABLE table_name_35 (
year VARCHAR,
producer VARCHAR
) | SELECT year FROM table_name_35 WHERE producer = "sam kazman" | 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 year was Sam Kazman a producer? ### Input: CREATE TABLE table_name_35 (
year VARCHAR,
producer VARCHAR
) ### Response: SELECT year FROM table_name_35 WHERE producer = "sam kazman" |
which team had the largest goal difference ? | CREATE TABLE table_203_254 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) | SELECT "team" FROM table_203_254 ORDER BY ABS("difference") DESC 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 had the largest goal difference ? ### Input: CREATE TABLE table_203_254 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) ### Response: SELECT "team" FROM table_203_254 ORDER BY ABS("difference") DESC LIMIT 1 |
how many days have elapsed since the first time patient 30826 stayed in the ward 12 during this hospital encounter? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE 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 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
) | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL)) AND transfers.wardid = 12 ORDER BY transfers.intime 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: how many days have elapsed since the first time patient 30826 stayed in the ward 12 during this hospital encounter? ### Input: CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE 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 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
) ### Response: SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL)) AND transfers.wardid = 12 ORDER BY transfers.intime LIMIT 1 |
What loan expires date has a Date of 29 december 2003? | CREATE TABLE table_13239 (
"Position" text,
"Player" text,
"Loaned to" text,
"Date" text,
"Loan expires" text
) | SELECT "Loan expires" FROM table_13239 WHERE "Date" = '29 december 2003' | 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 loan expires date has a Date of 29 december 2003? ### Input: CREATE TABLE table_13239 (
"Position" text,
"Player" text,
"Loaned to" text,
"Date" text,
"Loan expires" text
) ### Response: SELECT "Loan expires" FROM table_13239 WHERE "Date" = '29 december 2003' |
Who was the partner that played against Serena Williams Venus Williams? | CREATE TABLE table_9885 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | SELECT "Partner" FROM table_9885 WHERE "Opponents in the final" = 'serena williams venus williams' | 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 partner that played against Serena Williams Venus Williams? ### Input: CREATE TABLE table_9885 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) ### Response: SELECT "Partner" FROM table_9885 WHERE "Opponents in the final" = 'serena williams venus williams' |
What is the name of party with most number of members? | CREATE TABLE party (
party_name VARCHAR,
party_id VARCHAR
)
CREATE TABLE Member (
party_id VARCHAR
) | SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1 | 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 party with most number of members? ### Input: CREATE TABLE party (
party_name VARCHAR,
party_id VARCHAR
)
CREATE TABLE Member (
party_id VARCHAR
) ### Response: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1 |
What is the call sign for channel 6? | CREATE TABLE table_28631 (
"Channel" real,
"Channel name" text,
"Callsign" text,
"Signal power" text,
"Broadcast area" text
) | SELECT "Callsign" FROM table_28631 WHERE "Channel" = '6' | 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 call sign for channel 6? ### Input: CREATE TABLE table_28631 (
"Channel" real,
"Channel name" text,
"Callsign" text,
"Signal power" text,
"Broadcast area" text
) ### Response: SELECT "Callsign" FROM table_28631 WHERE "Channel" = '6' |
What date has a set 4 of 25-19? | CREATE TABLE table_42037 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
) | SELECT "Date" FROM table_42037 WHERE "Set 4" = '25-19' | 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 has a set 4 of 25-19? ### Input: CREATE TABLE table_42037 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
) ### Response: SELECT "Date" FROM table_42037 WHERE "Set 4" = '25-19' |
how many patients were admitted before the year 2135 under procedure icd9 code 3893? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose 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 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2135" AND procedures.icd9_code = "3893" | 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 were admitted before the year 2135 under procedure icd9 code 3893? ### 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 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
)
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2135" AND procedures.icd9_code = "3893" |
What was the total effic for the quarterbacks? | CREATE TABLE table_9027 (
"Name" text,
"GP-GS" text,
"Effic" real,
"Att-Cmp-Int" text,
"Avg/G" real
) | SELECT MIN("Effic") FROM table_9027 WHERE "Name" = 'total' | 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 total effic for the quarterbacks? ### Input: CREATE TABLE table_9027 (
"Name" text,
"GP-GS" text,
"Effic" real,
"Att-Cmp-Int" text,
"Avg/G" real
) ### Response: SELECT MIN("Effic") FROM table_9027 WHERE "Name" = 'total' |
When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties? | CREATE TABLE table_name_78 (
civil_liberties INTEGER,
year VARCHAR,
political_rights VARCHAR,
president VARCHAR
) | SELECT SUM(civil_liberties) FROM table_name_78 WHERE political_rights = 6 AND president = "yoweri museveni" AND year = 1993 | 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: When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties? ### Input: CREATE TABLE table_name_78 (
civil_liberties INTEGER,
year VARCHAR,
political_rights VARCHAR,
president VARCHAR
) ### Response: SELECT SUM(civil_liberties) FROM table_name_78 WHERE political_rights = 6 AND president = "yoweri museveni" AND year = 1993 |