instruction
stringlengths 0
1.06k
| input
stringlengths 33
7.14k
| response
stringlengths 2
4.44k
| source
stringclasses 25
values | text
stringlengths 302
8.5k
|
---|---|---|---|---|
Posts that link to other sites.
|
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 PostTags (
PostId number,
TagId 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 ReviewTaskStates (
Id number,
Name text,
Description 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
|
SELECT p.Id, p.PostTypeId, p.Score FROM Posts AS p WHERE p.Score > 1 AND p.PostTypeId = 1 AND p.Body LIKE '%judaism%'
|
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: Posts that link to other sites. ### Input: 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 PostTags (
PostId number,
TagId 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 ReviewTaskStates (
Id number,
Name text,
Description 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
) ### Response: SELECT p.Id, p.PostTypeId, p.Score FROM Posts AS p WHERE p.Score > 1 AND p.PostTypeId = 1 AND p.Body LIKE '%judaism%'
|
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart.
|
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
|
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. ### Input: CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
|
What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois?
|
CREATE TABLE table_name_9 (
name VARCHAR,
state VARCHAR,
opened__closing_date_if_defunct_ VARCHAR,
length VARCHAR
)
|
SELECT name FROM table_name_9 WHERE opened__closing_date_if_defunct_ = "1995" AND length = "miles (m)" AND state = "illinois"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois? ### Input: CREATE TABLE table_name_9 (
name VARCHAR,
state VARCHAR,
opened__closing_date_if_defunct_ VARCHAR,
length VARCHAR
) ### Response: SELECT name FROM table_name_9 WHERE opened__closing_date_if_defunct_ = "1995" AND length = "miles (m)" AND state = "illinois"
|
What are the names of the directors who made exactly one movie?
|
CREATE TABLE Movie (
director VARCHAR
)
|
SELECT director FROM Movie GROUP BY director 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: What are the names of the directors who made exactly one movie? ### Input: CREATE TABLE Movie (
director VARCHAR
) ### Response: SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1
|
how many patients whose ethnicity is black/african american and days of hospital stay is greater than 1?
|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.days_stay > "1"
|
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 ethnicity is black/african american and days of hospital stay is greater than 1? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.days_stay > "1"
|
Mike Miller played for what school/club team?
|
CREATE TABLE table_40723 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
|
SELECT "School/Club Team" FROM table_40723 WHERE "Player" = 'mike miller'
|
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: Mike Miller played for what school/club team? ### Input: CREATE TABLE table_40723 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) ### Response: SELECT "School/Club Team" FROM table_40723 WHERE "Player" = 'mike miller'
|
What's the lowest round Justin Forsett was drafted in, with a draft pick larger than 233?
|
CREATE TABLE table_42182 (
"Round" real,
"Pick" real,
"Name" text,
"Position" text,
"College" text
)
|
SELECT MIN("Round") FROM table_42182 WHERE "Name" = 'justin forsett' AND "Pick" > '233'
|
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 lowest round Justin Forsett was drafted in, with a draft pick larger than 233? ### Input: CREATE TABLE table_42182 (
"Round" real,
"Pick" real,
"Name" text,
"Position" text,
"College" text
) ### Response: SELECT MIN("Round") FROM table_42182 WHERE "Name" = 'justin forsett' AND "Pick" > '233'
|
Which Nationality has a Round smaller than 3?
|
CREATE TABLE table_name_98 (
nationality VARCHAR,
round INTEGER
)
|
SELECT nationality FROM table_name_98 WHERE round < 3
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Nationality has a Round smaller than 3? ### Input: CREATE TABLE table_name_98 (
nationality VARCHAR,
round INTEGER
) ### Response: SELECT nationality FROM table_name_98 WHERE round < 3
|
In the Spring-Summer term , what BIOSTAT courses are being taught ?
|
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college 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 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 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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE 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 area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
|
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BIOSTAT' AND semester.semester = 'Spring-Summer'
|
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: In the Spring-Summer term , what BIOSTAT courses are being taught ? ### Input: CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college 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 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 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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE 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 area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BIOSTAT' AND semester.semester = 'Spring-Summer'
|
how many patients had an urgent admission type with a sc drug route?
|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "SC"
|
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 had an urgent admission type with a sc drug route? ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "SC"
|
What is the record for the date november 19?
|
CREATE TABLE table_29766 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
|
SELECT "Record" FROM table_29766 WHERE "Date" = 'November 19'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the record for the date november 19? ### Input: CREATE TABLE table_29766 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT "Record" FROM table_29766 WHERE "Date" = 'November 19'
|
what is smallest number in fleet for chassis manufacturer Scania and fleet numbers is 3230?
|
CREATE TABLE table_19197 (
"Chassis Manufacturer" text,
"Chassis Model" text,
"Body Model" text,
"Number in Fleet" real,
"Fleet Numbers" text
)
|
SELECT MIN("Number in Fleet") FROM table_19197 WHERE "Chassis Manufacturer" = 'Scania' AND "Fleet Numbers" = '3230'
|
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 smallest number in fleet for chassis manufacturer Scania and fleet numbers is 3230? ### Input: CREATE TABLE table_19197 (
"Chassis Manufacturer" text,
"Chassis Model" text,
"Body Model" text,
"Number in Fleet" real,
"Fleet Numbers" text
) ### Response: SELECT MIN("Number in Fleet") FROM table_19197 WHERE "Chassis Manufacturer" = 'Scania' AND "Fleet Numbers" = '3230'
|
Name the reason for change pennsylvania 13th
|
CREATE TABLE table_73407 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
)
|
SELECT "Reason for change" FROM table_73407 WHERE "District" = 'Pennsylvania 13th'
|
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 reason for change pennsylvania 13th ### Input: CREATE TABLE table_73407 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) ### Response: SELECT "Reason for change" FROM table_73407 WHERE "District" = 'Pennsylvania 13th'
|
What are the average price and score of wines for each appelation?
|
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
|
SELECT AVG(price), AVG(score), appelation FROM wine GROUP BY appelation
|
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 average price and score of wines for each appelation? ### Input: CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
) ### Response: SELECT AVG(price), AVG(score), appelation FROM wine GROUP BY appelation
|
Which Polish Context classes handle the PreMajor requirement ?
|
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 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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year 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 jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
|
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Polish Context%' OR course.description LIKE '%Polish Context%' OR course.name LIKE '%Polish Context%') AND program_course.category LIKE '%PreMajor%'
|
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: Which Polish Context classes handle the PreMajor requirement ? ### Input: 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 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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year 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 jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Polish Context%' OR course.description LIKE '%Polish Context%' OR course.name LIKE '%Polish Context%') AND program_course.category LIKE '%PreMajor%'
|
Name the points against for porthcawl rfc
|
CREATE TABLE table_name_87 (
points_against VARCHAR,
club VARCHAR
)
|
SELECT points_against FROM table_name_87 WHERE club = "porthcawl rfc"
|
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 points against for porthcawl rfc ### Input: CREATE TABLE table_name_87 (
points_against VARCHAR,
club VARCHAR
) ### Response: SELECT points_against FROM table_name_87 WHERE club = "porthcawl rfc"
|
What is the lowest against when the draws are more than 0 and the losses are less than 3?
|
CREATE TABLE table_63531 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
)
|
SELECT MIN("Against") FROM table_63531 WHERE "Losses" < '3' AND "Draws" > '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest against when the draws are more than 0 and the losses are less than 3? ### Input: CREATE TABLE table_63531 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) ### Response: SELECT MIN("Against") FROM table_63531 WHERE "Losses" < '3' AND "Draws" > '0'
|
how many patients got prescriptions for quinidine gluconate e.r. until 3 years ago?
|
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
|
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'quinidine gluconate e.r.' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year'))
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients got prescriptions for quinidine gluconate e.r. until 3 years ago? ### Input: CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'quinidine gluconate e.r.' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year'))
|
What are the degrees conferred in 'San Francisco State University' in 2001.
|
CREATE TABLE degrees (
Id VARCHAR
)
CREATE TABLE campuses (
Id VARCHAR
)
|
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the degrees conferred in 'San Francisco State University' in 2001. ### Input: CREATE TABLE degrees (
Id VARCHAR
)
CREATE TABLE campuses (
Id VARCHAR
) ### Response: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001
|
avg passengers in 2012 for 2009 more than 104.5 and 2010 less than 162.6 and 2011 less than 141.8 is what?
|
CREATE TABLE table_5613 (
"Rank" real,
"Airline" text,
"2012" real,
"2011" real,
"2010" real,
"2009" real
)
|
SELECT AVG("2012") FROM table_5613 WHERE "2009" > '104.5' AND "2010" < '162.6' AND "2011" < '141.8'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: avg passengers in 2012 for 2009 more than 104.5 and 2010 less than 162.6 and 2011 less than 141.8 is what? ### Input: CREATE TABLE table_5613 (
"Rank" real,
"Airline" text,
"2012" real,
"2011" real,
"2010" real,
"2009" real
) ### Response: SELECT AVG("2012") FROM table_5613 WHERE "2009" > '104.5' AND "2010" < '162.6' AND "2011" < '141.8'
|
when was the last time patient 022-130563 was prescribed medicine via inh route?
|
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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 = '022-130563')) AND medication.routeadmin = 'inh' ORDER BY medication.drugstarttime DESC LIMIT 1
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time patient 022-130563 was prescribed medicine via inh route? ### 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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 = '022-130563')) AND medication.routeadmin = 'inh' ORDER BY medication.drugstarttime DESC LIMIT 1
|
flight from DALLAS to BOSTON tomorrow
|
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 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 code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE 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 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 date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
day_name 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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE 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
)
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' 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: flight from DALLAS to BOSTON tomorrow ### Input: 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 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 code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE 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 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 date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
day_name 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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE 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
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
|
How much Drawn has Goals Against of 81, and a Lost larger than 23?
|
CREATE TABLE table_79157 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
|
SELECT COUNT("Drawn") FROM table_79157 WHERE "Goals Against" = '81' AND "Lost" > '23'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Drawn has Goals Against of 81, and a Lost larger than 23? ### Input: CREATE TABLE table_79157 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) ### Response: SELECT COUNT("Drawn") FROM table_79157 WHERE "Goals Against" = '81' AND "Lost" > '23'
|
what is the cerclis ID when the site was proposed on 12/30/1982 and was partially deleted on 05/01/2003?
|
CREATE TABLE table_77866 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
)
|
SELECT "CERCLIS ID" FROM table_77866 WHERE "Proposed" = '12/30/1982' AND "Partially deleted" = '05/01/2003'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the cerclis ID when the site was proposed on 12/30/1982 and was partially deleted on 05/01/2003? ### Input: CREATE TABLE table_77866 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) ### Response: SELECT "CERCLIS ID" FROM table_77866 WHERE "Proposed" = '12/30/1982' AND "Partially deleted" = '05/01/2003'
|
For each type, what is the average tonnage?
|
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
|
SELECT type, AVG(tonnage) FROM ship GROUP BY type
|
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: For each type, what is the average tonnage? ### Input: CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
) ### Response: SELECT type, AVG(tonnage) FROM ship GROUP BY type
|
What is the Bello when Ben-Tahir is 296?
|
CREATE TABLE table_11447995_2 (
bello VARCHAR,
ben_tahir VARCHAR
)
|
SELECT bello FROM table_11447995_2 WHERE ben_tahir = "296"
|
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 Bello when Ben-Tahir is 296? ### Input: CREATE TABLE table_11447995_2 (
bello VARCHAR,
ben_tahir VARCHAR
) ### Response: SELECT bello FROM table_11447995_2 WHERE ben_tahir = "296"
|
what is date of birth and admission type of subject name james sloan?
|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
|
SELECT demographic.dob, demographic.admission_type FROM demographic WHERE demographic.name = "James Sloan"
|
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 date of birth and admission type of subject name james sloan? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) ### Response: SELECT demographic.dob, demographic.admission_type FROM demographic WHERE demographic.name = "James Sloan"
|
How many races in 2012 season have 0 podiums?
|
CREATE TABLE table_25980 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
|
SELECT COUNT("Races") FROM table_25980 WHERE "Season" = '2012' AND "Podiums" = '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many races in 2012 season have 0 podiums? ### Input: CREATE TABLE table_25980 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) ### Response: SELECT COUNT("Races") FROM table_25980 WHERE "Season" = '2012' AND "Podiums" = '0'
|
What was the location for the date 7 10 october?
|
CREATE TABLE table_26686908_2 (
city___state VARCHAR,
date VARCHAR
)
|
SELECT city___state FROM table_26686908_2 WHERE date = "7–10 October"
|
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 location for the date 7 10 october? ### Input: CREATE TABLE table_26686908_2 (
city___state VARCHAR,
date VARCHAR
) ### Response: SELECT city___state FROM table_26686908_2 WHERE date = "7–10 October"
|
list the patient identifications of patients who have been diagnosed with cannabis abuse-unspec since 2 years ago.
|
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE 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
)
|
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cannabis abuse-unspec') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year'))
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the patient identifications of patients who have been diagnosed with cannabis abuse-unspec since 2 years ago. ### Input: CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE 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
) ### Response: SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cannabis abuse-unspec') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year'))
|
What is the 2005 value with a q2 in 2011, a q1 in 2012, and 1r in 2003?
|
CREATE TABLE table_name_48 (
Id VARCHAR
)
|
SELECT 2005 FROM table_name_48 WHERE 2011 = "q2" AND 2012 = "q1" AND 2003 = "1r"
|
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 2005 value with a q2 in 2011, a q1 in 2012, and 1r in 2003? ### Input: CREATE TABLE table_name_48 (
Id VARCHAR
) ### Response: SELECT 2005 FROM table_name_48 WHERE 2011 = "q2" AND 2012 = "q1" AND 2003 = "1r"
|
What are the companies and main industries of all companies that are not headquartered in the United States?
|
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, main_industry FROM company WHERE headquarters <> 'USA'
|
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 companies and main industries of all companies that are not headquartered in the United States? ### 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, main_industry FROM company WHERE headquarters <> 'USA'
|
What was the name of the album that was a demo release?
|
CREATE TABLE table_47893 (
"Year" real,
"Album" text,
"Release type" text,
"Label" text,
"Hungarian top 40 album charts" text
)
|
SELECT "Album" FROM table_47893 WHERE "Release type" = 'demo'
|
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 name of the album that was a demo release? ### Input: CREATE TABLE table_47893 (
"Year" real,
"Album" text,
"Release type" text,
"Label" text,
"Hungarian top 40 album charts" text
) ### Response: SELECT "Album" FROM table_47893 WHERE "Release type" = 'demo'
|
Find the last and first name of students who are playing Football or Lacrosse.
|
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
|
SELECT T2.lname, T2.fname FROM sportsinfo AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T1.sportname = "Football" OR T1.sportname = "Lacrosse"
|
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 last and first name of students who are playing Football or Lacrosse. ### Input: CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
) ### Response: SELECT T2.lname, T2.fname FROM sportsinfo AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T1.sportname = "Football" OR T1.sportname = "Lacrosse"
|
(Possibly) suspended users with Supporter badge.
|
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE 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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistoryTypes (
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 PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId 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 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 VoteTypes (
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 ReviewTaskResultTypes (
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 PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
|
SELECT u.CreationDate, u.Id AS "user_link" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Nice Question' AND u.Reputation <= 1 GROUP BY u.Id, u.CreationDate ORDER BY u.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: (Possibly) suspended users with Supporter badge. ### Input: CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE 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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistoryTypes (
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 PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId 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 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 VoteTypes (
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 ReviewTaskResultTypes (
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 PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
) ### Response: SELECT u.CreationDate, u.Id AS "user_link" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Nice Question' AND u.Reputation <= 1 GROUP BY u.Id, u.CreationDate ORDER BY u.CreationDate
|
Tell me the highest laps for time/retired of +2 laps and driver of felice bonetto
|
CREATE TABLE table_53369 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
)
|
SELECT MAX("Laps") FROM table_53369 WHERE "Time/retired" = '+2 laps' AND "Driver" = 'felice bonetto'
|
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: Tell me the highest laps for time/retired of +2 laps and driver of felice bonetto ### Input: CREATE TABLE table_53369 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
) ### Response: SELECT MAX("Laps") FROM table_53369 WHERE "Time/retired" = '+2 laps' AND "Driver" = 'felice bonetto'
|
What is the name for the species Authority of sigmodon hispidus say & ord, 1825?
|
CREATE TABLE table_67363 (
"Name" text,
"Species Authority" text,
"Order" text,
"Family" text,
"Red List" real
)
|
SELECT "Name" FROM table_67363 WHERE "Species Authority" = 'sigmodon hispidus say & ord, 1825'
|
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 name for the species Authority of sigmodon hispidus say & ord, 1825? ### Input: CREATE TABLE table_67363 (
"Name" text,
"Species Authority" text,
"Order" text,
"Family" text,
"Red List" real
) ### Response: SELECT "Name" FROM table_67363 WHERE "Species Authority" = 'sigmodon hispidus say & ord, 1825'
|
Which City has a Country of spain, and a Stadium of palacio de deportes de santander?
|
CREATE TABLE table_37255 (
"Rank" real,
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text
)
|
SELECT "City" FROM table_37255 WHERE "Country" = 'spain' AND "Stadium" = 'palacio de deportes de santander'
|
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 City has a Country of spain, and a Stadium of palacio de deportes de santander? ### Input: CREATE TABLE table_37255 (
"Rank" real,
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text
) ### Response: SELECT "City" FROM table_37255 WHERE "Country" = 'spain' AND "Stadium" = 'palacio de deportes de santander'
|
What was the office up for election when Sylvia Weinstein ran under the Socialist Workers ticket?
|
CREATE TABLE table_42003 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Liberal ticket" text,
"Conservative ticket" text,
"Socialist Workers ticket" text,
"Socialist Labor ticket" text
)
|
SELECT "Office" FROM table_42003 WHERE "Socialist Workers ticket" = 'sylvia weinstein'
|
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 office up for election when Sylvia Weinstein ran under the Socialist Workers ticket? ### Input: CREATE TABLE table_42003 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Liberal ticket" text,
"Conservative ticket" text,
"Socialist Workers ticket" text,
"Socialist Labor ticket" text
) ### Response: SELECT "Office" FROM table_42003 WHERE "Socialist Workers ticket" = 'sylvia weinstein'
|
tell me the number of patients on main drug type prescription who were diagnosed with cardiac complications, not elsewhere classified.
|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Surg compl-heart" AND prescriptions.drug_type = "MAIN"
|
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: tell me the number of patients on main drug type prescription who were diagnosed with cardiac complications, not elsewhere classified. ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Surg compl-heart" AND prescriptions.drug_type = "MAIN"
|
What date was parliament assembled when John rudhale was first member?
|
CREATE TABLE table_15451122_2 (
assembled VARCHAR,
first_member VARCHAR
)
|
SELECT assembled FROM table_15451122_2 WHERE first_member = "John Rudhale"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date was parliament assembled when John rudhale was first member? ### Input: CREATE TABLE table_15451122_2 (
assembled VARCHAR,
first_member VARCHAR
) ### Response: SELECT assembled FROM table_15451122_2 WHERE first_member = "John Rudhale"
|
What kind of Altade a has del Pueblo of maroon/gray?
|
CREATE TABLE table_75760 (
"Information" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
)
|
SELECT "Altade\u00f1a" FROM table_75760 WHERE "del Pueblo" = 'maroon/gray'
|
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 kind of Altade a has del Pueblo of maroon/gray? ### Input: CREATE TABLE table_75760 (
"Information" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
) ### Response: SELECT "Altade\u00f1a" FROM table_75760 WHERE "del Pueblo" = 'maroon/gray'
|
What is the time/retired of the one with grid of 16?
|
CREATE TABLE table_name_60 (
time_retired VARCHAR,
grid VARCHAR
)
|
SELECT time_retired FROM table_name_60 WHERE grid = 16
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the time/retired of the one with grid of 16? ### Input: CREATE TABLE table_name_60 (
time_retired VARCHAR,
grid VARCHAR
) ### Response: SELECT time_retired FROM table_name_60 WHERE grid = 16
|
Bar graph to show age from different name, display by the x-axis from high to low please.
|
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
|
SELECT Name, Age FROM driver ORDER BY 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 graph to show age from different name, display by the x-axis from high to low please. ### Input: CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
) ### Response: SELECT Name, Age FROM driver ORDER BY Name DESC
|
Which Score has a Series of flyers lead 3 2?
|
CREATE TABLE table_38138 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
)
|
SELECT "Score" FROM table_38138 WHERE "Series" = 'flyers lead 3–2'
|
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 Score has a Series of flyers lead 3 2? ### Input: CREATE TABLE table_38138 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) ### Response: SELECT "Score" FROM table_38138 WHERE "Series" = 'flyers lead 3–2'
|
How many settlements does each claim correspond to? List the claim id and the number of settlements.
|
CREATE TABLE customer_policies (
policy_id number,
customer_id number,
policy_type_code text,
start_date time,
end_date time
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number
)
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
date_payment_made time,
amount_payment number
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
|
SELECT T1.claim_id, COUNT(*) FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id
|
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 settlements does each claim correspond to? List the claim id and the number of settlements. ### Input: CREATE TABLE customer_policies (
policy_id number,
customer_id number,
policy_type_code text,
start_date time,
end_date time
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number
)
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
date_payment_made time,
amount_payment number
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
) ### Response: SELECT T1.claim_id, COUNT(*) FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id
|
what's the price of quantitative g6pd.
|
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_procedures (
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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
|
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'quantitative g6pd'))
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the price of quantitative g6pd. ### Input: CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_procedures (
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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
) ### Response: SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'quantitative g6pd'))
|
What shows for 2002 when the 2004 is A, and the 2005 is 1r?
|
CREATE TABLE table_45219 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text
)
|
SELECT "2002" FROM table_45219 WHERE "2004" = 'a' AND "2005" = '1r'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shows for 2002 when the 2004 is A, and the 2005 is 1r? ### Input: CREATE TABLE table_45219 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text
) ### Response: SELECT "2002" FROM table_45219 WHERE "2004" = 'a' AND "2005" = '1r'
|
Name the total number of represents for clary sermina delgado cid
|
CREATE TABLE table_73934 (
"Represents" text,
"Contestant" text,
"Age" real,
"Height (cm)" text,
"Height (ft)" text,
"Hometown" text
)
|
SELECT COUNT("Represents") FROM table_73934 WHERE "Contestant" = 'Clary Sermina Delgado Cid'
|
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 total number of represents for clary sermina delgado cid ### Input: CREATE TABLE table_73934 (
"Represents" text,
"Contestant" text,
"Age" real,
"Height (cm)" text,
"Height (ft)" text,
"Hometown" text
) ### Response: SELECT COUNT("Represents") FROM table_73934 WHERE "Contestant" = 'Clary Sermina Delgado Cid'
|
In Strategy of Sport Organizations what courses satisfy the PreMajor requirement ?
|
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 ta (
campus_job_id int,
student_id int,
location varchar
)
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 requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
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 instructor (
instructor_id int,
name varchar,
uniqname 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 (
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 area (
course_id int,
area varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_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 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
)
|
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Strategy of Sport Organizations%' OR course.description LIKE '%Strategy of Sport Organizations%' OR course.name LIKE '%Strategy of Sport Organizations%') AND program_course.category LIKE '%PreMajor%'
|
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: In Strategy of Sport Organizations what courses satisfy the PreMajor requirement ? ### Input: 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 ta (
campus_job_id int,
student_id int,
location varchar
)
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 requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
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 instructor (
instructor_id int,
name varchar,
uniqname 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 (
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 area (
course_id int,
area varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_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 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
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Strategy of Sport Organizations%' OR course.description LIKE '%Strategy of Sport Organizations%' OR course.name LIKE '%Strategy of Sport Organizations%') AND program_course.category LIKE '%PreMajor%'
|
Name the position for fis points being 3495
|
CREATE TABLE table_30073089_2 (
position VARCHAR,
fis_points VARCHAR
)
|
SELECT position FROM table_30073089_2 WHERE fis_points = 3495
|
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 position for fis points being 3495 ### Input: CREATE TABLE table_30073089_2 (
position VARCHAR,
fis_points VARCHAR
) ### Response: SELECT position FROM table_30073089_2 WHERE fis_points = 3495
|
What is sun yang's lowest rank?
|
CREATE TABLE table_name_20 (
rank INTEGER,
name VARCHAR
)
|
SELECT MIN(rank) FROM table_name_20 WHERE name = "sun yang"
|
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 sun yang's lowest rank? ### Input: CREATE TABLE table_name_20 (
rank INTEGER,
name VARCHAR
) ### Response: SELECT MIN(rank) FROM table_name_20 WHERE name = "sun yang"
|
Name the season for spvgg bayreuth and fsv salmrohr
|
CREATE TABLE table_969 (
"Season" text,
"Oberliga Bayern" text,
"Oberliga Hessen" text,
"Oberliga Baden-W\u00fcrttemberg" text,
"Oberliga S\u00fcdwest" text
)
|
SELECT "Season" FROM table_969 WHERE "Oberliga Bayern" = 'SpVgg Bayreuth' AND "Oberliga S\u00fcdwest" = 'FSV Salmrohr'
|
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 season for spvgg bayreuth and fsv salmrohr ### Input: CREATE TABLE table_969 (
"Season" text,
"Oberliga Bayern" text,
"Oberliga Hessen" text,
"Oberliga Baden-W\u00fcrttemberg" text,
"Oberliga S\u00fcdwest" text
) ### Response: SELECT "Season" FROM table_969 WHERE "Oberliga Bayern" = 'SpVgg Bayreuth' AND "Oberliga S\u00fcdwest" = 'FSV Salmrohr'
|
How many songs have used the instrument 'drums'?
|
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
|
SELECT COUNT(*) FROM instruments WHERE instrument = "drums"
|
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 songs have used the instrument 'drums'? ### Input: CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
) ### Response: SELECT COUNT(*) FROM instruments WHERE instrument = "drums"
|
The 1.6 Duratec model/engine has how many torque formulas?
|
CREATE TABLE table_1212189_1 (
torque__nm__rpm VARCHAR,
model_engine VARCHAR
)
|
SELECT COUNT(torque__nm__rpm) FROM table_1212189_1 WHERE model_engine = "1.6 Duratec"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The 1.6 Duratec model/engine has how many torque formulas? ### Input: CREATE TABLE table_1212189_1 (
torque__nm__rpm VARCHAR,
model_engine VARCHAR
) ### Response: SELECT COUNT(torque__nm__rpm) FROM table_1212189_1 WHERE model_engine = "1.6 Duratec"
|
How much Preston North End has a Blackpool smaller than 0?
|
CREATE TABLE table_6320 (
"Competition" text,
"Played" real,
"Blackpool" real,
"Draw" real,
"Preston North End" real
)
|
SELECT COUNT("Preston North End") FROM table_6320 WHERE "Blackpool" < '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Preston North End has a Blackpool smaller than 0? ### Input: CREATE TABLE table_6320 (
"Competition" text,
"Played" real,
"Blackpool" real,
"Draw" real,
"Preston North End" real
) ### Response: SELECT COUNT("Preston North End") FROM table_6320 WHERE "Blackpool" < '0'
|
What is the Lost with Against smaller than 25, and Played smaller than 1?
|
CREATE TABLE table_13005 (
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"% Won" real
)
|
SELECT AVG("Lost") FROM table_13005 WHERE "Against" < '25' AND "Played" < '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 Lost with Against smaller than 25, and Played smaller than 1? ### Input: CREATE TABLE table_13005 (
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"% Won" real
) ### Response: SELECT AVG("Lost") FROM table_13005 WHERE "Against" < '25' AND "Played" < '1'
|
On what Surface was the match against Malek Jaziri played?
|
CREATE TABLE table_50190 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
|
SELECT "Surface" FROM table_50190 WHERE "Opponent" = 'malek jaziri'
|
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: On what Surface was the match against Malek Jaziri played? ### Input: CREATE TABLE table_50190 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) ### Response: SELECT "Surface" FROM table_50190 WHERE "Opponent" = 'malek jaziri'
|
Time ( ET ) of 1:00pm, and a Result of w 34 14 has what record?
|
CREATE TABLE table_name_67 (
record VARCHAR,
time___et__ VARCHAR,
result VARCHAR
)
|
SELECT record FROM table_name_67 WHERE time___et__ = "1:00pm" AND result = "w 34–14"
|
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: Time ( ET ) of 1:00pm, and a Result of w 34 14 has what record? ### Input: CREATE TABLE table_name_67 (
record VARCHAR,
time___et__ VARCHAR,
result VARCHAR
) ### Response: SELECT record FROM table_name_67 WHERE time___et__ = "1:00pm" AND result = "w 34–14"
|
What is the largest pick by the Baltimore Colts in a round later than 10?
|
CREATE TABLE table_name_27 (
pick INTEGER,
nfl_club VARCHAR,
round VARCHAR
)
|
SELECT MAX(pick) FROM table_name_27 WHERE nfl_club = "baltimore colts" AND round > 10
|
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 largest pick by the Baltimore Colts in a round later than 10? ### Input: CREATE TABLE table_name_27 (
pick INTEGER,
nfl_club VARCHAR,
round VARCHAR
) ### Response: SELECT MAX(pick) FROM table_name_27 WHERE nfl_club = "baltimore colts" AND round > 10
|
count the number of patients who were admitted via emergency hospital room and diagnosed with pneumonia in aspergillosis.
|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
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.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.long_title = "Pneumonia in aspergillosis"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who were admitted via emergency hospital room and diagnosed with pneumonia in aspergillosis. ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
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.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.long_title = "Pneumonia in aspergillosis"
|
Find posts with specific text.
|
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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate 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 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 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
|
SELECT p.CreationDate AS "Date", u.Id AS "User ID", u.DisplayName AS "User Name", p.Id AS "post_link" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Body LIKE '%##SpecifiedText##%'
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find posts with specific text. ### Input: 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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate 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 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 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
) ### Response: SELECT p.CreationDate AS "Date", u.Id AS "User ID", u.DisplayName AS "User Name", p.Id AS "post_link" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Body LIKE '%##SpecifiedText##%'
|
who is the the mens singles with mens doubles being kaj lindfors kaj osterberg
|
CREATE TABLE table_19031 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
|
SELECT "Mens singles" FROM table_19031 WHERE "Mens doubles" = 'Kaj Lindfors Kaj Osterberg'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who is the the mens singles with mens doubles being kaj lindfors kaj osterberg ### Input: CREATE TABLE table_19031 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) ### Response: SELECT "Mens singles" FROM table_19031 WHERE "Mens doubles" = 'Kaj Lindfors Kaj Osterberg'
|
ATLANTA to PITTSBURGH
|
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 flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description 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 time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE 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 airline (
airline_code varchar,
airline_name text,
note 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 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 state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt 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
)
|
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
atis
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: ATLANTA to PITTSBURGH ### Input: 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 flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description 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 time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE 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 airline (
airline_code varchar,
airline_name text,
note 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 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 state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt 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
) ### 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
Which player has 68 as the score and canada as the country?
|
CREATE TABLE table_name_35 (
player VARCHAR,
score VARCHAR,
country VARCHAR
)
|
SELECT player FROM table_name_35 WHERE score = 68 AND country = "canada"
|
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 player has 68 as the score and canada as the country? ### Input: CREATE TABLE table_name_35 (
player VARCHAR,
score VARCHAR,
country VARCHAR
) ### Response: SELECT player FROM table_name_35 WHERE score = 68 AND country = "canada"
|
How many players are affiliated with indiana university?
|
CREATE TABLE table_25518547_4 (
player VARCHAR,
affiliation VARCHAR
)
|
SELECT COUNT(player) FROM table_25518547_4 WHERE affiliation = "Indiana University"
|
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 players are affiliated with indiana university? ### Input: CREATE TABLE table_25518547_4 (
player VARCHAR,
affiliation VARCHAR
) ### Response: SELECT COUNT(player) FROM table_25518547_4 WHERE affiliation = "Indiana University"
|
For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, show Y-axis from high to low order.
|
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
|
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths 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 all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, show Y-axis from high to low order. ### Input: CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
) ### Response: SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths DESC
|
how many spokesperson where in 2004
|
CREATE TABLE table_2190 (
"Year(s)" real,
"Commentator" text,
"Dual Commentator" text,
"Spokesperson" text,
"Channel" text
)
|
SELECT COUNT("Spokesperson") FROM table_2190 WHERE "Year(s)" = '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: how many spokesperson where in 2004 ### Input: CREATE TABLE table_2190 (
"Year(s)" real,
"Commentator" text,
"Dual Commentator" text,
"Spokesperson" text,
"Channel" text
) ### Response: SELECT COUNT("Spokesperson") FROM table_2190 WHERE "Year(s)" = '2004'
|
Where did the home team score 18.17 (125)?
|
CREATE TABLE table_32816 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
|
SELECT "Venue" FROM table_32816 WHERE "Home team score" = '18.17 (125)'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the home team score 18.17 (125)? ### Input: CREATE TABLE table_32816 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Venue" FROM table_32816 WHERE "Home team score" = '18.17 (125)'
|
What is the sum of Points, when the Performer is fe-mail?
|
CREATE TABLE table_name_64 (
points INTEGER,
performer VARCHAR
)
|
SELECT SUM(points) FROM table_name_64 WHERE performer = "fe-mail"
|
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 sum of Points, when the Performer is fe-mail? ### Input: CREATE TABLE table_name_64 (
points INTEGER,
performer VARCHAR
) ### Response: SELECT SUM(points) FROM table_name_64 WHERE performer = "fe-mail"
|
In the match where fitzroy was the away team, where was the venue?
|
CREATE TABLE table_name_47 (
venue VARCHAR,
away_team VARCHAR
)
|
SELECT venue FROM table_name_47 WHERE away_team = "fitzroy"
|
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 the match where fitzroy was the away team, where was the venue? ### Input: CREATE TABLE table_name_47 (
venue VARCHAR,
away_team VARCHAR
) ### Response: SELECT venue FROM table_name_47 WHERE away_team = "fitzroy"
|
What is the date of the U.S. Women's open?
|
CREATE TABLE table_name_61 (
date VARCHAR,
tournament VARCHAR
)
|
SELECT date FROM table_name_61 WHERE tournament = "u.s. women's open"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date of the U.S. Women's open? ### Input: CREATE TABLE table_name_61 (
date VARCHAR,
tournament VARCHAR
) ### Response: SELECT date FROM table_name_61 WHERE tournament = "u.s. women's open"
|
On what date was the format of ed remaster cd?
|
CREATE TABLE table_8573 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
|
SELECT "Date" FROM table_8573 WHERE "Format" = 'ed remaster cd'
|
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: On what date was the format of ed remaster cd? ### Input: CREATE TABLE table_8573 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) ### Response: SELECT "Date" FROM table_8573 WHERE "Format" = 'ed remaster cd'
|
What team was the opponent on October 15, 1967?
|
CREATE TABLE table_name_66 (
opponent VARCHAR,
date VARCHAR
)
|
SELECT opponent FROM table_name_66 WHERE date = "october 15, 1967"
|
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 team was the opponent on October 15, 1967? ### Input: CREATE TABLE table_name_66 (
opponent VARCHAR,
date VARCHAR
) ### Response: SELECT opponent FROM table_name_66 WHERE date = "october 15, 1967"
|
What is the largest amount of floors in the 70m (233ft) Tupper building (educational)?
|
CREATE TABLE table_name_11 (
floors INTEGER,
height VARCHAR,
building VARCHAR
)
|
SELECT MAX(floors) FROM table_name_11 WHERE height = "70m (233ft)" AND building = "tupper building (educational)"
|
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 largest amount of floors in the 70m (233ft) Tupper building (educational)? ### Input: CREATE TABLE table_name_11 (
floors INTEGER,
height VARCHAR,
building VARCHAR
) ### Response: SELECT MAX(floors) FROM table_name_11 WHERE height = "70m (233ft)" AND building = "tupper building (educational)"
|
history of cardiac arrest.
|
CREATE TABLE table_train_72 (
"id" int,
"extracorporeal_membrane_oxygenation_ecmo_cannulation" bool,
"heart_disease" bool,
"meningitis_or_encephalitis" bool,
"sepsis" bool,
"cancer" bool,
"prisoners" bool,
"NOUSE" float
)
|
SELECT * FROM table_train_72 WHERE prisoners = 1
|
criteria2sql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: history of cardiac arrest. ### Input: CREATE TABLE table_train_72 (
"id" int,
"extracorporeal_membrane_oxygenation_ecmo_cannulation" bool,
"heart_disease" bool,
"meningitis_or_encephalitis" bool,
"sepsis" bool,
"cancer" bool,
"prisoners" bool,
"NOUSE" float
) ### Response: SELECT * FROM table_train_72 WHERE prisoners = 1
|
which airliner attack on the list had the most dead ?
|
CREATE TABLE table_204_514 (
id number,
"date" text,
"sub" number,
"flight" text,
"dead" number,
"hurt" number,
"pax." number,
"type" text,
"perpetrator" text,
"description" text
)
|
SELECT "flight" FROM table_204_514 ORDER BY "dead" DESC LIMIT 1
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which airliner attack on the list had the most dead ? ### Input: CREATE TABLE table_204_514 (
id number,
"date" text,
"sub" number,
"flight" text,
"dead" number,
"hurt" number,
"pax." number,
"type" text,
"perpetrator" text,
"description" text
) ### Response: SELECT "flight" FROM table_204_514 ORDER BY "dead" DESC LIMIT 1
|
What was the total viewership for BBC One weekly rankings larger than 7, before episode 4?
|
CREATE TABLE table_name_30 (
total_viewers VARCHAR,
bbc_one_weekly_ranking VARCHAR,
episode_no VARCHAR
)
|
SELECT total_viewers FROM table_name_30 WHERE bbc_one_weekly_ranking > 7 AND episode_no < 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 was the total viewership for BBC One weekly rankings larger than 7, before episode 4? ### Input: CREATE TABLE table_name_30 (
total_viewers VARCHAR,
bbc_one_weekly_ranking VARCHAR,
episode_no VARCHAR
) ### Response: SELECT total_viewers FROM table_name_30 WHERE bbc_one_weekly_ranking > 7 AND episode_no < 4
|
What is the highest number of cuts made in a tournament with 0 wins and 0 top 5 placings?
|
CREATE TABLE table_14323 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
|
SELECT MAX("Cuts made") FROM table_14323 WHERE "Top-5" = '0' AND "Wins" < '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest number of cuts made in a tournament with 0 wins and 0 top 5 placings? ### Input: CREATE TABLE table_14323 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) ### Response: SELECT MAX("Cuts made") FROM table_14323 WHERE "Top-5" = '0' AND "Wins" < '0'
|
What event of this season had a time of 2:43?
|
CREATE TABLE table_name_36 (
event VARCHAR,
time VARCHAR
)
|
SELECT event FROM table_name_36 WHERE time = "2:43"
|
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 event of this season had a time of 2:43? ### Input: CREATE TABLE table_name_36 (
event VARCHAR,
time VARCHAR
) ### Response: SELECT event FROM table_name_36 WHERE time = "2:43"
|
Count of posts edited by two users.
|
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
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 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 PostTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE 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 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
|
SELECT Week, '22', '17163', '17702', '13438' FROM (SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) AS "week", c.UserId, COUNT(*) AS Count FROM Comments AS c WHERE c.UserId IN (22, 17163, 17702, 13438) AND YEAR(c.CreationDate) >= 2016 GROUP BY DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0), c.UserId) AS src PIVOT(MAX(Count) FOR UserId IN ('22', '17163', '17702', '13438')) AS piv ORDER BY 'week' 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: Count of posts edited by two users. ### Input: 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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
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 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 PostTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE 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 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
) ### Response: SELECT Week, '22', '17163', '17702', '13438' FROM (SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0) AS "week", c.UserId, COUNT(*) AS Count FROM Comments AS c WHERE c.UserId IN (22, 17163, 17702, 13438) AND YEAR(c.CreationDate) >= 2016 GROUP BY DATEADD(WEEK, DATEDIFF(WEEK, 0, CreationDate), 0), c.UserId) AS src PIVOT(MAX(Count) FOR UserId IN ('22', '17163', '17702', '13438')) AS piv ORDER BY 'week' DESC
|
What's the Total (kg) of a Snatch of 132.5?
|
CREATE TABLE table_name_86 (
total__kg_ VARCHAR,
snatch VARCHAR
)
|
SELECT total__kg_ FROM table_name_86 WHERE snatch = 132.5
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the Total (kg) of a Snatch of 132.5? ### Input: CREATE TABLE table_name_86 (
total__kg_ VARCHAR,
snatch VARCHAR
) ### Response: SELECT total__kg_ FROM table_name_86 WHERE snatch = 132.5
|
Which athlete performed before 1984 in an 800 m event?
|
CREATE TABLE table_51417 (
"Year" real,
"Event" text,
"Record" text,
"Athlete" text,
"Nationality" text
)
|
SELECT "Athlete" FROM table_51417 WHERE "Year" < '1984' AND "Event" = '800 m'
|
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 athlete performed before 1984 in an 800 m event? ### Input: CREATE TABLE table_51417 (
"Year" real,
"Event" text,
"Record" text,
"Athlete" text,
"Nationality" text
) ### Response: SELECT "Athlete" FROM table_51417 WHERE "Year" < '1984' AND "Event" = '800 m'
|
Who was the opponent in Game 44?
|
CREATE TABLE table_46153 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
|
SELECT "Opponent" FROM table_46153 WHERE "Game" = '44'
|
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 opponent in Game 44? ### Input: CREATE TABLE table_46153 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) ### Response: SELECT "Opponent" FROM table_46153 WHERE "Game" = '44'
|
How many silver when the team is northwest territories and gold is less than 34?
|
CREATE TABLE table_name_14 (
silver VARCHAR,
team VARCHAR,
gold VARCHAR
)
|
SELECT COUNT(silver) FROM table_name_14 WHERE team = "northwest territories" AND gold < 34
|
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 silver when the team is northwest territories and gold is less than 34? ### Input: CREATE TABLE table_name_14 (
silver VARCHAR,
team VARCHAR,
gold VARCHAR
) ### Response: SELECT COUNT(silver) FROM table_name_14 WHERE team = "northwest territories" AND gold < 34
|
Who is the opponent when the score was 6 4, 6 2 and the surface was clay?
|
CREATE TABLE table_name_94 (
opponent VARCHAR,
score VARCHAR,
surface VARCHAR
)
|
SELECT opponent FROM table_name_94 WHERE score = "6–4, 6–2" AND surface = "clay"
|
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 when the score was 6 4, 6 2 and the surface was clay? ### Input: CREATE TABLE table_name_94 (
opponent VARCHAR,
score VARCHAR,
surface VARCHAR
) ### Response: SELECT opponent FROM table_name_94 WHERE score = "6–4, 6–2" AND surface = "clay"
|
Can you tell me the Giant Slalom that has the Combined of 1, and the Country of united states, and the Victories larger than 11?
|
CREATE TABLE table_61339 (
"Women" text,
"Country" text,
"Season" text,
"Victories" real,
"Downhill" text,
"Super G" text,
"Giant Slalom" text,
"Slalom" text,
"Combined" text
)
|
SELECT "Giant Slalom" FROM table_61339 WHERE "Combined" = '1' AND "Country" = 'united states' AND "Victories" > '11'
|
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 Giant Slalom that has the Combined of 1, and the Country of united states, and the Victories larger than 11? ### Input: CREATE TABLE table_61339 (
"Women" text,
"Country" text,
"Season" text,
"Victories" real,
"Downhill" text,
"Super G" text,
"Giant Slalom" text,
"Slalom" text,
"Combined" text
) ### Response: SELECT "Giant Slalom" FROM table_61339 WHERE "Combined" = '1' AND "Country" = 'united states' AND "Victories" > '11'
|
List the total points of gymnasts in descending order of floor exercise points.
|
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
|
SELECT total_points FROM gymnast ORDER BY floor_exercise_points 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: List the total points of gymnasts in descending order of floor exercise points. ### Input: CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
) ### Response: SELECT total_points FROM gymnast ORDER BY floor_exercise_points DESC
|
What was the score of the game that home team birmingham city played?
|
CREATE TABLE table_60693 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
|
SELECT "Score" FROM table_60693 WHERE "Home team" = 'birmingham city'
|
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 of the game that home team birmingham city played? ### Input: CREATE TABLE table_60693 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) ### Response: SELECT "Score" FROM table_60693 WHERE "Home team" = 'birmingham city'
|
What is the comp when the ryds is 2?
|
CREATE TABLE table_40268 (
"Year" text,
"Team" text,
"Comp" text,
"Long" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"Lost" text
)
|
SELECT "Comp" FROM table_40268 WHERE "RYds" = '2'
|
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 comp when the ryds is 2? ### Input: CREATE TABLE table_40268 (
"Year" text,
"Team" text,
"Comp" text,
"Long" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"Lost" text
) ### Response: SELECT "Comp" FROM table_40268 WHERE "RYds" = '2'
|
Show the number of races that had any driver whose forename is Lewis in each year with a line chart, sort in ascending by the x-axis.
|
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE lapTimes (
raceId INTEGER,
driverId INTEGER,
lap INTEGER,
position INTEGER,
time TEXT,
milliseconds INTEGER
)
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGER
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE constructorResults (
constructorResultsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
status TEXT
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
grid INTEGER,
position TEXT,
positionText TEXT,
positionOrder INTEGER,
points REAL,
laps TEXT,
time TEXT,
milliseconds TEXT,
fastestLap TEXT,
rank TEXT,
fastestLapTime TEXT,
fastestLapSpeed TEXT,
statusId INTEGER
)
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
lng REAL,
alt TEXT,
url TEXT
)
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
|
SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY 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: Show the number of races that had any driver whose forename is Lewis in each year with a line chart, sort in ascending by the x-axis. ### Input: CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE lapTimes (
raceId INTEGER,
driverId INTEGER,
lap INTEGER,
position INTEGER,
time TEXT,
milliseconds INTEGER
)
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGER
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE constructorResults (
constructorResultsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
status TEXT
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
grid INTEGER,
position TEXT,
positionText TEXT,
positionOrder INTEGER,
points REAL,
laps TEXT,
time TEXT,
milliseconds TEXT,
fastestLap TEXT,
rank TEXT,
fastestLapTime TEXT,
fastestLapSpeed TEXT,
statusId INTEGER
)
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
lng REAL,
alt TEXT,
url TEXT
)
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
) ### Response: SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year
|
Name the week 3 for team of mark/jennifer
|
CREATE TABLE table_75057 (
"Team" text,
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8 Final" text
)
|
SELECT "Week 3" FROM table_75057 WHERE "Team" = 'mark/jennifer'
|
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 week 3 for team of mark/jennifer ### Input: CREATE TABLE table_75057 (
"Team" text,
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8 Final" text
) ### Response: SELECT "Week 3" FROM table_75057 WHERE "Team" = 'mark/jennifer'
|
how many votes did both the conservative party and the rainbow dream ticket party receive ?
|
CREATE TABLE table_202_271 (
id number,
"party" text,
"candidate" text,
"votes" number,
"%" number,
"\u00b1%" number
)
|
SELECT SUM("votes") FROM table_202_271 WHERE "party" IN ('conservative', 'rainbow dream ticket')
|
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 votes did both the conservative party and the rainbow dream ticket party receive ? ### Input: CREATE TABLE table_202_271 (
id number,
"party" text,
"candidate" text,
"votes" number,
"%" number,
"\u00b1%" number
) ### Response: SELECT SUM("votes") FROM table_202_271 WHERE "party" IN ('conservative', 'rainbow dream ticket')
|
Which courses in Advanced Portuguese satisfy the requirement for Core ?
|
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 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 offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
|
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Portuguese%' OR course.description LIKE '%Advanced Portuguese%' OR course.name LIKE '%Advanced Portuguese%') AND program_course.category LIKE '%Core%'
|
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: Which courses in Advanced Portuguese satisfy the requirement for Core ? ### Input: 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 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 offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Portuguese%' OR course.description LIKE '%Advanced Portuguese%' OR course.name LIKE '%Advanced Portuguese%') AND program_course.category LIKE '%Core%'
|
which boat was laid down on the same day as ha-202 ?
|
CREATE TABLE table_204_522 (
id number,
"boat #" text,
"name" text,
"builder" text,
"laid down" text,
"launched" text,
"completed" text,
"fate" text
)
|
SELECT "name" FROM table_204_522 WHERE "name" <> 'ha-202' AND "laid down" = (SELECT "laid down" FROM table_204_522 WHERE "name" = 'ha-202')
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which boat was laid down on the same day as ha-202 ? ### Input: CREATE TABLE table_204_522 (
id number,
"boat #" text,
"name" text,
"builder" text,
"laid down" text,
"launched" text,
"completed" text,
"fate" text
) ### Response: SELECT "name" FROM table_204_522 WHERE "name" <> 'ha-202' AND "laid down" = (SELECT "laid down" FROM table_204_522 WHERE "name" = 'ha-202')
|
how many airco dh .4 's did the uk use in their period of service ?
|
CREATE TABLE table_204_161 (
id number,
"name" text,
"1968 cf\ndesignator" text,
"place of\nmanufacture" text,
"primary\nrole(s)" text,
"service\nperiod" text,
"#\nused" number
)
|
SELECT "#\nused" FROM table_204_161 WHERE "name" = 'airco dh.4'
|
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 airco dh .4 's did the uk use in their period of service ? ### Input: CREATE TABLE table_204_161 (
id number,
"name" text,
"1968 cf\ndesignator" text,
"place of\nmanufacture" text,
"primary\nrole(s)" text,
"service\nperiod" text,
"#\nused" number
) ### Response: SELECT "#\nused" FROM table_204_161 WHERE "name" = 'airco dh.4'
|
Name the total number for sub parish sokn for 1865
|
CREATE TABLE table_1776 (
"Parish ( Prestegjeld )" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
)
|
SELECT COUNT("Sub-Parish (Sokn)") FROM table_1776 WHERE "Year Built" = '1865'
|
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 total number for sub parish sokn for 1865 ### Input: CREATE TABLE table_1776 (
"Parish ( Prestegjeld )" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
) ### Response: SELECT COUNT("Sub-Parish (Sokn)") FROM table_1776 WHERE "Year Built" = '1865'
|
What day was the opposing team Australia and the against 25?
|
CREATE TABLE table_name_77 (
date VARCHAR,
against VARCHAR,
opposing_teams VARCHAR
)
|
SELECT date FROM table_name_77 WHERE against = 25 AND opposing_teams = "australia"
|
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 day was the opposing team Australia and the against 25? ### Input: CREATE TABLE table_name_77 (
date VARCHAR,
against VARCHAR,
opposing_teams VARCHAR
) ### Response: SELECT date FROM table_name_77 WHERE against = 25 AND opposing_teams = "australia"
|
What was the record on Feb 25?
|
CREATE TABLE table_name_83 (
record VARCHAR,
date VARCHAR
)
|
SELECT record FROM table_name_83 WHERE date = "feb 25"
|
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 record on Feb 25? ### Input: CREATE TABLE table_name_83 (
record VARCHAR,
date VARCHAR
) ### Response: SELECT record FROM table_name_83 WHERE date = "feb 25"
|
Who was the away team when Hawthorn was the home team?
|
CREATE TABLE table_33069 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
|
SELECT "Away team score" FROM table_33069 WHERE "Home team" = 'hawthorn'
|
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 away team when Hawthorn was the home team? ### Input: CREATE TABLE table_33069 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Away team score" FROM table_33069 WHERE "Home team" = 'hawthorn'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.