instruction
stringlengths 0
1.06k
| input
stringlengths 33
7.14k
| response
stringlengths 2
4.44k
| source
stringclasses 25
values | text
stringlengths 302
8.5k
|
---|---|---|---|---|
Community Owned posts by User.
|
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
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 PostHistoryTypes (
Id number,
Name 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE FlagTypes (
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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
|
SELECT Posts.Id AS "post_link", Posts.Title, Posts.AnswerCount, Posts.CommunityOwnedDate FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate > 0 ORDER BY Posts.CommunityOwnedDate DESC
|
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: Community Owned posts by User. ### Input: CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
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 PostHistoryTypes (
Id number,
Name 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE FlagTypes (
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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
) ### Response: SELECT Posts.Id AS "post_link", Posts.Title, Posts.AnswerCount, Posts.CommunityOwnedDate FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate > 0 ORDER BY Posts.CommunityOwnedDate DESC
|
Bar chart x axis customer last name y axis how many customer last name, could you list from high to low by the X-axis?
|
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_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)
)
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)
)
|
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name 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 chart x axis customer last name y axis how many customer last name, could you list from high to low by the X-axis? ### Input: CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_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)
)
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)
) ### Response: SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC
|
How many starters are there at right tackle?
|
CREATE TABLE table_3284 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
|
SELECT COUNT("Starter") FROM table_3284 WHERE "Position" = 'Right tackle'
|
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 starters are there at right tackle? ### Input: CREATE TABLE table_3284 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) ### Response: SELECT COUNT("Starter") FROM table_3284 WHERE "Position" = 'Right tackle'
|
Name the most female life expectancy for djibouti
|
CREATE TABLE table_29258 (
"Overall rank" real,
"Country" text,
"Overall life expectancy" real,
"Male life expectancy" real,
"Male rank" real,
"Female life expectancy" real,
"Female rank" real
)
|
SELECT MAX("Female life expectancy") FROM table_29258 WHERE "Country" = 'Djibouti'
|
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 most female life expectancy for djibouti ### Input: CREATE TABLE table_29258 (
"Overall rank" real,
"Country" text,
"Overall life expectancy" real,
"Male life expectancy" real,
"Male rank" real,
"Female life expectancy" real,
"Female rank" real
) ### Response: SELECT MAX("Female life expectancy") FROM table_29258 WHERE "Country" = 'Djibouti'
|
Find the person who has exactly one friend.
|
CREATE TABLE PersonFriend (
name VARCHAR
)
|
SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 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: Find the person who has exactly one friend. ### Input: CREATE TABLE PersonFriend (
name VARCHAR
) ### Response: SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1
|
What is the ICAO for the airport in Ningbo?
|
CREATE TABLE table_name_54 (
icao VARCHAR,
city VARCHAR
)
|
SELECT icao FROM table_name_54 WHERE city = "ningbo"
|
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 ICAO for the airport in Ningbo? ### Input: CREATE TABLE table_name_54 (
icao VARCHAR,
city VARCHAR
) ### Response: SELECT icao FROM table_name_54 WHERE city = "ningbo"
|
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the sum of revenue , and group by attribute founder, and I want to sort in ascending by the names.
|
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
|
SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
|
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 records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the sum of revenue , and group by attribute founder, and I want to sort in ascending by the names. ### Input: CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) ### Response: SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
|
Name the position for european competitions of eurocup regular season
|
CREATE TABLE table_14899 (
"Season" text,
"Tier" text,
"League" text,
"Pos." text,
"Postseason" text,
"Cup competitions" text,
"European competitions" text
)
|
SELECT "Pos." FROM table_14899 WHERE "European competitions" = 'eurocup regular season'
|
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 position for european competitions of eurocup regular season ### Input: CREATE TABLE table_14899 (
"Season" text,
"Tier" text,
"League" text,
"Pos." text,
"Postseason" text,
"Cup competitions" text,
"European competitions" text
) ### Response: SELECT "Pos." FROM table_14899 WHERE "European competitions" = 'eurocup regular season'
|
What is the pba team for the player who went to santo tomas college?
|
CREATE TABLE table_name_50 (
pba_team VARCHAR,
college VARCHAR
)
|
SELECT pba_team FROM table_name_50 WHERE college = "santo tomas"
|
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 pba team for the player who went to santo tomas college? ### Input: CREATE TABLE table_name_50 (
pba_team VARCHAR,
college VARCHAR
) ### Response: SELECT pba_team FROM table_name_50 WHERE college = "santo tomas"
|
What tournament had a 1 point margin of victory?
|
CREATE TABLE table_9532 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
|
SELECT "Tournament" FROM table_9532 WHERE "Margin of victory" = '1 point'
|
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 tournament had a 1 point margin of victory? ### Input: CREATE TABLE table_9532 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) ### Response: SELECT "Tournament" FROM table_9532 WHERE "Margin of victory" = '1 point'
|
how many touchdowns did anthony hines and boo williams have altogether ?
|
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
)
|
SELECT SUM("td's") FROM table_203_8 WHERE "player" IN ('anthony hines', 'boo williams')
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many touchdowns did anthony hines and boo williams have altogether ? ### Input: CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
) ### Response: SELECT SUM("td's") FROM table_203_8 WHERE "player" IN ('anthony hines', 'boo williams')
|
Which year has a Round of 17?
|
CREATE TABLE table_name_2 (
year VARCHAR,
round VARCHAR
)
|
SELECT year FROM table_name_2 WHERE round = "17"
|
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 year has a Round of 17? ### Input: CREATE TABLE table_name_2 (
year VARCHAR,
round VARCHAR
) ### Response: SELECT year FROM table_name_2 WHERE round = "17"
|
What percentage of voters chose McCain in the county where 2.1% of voters voted third party?
|
CREATE TABLE table_20278716_2 (
mccain__percentage VARCHAR,
others__percentage VARCHAR
)
|
SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "2.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 percentage of voters chose McCain in the county where 2.1% of voters voted third party? ### Input: CREATE TABLE table_20278716_2 (
mccain__percentage VARCHAR,
others__percentage VARCHAR
) ### Response: SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "2.1%"
|
when did patient 005-87465 receive ondansetron prescription first during this month?
|
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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
)
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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
|
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 = '005-87465')) AND medication.drugname = 'ondansetron' AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') 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: when did patient 005-87465 receive ondansetron prescription first during this month? ### Input: CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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
)
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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
) ### 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 = '005-87465')) AND medication.drugname = 'ondansetron' AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY medication.drugstarttime LIMIT 1
|
Who is the opponent of player phil graham?
|
CREATE TABLE table_name_72 (
opponent VARCHAR,
player VARCHAR
)
|
SELECT opponent FROM table_name_72 WHERE player = "phil graham"
|
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 is the opponent of player phil graham? ### Input: CREATE TABLE table_name_72 (
opponent VARCHAR,
player VARCHAR
) ### Response: SELECT opponent FROM table_name_72 WHERE player = "phil graham"
|
Name the try bonus for lost being 11 and losing bonus is 6
|
CREATE TABLE table_17941032_3 (
try_bonus VARCHAR,
lost VARCHAR,
losing_bonus VARCHAR
)
|
SELECT try_bonus FROM table_17941032_3 WHERE lost = "11" AND losing_bonus = "6"
|
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 try bonus for lost being 11 and losing bonus is 6 ### Input: CREATE TABLE table_17941032_3 (
try_bonus VARCHAR,
lost VARCHAR,
losing_bonus VARCHAR
) ### Response: SELECT try_bonus FROM table_17941032_3 WHERE lost = "11" AND losing_bonus = "6"
|
What is the race 12 hours in length?
|
CREATE TABLE table_name_20 (
race VARCHAR,
length VARCHAR
)
|
SELECT race FROM table_name_20 WHERE length = "12 hours"
|
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 race 12 hours in length? ### Input: CREATE TABLE table_name_20 (
race VARCHAR,
length VARCHAR
) ### Response: SELECT race FROM table_name_20 WHERE length = "12 hours"
|
Draw a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road.
|
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
|
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
|
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 about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road. ### Input: CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
) ### Response: SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
|
Which money has a Country of united states, and a Place of t6?
|
CREATE TABLE table_50258 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
|
SELECT AVG("Money ( $ )") FROM table_50258 WHERE "Country" = 'united states' AND "Place" = 't6'
|
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 money has a Country of united states, and a Place of t6? ### Input: CREATE TABLE table_50258 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) ### Response: SELECT AVG("Money ( $ )") FROM table_50258 WHERE "Country" = 'united states' AND "Place" = 't6'
|
What was the maximum attendance when Chicago is the visiting team?
|
CREATE TABLE table_9841 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
|
SELECT MAX("Attendance") FROM table_9841 WHERE "Visitor" = 'chicago'
|
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 maximum attendance when Chicago is the visiting team? ### Input: CREATE TABLE table_9841 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) ### Response: SELECT MAX("Attendance") FROM table_9841 WHERE "Visitor" = 'chicago'
|
What is the school code of the accounting department?
|
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
|
SELECT school_code FROM department WHERE dept_name = "Accounting"
|
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 school code of the accounting department? ### Input: CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
) ### Response: SELECT school_code FROM department WHERE dept_name = "Accounting"
|
What is the average tries for less than 117 points and less than 48 tries against?
|
CREATE TABLE table_13973 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
)
|
SELECT AVG("Tries for") FROM table_13973 WHERE "Points for" < '117' AND "Tries against" < '48'
|
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 average tries for less than 117 points and less than 48 tries against? ### Input: CREATE TABLE table_13973 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
) ### Response: SELECT AVG("Tries for") FROM table_13973 WHERE "Points for" < '117' AND "Tries against" < '48'
|
how many patients whose insurance is government and procedure long title is colonoscopy?
|
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Colonoscopy"
|
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 insurance is government and procedure long title is colonoscopy? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Colonoscopy"
|
What was the result of 10/18/1947?
|
CREATE TABLE table_48490 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
)
|
SELECT "Result" FROM table_48490 WHERE "Date" = '10/18/1947'
|
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 10/18/1947? ### Input: CREATE TABLE table_48490 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
) ### Response: SELECT "Result" FROM table_48490 WHERE "Date" = '10/18/1947'
|
what is the code of each location and the number of documents in that location?, display in desc by the X.
|
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
|
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code 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: what is the code of each location and the number of documents in that location?, display in desc by the X. ### Input: CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
) ### Response: SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC
|
what is death status and procedure short title of subject id 26285?
|
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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
)
|
SELECT demographic.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "26285"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is death status and procedure short title of subject id 26285? ### Input: CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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
) ### Response: SELECT demographic.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "26285"
|
What is the end when moving from is listed as cary clarets?
|
CREATE TABLE table_17634290_7 (
ends VARCHAR,
moving_from VARCHAR
)
|
SELECT ends FROM table_17634290_7 WHERE moving_from = "Cary Clarets"
|
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 end when moving from is listed as cary clarets? ### Input: CREATE TABLE table_17634290_7 (
ends VARCHAR,
moving_from VARCHAR
) ### Response: SELECT ends FROM table_17634290_7 WHERE moving_from = "Cary Clarets"
|
the richmond kickers future made the national semifinals only once . what year was it ?
|
CREATE TABLE table_204_676 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
|
SELECT "year" FROM table_204_676 WHERE "playoffs" = 'national semifinals'
|
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: the richmond kickers future made the national semifinals only once . what year was it ? ### Input: CREATE TABLE table_204_676 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) ### Response: SELECT "year" FROM table_204_676 WHERE "playoffs" = 'national semifinals'
|
Give me a bar chart to show the proportion of each type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21', order by the X-axis in descending.
|
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TABLE Services (
service_id INTEGER,
organization_id INTEGER,
service_type_code CHAR(15),
service_details VARCHAR(255)
)
|
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_Code 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: Give me a bar chart to show the proportion of each type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21', order by the X-axis in descending. ### Input: CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TABLE Services (
service_id INTEGER,
organization_id INTEGER,
service_type_code CHAR(15),
service_details VARCHAR(255)
) ### Response: SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_Code DESC
|
When the venue was punt road oval, what was the Home teams score?
|
CREATE TABLE table_name_74 (
home_team VARCHAR,
venue VARCHAR
)
|
SELECT home_team AS score FROM table_name_74 WHERE venue = "punt road oval"
|
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 venue was punt road oval, what was the Home teams score? ### Input: CREATE TABLE table_name_74 (
home_team VARCHAR,
venue VARCHAR
) ### Response: SELECT home_team AS score FROM table_name_74 WHERE venue = "punt road oval"
|
How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
|
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
|
SELECT COUNT(*) FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T2.maxoccupancy = T1.adults + T1.kids
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times the number of adults and kids staying in a room reached the maximum capacity of the room? ### Input: CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
) ### Response: SELECT COUNT(*) FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T2.maxoccupancy = T1.adults + T1.kids
|
Users from Poland by Reputation.
|
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name 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 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 ReviewTaskStates (
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
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
)
|
SELECT Reputation, DisplayName, Location FROM Users WHERE LOWER(Location) LIKE '%poland%' ORDER BY Reputation DESC
|
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: Users from Poland by Reputation. ### Input: CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name 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 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 ReviewTaskStates (
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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 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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
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
) ### Response: SELECT Reputation, DisplayName, Location FROM Users WHERE LOWER(Location) LIKE '%poland%' ORDER BY Reputation DESC
|
display all the flights from BALTIMORE to DALLAS which leave after 1600
|
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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 code_description (
code varchar,
description 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 flight_fare (
flight_id int,
fare_id int
)
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 equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_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 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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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
)
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.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: display all the flights from BALTIMORE to DALLAS which leave after 1600 ### Input: CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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 code_description (
code varchar,
description 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 flight_fare (
flight_id int,
fare_id int
)
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 equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_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 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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
|
Which competition has a Goal of deacon 8/8 and a Score of 32-14?
|
CREATE TABLE table_58218 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
)
|
SELECT "Competition" FROM table_58218 WHERE "Goals" = 'deacon 8/8' AND "Score" = '32-14'
|
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 competition has a Goal of deacon 8/8 and a Score of 32-14? ### Input: CREATE TABLE table_58218 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
) ### Response: SELECT "Competition" FROM table_58218 WHERE "Goals" = 'deacon 8/8' AND "Score" = '32-14'
|
What is the average Total for the United States with a To par more than 6 and 1996 was won?
|
CREATE TABLE table_14482 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
|
SELECT AVG("Total") FROM table_14482 WHERE "Country" = 'united states' AND "To par" > '6' AND "Year(s) won" = '1996'
|
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 average Total for the United States with a To par more than 6 and 1996 was won? ### Input: CREATE TABLE table_14482 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) ### Response: SELECT AVG("Total") FROM table_14482 WHERE "Country" = 'united states' AND "To par" > '6' AND "Year(s) won" = '1996'
|
What is the highest Total, when Season is '1996-97', and when Second is less than 33?
|
CREATE TABLE table_61391 (
"Season" text,
"Premier" real,
"First" real,
"Second" real,
"Total" real
)
|
SELECT MAX("Total") FROM table_61391 WHERE "Season" = '1996-97' AND "Second" < '33'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Total, when Season is '1996-97', and when Second is less than 33? ### Input: CREATE TABLE table_61391 (
"Season" text,
"Premier" real,
"First" real,
"Second" real,
"Total" real
) ### Response: SELECT MAX("Total") FROM table_61391 WHERE "Season" = '1996-97' AND "Second" < '33'
|
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check
|
CREATE TABLE payments (
payment_id number,
booking_id number,
customer_id number,
payment_type_code text,
amount_paid_in_full_yn text,
payment_date time,
amount_due number,
amount_paid number
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
booking_status_code text,
returned_damaged_yn text,
booking_start_date time,
booking_end_date time,
count_hired text,
amount_payable number,
amount_of_discount number,
amount_outstanding number,
amount_of_refund number
)
CREATE TABLE discount_coupons (
coupon_id number,
date_issued time,
coupon_amount number
)
CREATE TABLE products_booked (
booking_id number,
product_id number,
returned_yn text,
returned_late_yn text,
booked_count number,
booked_amount number
)
CREATE TABLE products_for_hire (
product_id number,
product_type_code text,
daily_hire_cost number,
product_name text,
product_description text
)
CREATE TABLE customers (
customer_id number,
coupon_id number,
good_or_bad_customer text,
first_name text,
last_name text,
gender_mf text,
date_became_customer time,
date_last_hire time
)
CREATE TABLE view_product_availability (
product_id number,
booking_id number,
status_date time,
available_yn text
)
|
SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check ### Input: CREATE TABLE payments (
payment_id number,
booking_id number,
customer_id number,
payment_type_code text,
amount_paid_in_full_yn text,
payment_date time,
amount_due number,
amount_paid number
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
booking_status_code text,
returned_damaged_yn text,
booking_start_date time,
booking_end_date time,
count_hired text,
amount_payable number,
amount_of_discount number,
amount_outstanding number,
amount_of_refund number
)
CREATE TABLE discount_coupons (
coupon_id number,
date_issued time,
coupon_amount number
)
CREATE TABLE products_booked (
booking_id number,
product_id number,
returned_yn text,
returned_late_yn text,
booked_count number,
booked_amount number
)
CREATE TABLE products_for_hire (
product_id number,
product_type_code text,
daily_hire_cost number,
product_name text,
product_description text
)
CREATE TABLE customers (
customer_id number,
coupon_id number,
good_or_bad_customer text,
first_name text,
last_name text,
gender_mf text,
date_became_customer time,
date_last_hire time
)
CREATE TABLE view_product_availability (
product_id number,
booking_id number,
status_date time,
available_yn text
) ### Response: SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
|
who finished next after kaitlin sandeno ?
|
CREATE TABLE table_204_902 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
|
SELECT "name" FROM table_204_902 WHERE "rank" = (SELECT "rank" FROM table_204_902 WHERE "name" = 'kaitlin sandeno') + 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 finished next after kaitlin sandeno ? ### Input: CREATE TABLE table_204_902 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) ### Response: SELECT "name" FROM table_204_902 WHERE "rank" = (SELECT "rank" FROM table_204_902 WHERE "name" = 'kaitlin sandeno') + 1
|
what is the four, the most frequent input event in 2102?
|
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE 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 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 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
|
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2102' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.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 is the four, the most frequent input event in 2102? ### Input: CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE 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 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 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
) ### Response: SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2102' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4)
|
What is the nationality of the player from Drexel who had a pick larger than 183?
|
CREATE TABLE table_75085 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School/Club Team" text
)
|
SELECT "Nationality" FROM table_75085 WHERE "Pick" > '183' AND "School/Club Team" = 'drexel'
|
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 nationality of the player from Drexel who had a pick larger than 183? ### Input: CREATE TABLE table_75085 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School/Club Team" text
) ### Response: SELECT "Nationality" FROM table_75085 WHERE "Pick" > '183' AND "School/Club Team" = 'drexel'
|
give me the difference between patient 006-122567's total input and the total output on 07/11/2101?
|
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
|
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567')) AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) = '2101-07-11') - (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567')) AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) = '2101-07-11')
|
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: give me the difference between patient 006-122567's total input and the total output on 07/11/2101? ### Input: CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) ### Response: SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567')) AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) = '2101-07-11') - (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567')) AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) = '2101-07-11')
|
How many assists did Delisha Milton-Jones make?
|
CREATE TABLE table_19722664_5 (
assists VARCHAR,
player VARCHAR
)
|
SELECT assists FROM table_19722664_5 WHERE player = "DeLisha Milton-Jones"
|
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 assists did Delisha Milton-Jones make? ### Input: CREATE TABLE table_19722664_5 (
assists VARCHAR,
player VARCHAR
) ### Response: SELECT assists FROM table_19722664_5 WHERE player = "DeLisha Milton-Jones"
|
What is the fewest number of wickets recorded?
|
CREATE TABLE table_27922491_20 (
wickets INTEGER
)
|
SELECT MIN(wickets) FROM table_27922491_20
|
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 fewest number of wickets recorded? ### Input: CREATE TABLE table_27922491_20 (
wickets INTEGER
) ### Response: SELECT MIN(wickets) FROM table_27922491_20
|
Who was the sponsor on April 22, 2004?
|
CREATE TABLE table_56608 (
"Congress" text,
"Bill number" text,
"Date introduced" text,
"Sponsor" text,
"# of cosponsors" real
)
|
SELECT "Sponsor" FROM table_56608 WHERE "Date introduced" = 'april 22, 2004'
|
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 sponsor on April 22, 2004? ### Input: CREATE TABLE table_56608 (
"Congress" text,
"Bill number" text,
"Date introduced" text,
"Sponsor" text,
"# of cosponsors" real
) ### Response: SELECT "Sponsor" FROM table_56608 WHERE "Date introduced" = 'april 22, 2004'
|
What is the sum of capacity of cinemas open for each year? Return a line chart, could you display from low to high by the x axis please?
|
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
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
)
|
SELECT Openning_year, SUM(Capacity) FROM cinema ORDER BY Openning_year
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of capacity of cinemas open for each year? Return a line chart, could you display from low to high by the x axis please? ### Input: CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
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
) ### Response: SELECT Openning_year, SUM(Capacity) FROM cinema ORDER BY Openning_year
|
What's the D 42 when D 46 is majority ?
|
CREATE TABLE table_54080 (
"D 39 \u221a" text,
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text
)
|
SELECT "D 42 \u221a" FROM table_54080 WHERE "D 46 \u221a" = 'majority→'
|
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 D 42 when D 46 is majority ? ### Input: CREATE TABLE table_54080 (
"D 39 \u221a" text,
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text
) ### Response: SELECT "D 42 \u221a" FROM table_54080 WHERE "D 46 \u221a" = 'majority→'
|
What is the Artist of the Song with a Place of withdrawn?
|
CREATE TABLE table_63022 (
"Artist" text,
"Song" text,
"Lyrics (l) / Music (m)" text,
"Votes" text,
"Place" text
)
|
SELECT "Artist" FROM table_63022 WHERE "Place" = 'withdrawn'
|
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 Artist of the Song with a Place of withdrawn? ### Input: CREATE TABLE table_63022 (
"Artist" text,
"Song" text,
"Lyrics (l) / Music (m)" text,
"Votes" text,
"Place" text
) ### Response: SELECT "Artist" FROM table_63022 WHERE "Place" = 'withdrawn'
|
What 8 -credit course are there ?
|
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
|
SELECT DISTINCT name, number FROM course WHERE credits = 8 AND department = 'EECS'
|
advising
|
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 8 -credit course are there ? ### Input: CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
) ### Response: SELECT DISTINCT name, number FROM course WHERE credits = 8 AND department = 'EECS'
|
Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48?
|
CREATE TABLE table_name_63 (
body_width_mm INTEGER,
lead_pitch_mm VARCHAR,
part_number VARCHAR
)
|
SELECT MIN(body_width_mm) FROM table_name_63 WHERE lead_pitch_mm < 0.55 AND part_number = "tsop48"
|
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 Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48? ### Input: CREATE TABLE table_name_63 (
body_width_mm INTEGER,
lead_pitch_mm VARCHAR,
part_number VARCHAR
) ### Response: SELECT MIN(body_width_mm) FROM table_name_63 WHERE lead_pitch_mm < 0.55 AND part_number = "tsop48"
|
papers by mayank goel
|
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
|
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mayank goel' AND writes.authorid = author.authorid
|
scholar
|
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: papers by mayank goel ### Input: CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
) ### Response: SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mayank goel' AND writes.authorid = author.authorid
|
What is To Par, when Country is 'Australia'?
|
CREATE TABLE table_62113 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
|
SELECT "To par" FROM table_62113 WHERE "Country" = 'australia'
|
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 To Par, when Country is 'Australia'? ### Input: CREATE TABLE table_62113 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) ### Response: SELECT "To par" FROM table_62113 WHERE "Country" = 'australia'
|
How many different departments are there?
|
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
|
SELECT COUNT(DISTINCT dept_name) FROM department
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different departments are there? ### Input: CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
) ### Response: SELECT COUNT(DISTINCT dept_name) FROM department
|
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
|
CREATE TABLE Customers (
first_name VARCHAR,
last_name VARCHAR,
amount_outstanding INTEGER
)
|
SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000
|
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: List the first name and last name of customers have the amount of outstanding between 1000 and 3000. ### Input: CREATE TABLE Customers (
first_name VARCHAR,
last_name VARCHAR,
amount_outstanding INTEGER
) ### Response: SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000
|
List the names of all distinct wines that have scores higher than 90.
|
CREATE TABLE WINE (
Name VARCHAR,
score INTEGER
)
|
SELECT Name FROM WINE WHERE score > 90
|
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: List the names of all distinct wines that have scores higher than 90. ### Input: CREATE TABLE WINE (
Name VARCHAR,
score INTEGER
) ### Response: SELECT Name FROM WINE WHERE score > 90
|
give me a flight from CHARLOTTE to BALTIMORE on tuesday morning
|
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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
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 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 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_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 ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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 month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE 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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
|
SELECT DISTINCT flight_id FROM flight WHERE (((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 = 22 AND DATE_DAYalias0.month_number = 3 AND DATE_DAYalias0.year = 1991)) AND 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 = 'BALTIMORE'))) AND 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 = 'CHARLOTTE'))) AND departure_time BETWEEN 0 AND 1200)
|
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: give me a flight from CHARLOTTE to BALTIMORE on tuesday morning ### Input: 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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
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 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 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_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 ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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 month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE 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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
) ### Response: SELECT DISTINCT flight_id FROM flight WHERE (((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 = 22 AND DATE_DAYalias0.month_number = 3 AND DATE_DAYalias0.year = 1991)) AND 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 = 'BALTIMORE'))) AND 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 = 'CHARLOTTE'))) AND departure_time BETWEEN 0 AND 1200)
|
What is every value for Under-11 when value of under-17 is Salma Nassar?
|
CREATE TABLE table_26368963_2 (
under_11 VARCHAR,
under_17 VARCHAR
)
|
SELECT under_11 FROM table_26368963_2 WHERE under_17 = "Salma Nassar"
|
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 every value for Under-11 when value of under-17 is Salma Nassar? ### Input: CREATE TABLE table_26368963_2 (
under_11 VARCHAR,
under_17 VARCHAR
) ### Response: SELECT under_11 FROM table_26368963_2 WHERE under_17 = "Salma Nassar"
|
what is the average water % for mulberry ?
|
CREATE TABLE table_203_729 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
|
SELECT "water %" FROM table_203_729 WHERE "township" = 'mulberry'
|
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 average water % for mulberry ? ### Input: CREATE TABLE table_203_729 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
) ### Response: SELECT "water %" FROM table_203_729 WHERE "township" = 'mulberry'
|
when did first patient 2238 have the minimum value of fibrinogen, functional in 04/last year?
|
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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
|
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'fibrinogen, functional') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '04' ORDER BY labevents.valuenum, labevents.charttime 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: when did first patient 2238 have the minimum value of fibrinogen, functional in 04/last year? ### 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'fibrinogen, functional') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '04' ORDER BY labevents.valuenum, labevents.charttime LIMIT 1
|
What is FA Cup Goals, when Euro Competitions is 1, and when League Goals is 11?
|
CREATE TABLE table_name_75 (
fa_cup_goals VARCHAR,
euro_competitions VARCHAR,
league_goals VARCHAR
)
|
SELECT fa_cup_goals FROM table_name_75 WHERE euro_competitions = "1" AND league_goals = "11"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is FA Cup Goals, when Euro Competitions is 1, and when League Goals is 11? ### Input: CREATE TABLE table_name_75 (
fa_cup_goals VARCHAR,
euro_competitions VARCHAR,
league_goals VARCHAR
) ### Response: SELECT fa_cup_goals FROM table_name_75 WHERE euro_competitions = "1" AND league_goals = "11"
|
the systemicmean of patient 006-167444 second measured on the first intensive care unit visit was less than the first value measured on the first intensive care unit visit?
|
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
|
SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND NOT vitalperiodic.systemicmean IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1 OFFSET 1) < (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND NOT vitalperiodic.systemicmean IS NULL ORDER BY vitalperiodic.observationtime 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: the systemicmean of patient 006-167444 second measured on the first intensive care unit visit was less than the first value measured on the first intensive care unit visit? ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
) ### Response: SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND NOT vitalperiodic.systemicmean IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1 OFFSET 1) < (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND NOT vitalperiodic.systemicmean IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1)
|
Which conference is in Portland, Oregon?
|
CREATE TABLE table_name_80 (
conference VARCHAR,
city VARCHAR
)
|
SELECT conference FROM table_name_80 WHERE city = "portland, oregon"
|
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 conference is in Portland, Oregon? ### Input: CREATE TABLE table_name_80 (
conference VARCHAR,
city VARCHAR
) ### Response: SELECT conference FROM table_name_80 WHERE city = "portland, oregon"
|
what's the character with fate being deceased: knife wound
|
CREATE TABLE table_72161 (
"Character" text,
"Fate" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Duration" text,
"Final Episode Count" real
)
|
SELECT "Character" FROM table_72161 WHERE "Fate" = 'Deceased: Knife Wound'
|
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 character with fate being deceased: knife wound ### Input: CREATE TABLE table_72161 (
"Character" text,
"Fate" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Duration" text,
"Final Episode Count" real
) ### Response: SELECT "Character" FROM table_72161 WHERE "Fate" = 'Deceased: Knife Wound'
|
Can you tell me the Week that has the Home Team of detroit, and the Divisional Record of (3-0), and the Overall Record of (5-1), and the Away Team of minnesota?
|
CREATE TABLE table_42189 (
"Week" real,
"Home Team" text,
"Away Team" text,
"Overall Record" text,
"Divisional Record" text
)
|
SELECT "Week" FROM table_42189 WHERE "Home Team" = 'detroit' AND "Divisional Record" = '(3-0)' AND "Overall Record" = '(5-1)' AND "Away Team" = 'minnesota'
|
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: Can you tell me the Week that has the Home Team of detroit, and the Divisional Record of (3-0), and the Overall Record of (5-1), and the Away Team of minnesota? ### Input: CREATE TABLE table_42189 (
"Week" real,
"Home Team" text,
"Away Team" text,
"Overall Record" text,
"Divisional Record" text
) ### Response: SELECT "Week" FROM table_42189 WHERE "Home Team" = 'detroit' AND "Divisional Record" = '(3-0)' AND "Overall Record" = '(5-1)' AND "Away Team" = 'minnesota'
|
High scoring posts per month.
|
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description 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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE 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
)
|
SELECT LAST_DATE_OF_MONTH(CreationDate), COUNT(Id) AS Posts, SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE Score >= '##min?50##' GROUP BY LAST_DATE_OF_MONTH(CreationDate) ORDER BY LAST_DATE_OF_MONTH(CreationDate)
|
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: High scoring posts per month. ### Input: CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description 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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE 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
) ### Response: SELECT LAST_DATE_OF_MONTH(CreationDate), COUNT(Id) AS Posts, SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE Score >= '##min?50##' GROUP BY LAST_DATE_OF_MONTH(CreationDate) ORDER BY LAST_DATE_OF_MONTH(CreationDate)
|
What song was 2nd (25,517) in televoting (votes)?
|
CREATE TABLE table_79339 (
"Draw" real,
"Singer" text,
"Song" text,
"Televoting (votes)" text,
"Jury" text,
"Place" text
)
|
SELECT "Song" FROM table_79339 WHERE "Televoting (votes)" = '2nd (25,517)'
|
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 song was 2nd (25,517) in televoting (votes)? ### Input: CREATE TABLE table_79339 (
"Draw" real,
"Singer" text,
"Song" text,
"Televoting (votes)" text,
"Jury" text,
"Place" text
) ### Response: SELECT "Song" FROM table_79339 WHERE "Televoting (votes)" = '2nd (25,517)'
|
Find the student ID and personal name of the student with at least two enrollments. Plot them as pie chart.
|
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
|
SELECT T2.personal_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_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: Find the student ID and personal name of the student with at least two enrollments. Plot them as pie chart. ### Input: CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
) ### Response: SELECT T2.personal_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id
|
From what Country is T2 Finish Player Gary Player?
|
CREATE TABLE table_name_60 (
country VARCHAR,
finish VARCHAR,
player VARCHAR
)
|
SELECT country FROM table_name_60 WHERE finish = "t2" AND player = "gary player"
|
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: From what Country is T2 Finish Player Gary Player? ### Input: CREATE TABLE table_name_60 (
country VARCHAR,
finish VARCHAR,
player VARCHAR
) ### Response: SELECT country FROM table_name_60 WHERE finish = "t2" AND player = "gary player"
|
On what date did ke eaumoku p pa iahiahi leave office?
|
CREATE TABLE table_name_25 (
left_office VARCHAR,
name VARCHAR
)
|
SELECT left_office FROM table_name_25 WHERE name = "ke ʻ eaumoku pāpa ʻ iahiahi"
|
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: On what date did ke eaumoku p pa iahiahi leave office? ### Input: CREATE TABLE table_name_25 (
left_office VARCHAR,
name VARCHAR
) ### Response: SELECT left_office FROM table_name_25 WHERE name = "ke ʻ eaumoku pāpa ʻ iahiahi"
|
Who was the developer of XCom: Enemy Unknown?
|
CREATE TABLE table_66448 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
|
SELECT "Developer(s)" FROM table_66448 WHERE "Game" = 'xcom: enemy unknown'
|
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 developer of XCom: Enemy Unknown? ### Input: CREATE TABLE table_66448 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) ### Response: SELECT "Developer(s)" FROM table_66448 WHERE "Game" = 'xcom: enemy unknown'
|
WHERE filtering with dates and BETWEEN.
|
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE 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 PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 CloseReasonTypes (
Id number,
Name text,
Description 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId 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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
|
SELECT * FROM dbo.Users WHERE CreationDate BETWEEN '2016/01/01' AND '2016/12/31'
|
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: WHERE filtering with dates and BETWEEN. ### Input: 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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE 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 PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 CloseReasonTypes (
Id number,
Name text,
Description 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId 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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
) ### Response: SELECT * FROM dbo.Users WHERE CreationDate BETWEEN '2016/01/01' AND '2016/12/31'
|
What was the maximum 09-10 i/o best?
|
CREATE TABLE table_27252 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"09-10 I/O best" real,
"09-10 GP/JGP best" real,
"09-10 GP/JGP 2nd" real,
"09-10 OI best" real,
"09-10 OI 2nd" real,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" real,
"08-09 OI best" real,
"08-09 OI 2nd" real
)
|
SELECT MAX("09-10 I/O best") FROM table_27252
|
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 maximum 09-10 i/o best? ### Input: CREATE TABLE table_27252 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"09-10 I/O best" real,
"09-10 GP/JGP best" real,
"09-10 GP/JGP 2nd" real,
"09-10 OI best" real,
"09-10 OI 2nd" real,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" real,
"08-09 OI best" real,
"08-09 OI 2nd" real
) ### Response: SELECT MAX("09-10 I/O best") FROM table_27252
|
What's the average Played for a draw of 5 and more than 43 points?
|
CREATE TABLE table_61715 (
"Pos." real,
"Club" text,
"Points" real,
"Played" real,
"Wins" real,
"Draw" real,
"Lost" real
)
|
SELECT AVG("Played") FROM table_61715 WHERE "Draw" = '5' AND "Points" > '43'
|
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 average Played for a draw of 5 and more than 43 points? ### Input: CREATE TABLE table_61715 (
"Pos." real,
"Club" text,
"Points" real,
"Played" real,
"Wins" real,
"Draw" real,
"Lost" real
) ### Response: SELECT AVG("Played") FROM table_61715 WHERE "Draw" = '5' AND "Points" > '43'
|
what is the number of patients whose year of birth is less than 2065 and diagnoses short title is malig neo ascend colon?
|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Malig neo ascend colon"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose year of birth is less than 2065 and diagnoses short title is malig neo ascend colon? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Malig neo ascend colon"
|
How many drawn having more than 9 points?
|
CREATE TABLE table_name_86 (
drawn INTEGER,
points INTEGER
)
|
SELECT SUM(drawn) FROM table_name_86 WHERE points > 9
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many drawn having more than 9 points? ### Input: CREATE TABLE table_name_86 (
drawn INTEGER,
points INTEGER
) ### Response: SELECT SUM(drawn) FROM table_name_86 WHERE points > 9
|
Who was Fourth in the 2008 Telstra Men's Pro Event?
|
CREATE TABLE table_name_93 (
fourth VARCHAR,
event VARCHAR
)
|
SELECT fourth FROM table_name_93 WHERE event = "2008 telstra men's pro"
|
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 Fourth in the 2008 Telstra Men's Pro Event? ### Input: CREATE TABLE table_name_93 (
fourth VARCHAR,
event VARCHAR
) ### Response: SELECT fourth FROM table_name_93 WHERE event = "2008 telstra men's pro"
|
What is the bowling style of chris harris?
|
CREATE TABLE table_17263 (
"No." text,
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
)
|
SELECT "Bowling Style" FROM table_17263 WHERE "Player" = 'Chris Harris'
|
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 bowling style of chris harris? ### Input: CREATE TABLE table_17263 (
"No." text,
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
) ### Response: SELECT "Bowling Style" FROM table_17263 WHERE "Player" = 'Chris Harris'
|
How many episodes did actress Vanessa Ferlito appear in?
|
CREATE TABLE table_16571 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
)
|
SELECT "Episodes" FROM table_16571 WHERE "Portrayed by" = 'Vanessa Ferlito'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many episodes did actress Vanessa Ferlito appear in? ### Input: CREATE TABLE table_16571 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
) ### Response: SELECT "Episodes" FROM table_16571 WHERE "Portrayed by" = 'Vanessa Ferlito'
|
What are the names and headquarters of all companies ordered by descending market value?
|
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
rank_of_the_year number
)
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
)
|
SELECT company, headquarters FROM company ORDER BY market_value DESC
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names and headquarters of all companies ordered by descending market value? ### Input: CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
rank_of_the_year number
)
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
) ### Response: SELECT company, headquarters FROM company ORDER BY market_value DESC
|
how many competitors were from the soviet union ?
|
CREATE TABLE table_204_912 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" number,
"notes" text
)
|
SELECT COUNT("athlete") FROM table_204_912 WHERE "country" = 'soviet union'
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many competitors were from the soviet union ? ### Input: CREATE TABLE table_204_912 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" number,
"notes" text
) ### Response: SELECT COUNT("athlete") FROM table_204_912 WHERE "country" = 'soviet union'
|
In what event is the opponent Joe Nameth?
|
CREATE TABLE table_name_25 (
event VARCHAR,
opponent VARCHAR
)
|
SELECT event FROM table_name_25 WHERE opponent = "joe nameth"
|
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 event is the opponent Joe Nameth? ### Input: CREATE TABLE table_name_25 (
event VARCHAR,
opponent VARCHAR
) ### Response: SELECT event FROM table_name_25 WHERE opponent = "joe nameth"
|
For each competition, count the number of matches, and rank in desc by the X-axis.
|
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
GDP real
)
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE temperature (
City_ID int,
Jan real,
Feb real,
Mar real,
Apr real,
Jun real,
Jul real,
Aug real,
Sep real,
Oct real,
Nov real,
Dec real
)
CREATE TABLE match (
Match_ID int,
Date text,
Venue text,
Score text,
Result text,
Competition text
)
|
SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY Competition 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: For each competition, count the number of matches, and rank in desc by the X-axis. ### Input: CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
GDP real
)
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE temperature (
City_ID int,
Jan real,
Feb real,
Mar real,
Apr real,
Jun real,
Jul real,
Aug real,
Sep real,
Oct real,
Nov real,
Dec real
)
CREATE TABLE match (
Match_ID int,
Date text,
Venue text,
Score text,
Result text,
Competition text
) ### Response: SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY Competition DESC
|
What score did Australia get?
|
CREATE TABLE table_48047 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
|
SELECT "Score" FROM table_48047 WHERE "Country" = 'australia'
|
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 score did Australia get? ### Input: CREATE TABLE table_48047 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) ### Response: SELECT "Score" FROM table_48047 WHERE "Country" = 'australia'
|
What is the average week with St. Louis Cardinals with less than 80,010 attendance?
|
CREATE TABLE table_name_99 (
week INTEGER,
opponent VARCHAR,
attendance VARCHAR
)
|
SELECT AVG(week) FROM table_name_99 WHERE opponent = "st. louis cardinals" AND attendance < 80 OFFSET 010
|
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 week with St. Louis Cardinals with less than 80,010 attendance? ### Input: CREATE TABLE table_name_99 (
week INTEGER,
opponent VARCHAR,
attendance VARCHAR
) ### Response: SELECT AVG(week) FROM table_name_99 WHERE opponent = "st. louis cardinals" AND attendance < 80 OFFSET 010
|
Which tie number had an away team of Arsenal?
|
CREATE TABLE table_79560 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
|
SELECT "Tie no" FROM table_79560 WHERE "Away team" = 'arsenal'
|
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 tie number had an away team of Arsenal? ### Input: CREATE TABLE table_79560 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) ### Response: SELECT "Tie no" FROM table_79560 WHERE "Away team" = 'arsenal'
|
who was the trofeo fast team in stage 10?
|
CREATE TABLE table_78047 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
|
SELECT "Trofeo Fast Team" FROM table_78047 WHERE "Stage" = '10'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the trofeo fast team in stage 10? ### Input: CREATE TABLE table_78047 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
) ### Response: SELECT "Trofeo Fast Team" FROM table_78047 WHERE "Stage" = '10'
|
What is the score when Fulham is the away team?
|
CREATE TABLE table_47836 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
|
SELECT "Score" FROM table_47836 WHERE "Away team" = 'fulham'
|
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 score when Fulham is the away team? ### Input: CREATE TABLE table_47836 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) ### Response: SELECT "Score" FROM table_47836 WHERE "Away team" = 'fulham'
|
how much ns was prescribed during this month for the first time to patient 76332?
|
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
|
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug = 'ns' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate 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 much ns was prescribed during this month for the first time to patient 76332? ### 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) ### Response: SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug = 'ns' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate LIMIT 1
|
How many people attended the game when the game was won 4-2?
|
CREATE TABLE table_name_44 (
attendance VARCHAR,
result VARCHAR
)
|
SELECT COUNT(attendance) FROM table_name_44 WHERE result = "won 4-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: How many people attended the game when the game was won 4-2? ### Input: CREATE TABLE table_name_44 (
attendance VARCHAR,
result VARCHAR
) ### Response: SELECT COUNT(attendance) FROM table_name_44 WHERE result = "won 4-2"
|
What is the total revenue of each manufacturer, sort in ascending by the names.
|
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
|
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total revenue of each manufacturer, sort in ascending by the names. ### Input: CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) ### Response: SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name
|
What is the highest number of byes where the losses were 9 and the draws were less than 0?
|
CREATE TABLE table_name_93 (
byes INTEGER,
losses VARCHAR,
draws VARCHAR
)
|
SELECT MAX(byes) FROM table_name_93 WHERE losses = 9 AND draws < 0
|
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 highest number of byes where the losses were 9 and the draws were less than 0? ### Input: CREATE TABLE table_name_93 (
byes INTEGER,
losses VARCHAR,
draws VARCHAR
) ### Response: SELECT MAX(byes) FROM table_name_93 WHERE losses = 9 AND draws < 0
|
what author is most cited ?
|
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
|
SELECT DISTINCT author.authorname, COUNT(cite.citingpaperid) FROM author, cite, writes WHERE writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid GROUP BY author.authorname ORDER BY COUNT(cite.citingpaperid) DESC
|
scholar
|
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 author is most cited ? ### Input: CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
) ### Response: SELECT DISTINCT author.authorname, COUNT(cite.citingpaperid) FROM author, cite, writes WHERE writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid GROUP BY author.authorname ORDER BY COUNT(cite.citingpaperid) DESC
|
Which Wind* has a Nationality of united states, and an Athlete of jackie joyner-kersee?
|
CREATE TABLE table_13118 (
"Mark" text,
"Wind*" text,
"Athlete" text,
"Nationality" text,
"Venue" text,
"Date" text
)
|
SELECT "Wind*" FROM table_13118 WHERE "Nationality" = 'united states' AND "Athlete" = 'jackie joyner-kersee'
|
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 Wind* has a Nationality of united states, and an Athlete of jackie joyner-kersee? ### Input: CREATE TABLE table_13118 (
"Mark" text,
"Wind*" text,
"Athlete" text,
"Nationality" text,
"Venue" text,
"Date" text
) ### Response: SELECT "Wind*" FROM table_13118 WHERE "Nationality" = 'united states' AND "Athlete" = 'jackie joyner-kersee'
|
What episode has a manual motorcycle transmissions section D?
|
CREATE TABLE table_name_20 (
episode INTEGER,
segment_d VARCHAR
)
|
SELECT SUM(episode) FROM table_name_20 WHERE segment_d = "manual motorcycle transmissions"
|
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 episode has a manual motorcycle transmissions section D? ### Input: CREATE TABLE table_name_20 (
episode INTEGER,
segment_d VARCHAR
) ### Response: SELECT SUM(episode) FROM table_name_20 WHERE segment_d = "manual motorcycle transmissions"
|
What was the score when andray blatche , al thornton (20) had the high points?
|
CREATE TABLE table_29827 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
|
SELECT "Score" FROM table_29827 WHERE "High points" = 'Andray Blatche , Al Thornton (20)'
|
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 score when andray blatche , al thornton (20) had the high points? ### Input: CREATE TABLE table_29827 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT "Score" FROM table_29827 WHERE "High points" = 'Andray Blatche , Al Thornton (20)'
|
what is the least different holders when the country is ireland and giro wins is less than 1?
|
CREATE TABLE table_65198 (
"Rank" text,
"Country" text,
"Jerseys" real,
"Giro wins" real,
"Points" real,
"Young rider" real,
"Most recent cyclist" text,
"Most recent date" text,
"Different holders" real
)
|
SELECT MIN("Different holders") FROM table_65198 WHERE "Country" = 'ireland' AND "Giro wins" < '1'
|
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 least different holders when the country is ireland and giro wins is less than 1? ### Input: CREATE TABLE table_65198 (
"Rank" text,
"Country" text,
"Jerseys" real,
"Giro wins" real,
"Points" real,
"Young rider" real,
"Most recent cyclist" text,
"Most recent date" text,
"Different holders" real
) ### Response: SELECT MIN("Different holders") FROM table_65198 WHERE "Country" = 'ireland' AND "Giro wins" < '1'
|
What was the result on 27 august 2003?
|
CREATE TABLE table_name_81 (
result VARCHAR,
date VARCHAR
)
|
SELECT result FROM table_name_81 WHERE date = "27 august 2003"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result on 27 august 2003? ### Input: CREATE TABLE table_name_81 (
result VARCHAR,
date VARCHAR
) ### Response: SELECT result FROM table_name_81 WHERE date = "27 august 2003"
|
What is the lowest December, when Score is '4 - 4'?
|
CREATE TABLE table_name_66 (
december INTEGER,
score VARCHAR
)
|
SELECT MIN(december) FROM table_name_66 WHERE score = "4 - 4"
|
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 lowest December, when Score is '4 - 4'? ### Input: CREATE TABLE table_name_66 (
december INTEGER,
score VARCHAR
) ### Response: SELECT MIN(december) FROM table_name_66 WHERE score = "4 - 4"
|
Find the name of organizations whose names contain 'Party'.
|
CREATE TABLE individuals (
individual_id number,
individual_first_name text,
individual_middle_name text,
inidividual_phone text,
individual_email text,
individual_address text,
individual_last_name text
)
CREATE TABLE party_services (
booking_id number,
customer_id number,
service_id number,
service_datetime time,
booking_made_date time
)
CREATE TABLE organizations (
organization_id number,
date_formed time,
organization_name text,
uk_vat_number text
)
CREATE TABLE organization_contact_individuals (
individual_id number,
organization_id number,
date_contact_from time,
date_contact_to time
)
CREATE TABLE forms (
form_id number,
form_type_code text,
service_id number,
form_number text,
form_name text,
form_description text
)
CREATE TABLE party_addresses (
party_id number,
address_id number,
date_address_from time,
address_type_code text,
date_address_to time
)
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
town_city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE parties (
party_id number,
payment_method_code text,
party_phone text,
party_email text
)
CREATE TABLE party_forms (
party_id number,
form_id number,
date_completion_started time,
form_status_code text,
date_fully_completed time
)
CREATE TABLE services (
service_id number,
service_type_code text,
service_name text,
service_descriptio text
)
|
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
|
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: Find the name of organizations whose names contain 'Party'. ### Input: CREATE TABLE individuals (
individual_id number,
individual_first_name text,
individual_middle_name text,
inidividual_phone text,
individual_email text,
individual_address text,
individual_last_name text
)
CREATE TABLE party_services (
booking_id number,
customer_id number,
service_id number,
service_datetime time,
booking_made_date time
)
CREATE TABLE organizations (
organization_id number,
date_formed time,
organization_name text,
uk_vat_number text
)
CREATE TABLE organization_contact_individuals (
individual_id number,
organization_id number,
date_contact_from time,
date_contact_to time
)
CREATE TABLE forms (
form_id number,
form_type_code text,
service_id number,
form_number text,
form_name text,
form_description text
)
CREATE TABLE party_addresses (
party_id number,
address_id number,
date_address_from time,
address_type_code text,
date_address_to time
)
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
town_city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE parties (
party_id number,
payment_method_code text,
party_phone text,
party_email text
)
CREATE TABLE party_forms (
party_id number,
form_id number,
date_completion_started time,
form_status_code text,
date_fully_completed time
)
CREATE TABLE services (
service_id number,
service_type_code text,
service_name text,
service_descriptio text
) ### Response: SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
|
Which week was the December 21, 2003 game?
|
CREATE TABLE table_14135 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
)
|
SELECT "Week" FROM table_14135 WHERE "Date" = 'december 21, 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: Which week was the December 21, 2003 game? ### Input: CREATE TABLE table_14135 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) ### Response: SELECT "Week" FROM table_14135 WHERE "Date" = 'december 21, 2003'
|
when were patient 20332 first prescribed for aspirin and potassium chl 20 meq / 1000 ml d5 1/2 ns at the same 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 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 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 d_labitems (
row_id number,
itemid number,
label text
)
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE 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 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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
|
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'aspirin' AND admissions.subject_id = 20332) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'potassium chl 20 meq / 1000 ml d5 1/2 ns' AND admissions.subject_id = 20332) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate 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: when were patient 20332 first prescribed for aspirin and potassium chl 20 meq / 1000 ml d5 1/2 ns at the same time? ### Input: 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 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 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 d_labitems (
row_id number,
itemid number,
label text
)
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE 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 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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'aspirin' AND admissions.subject_id = 20332) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'potassium chl 20 meq / 1000 ml d5 1/2 ns' AND admissions.subject_id = 20332) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate LIMIT 1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.