instruction
stringlengths
8
460
input
stringlengths
37
7.14k
output
stringlengths
9
2.37k
text
stringlengths
302
7.71k
What team lost on May 1?
CREATE TABLE table_name_62 ( loss VARCHAR, date VARCHAR )
SELECT loss FROM table_name_62 WHERE date = "may 1"
Below are sql tables 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 lost on May 1? ### Input: CREATE TABLE table_name_62 ( loss VARCHAR, date VARCHAR ) ### Response: SELECT loss FROM table_name_62 WHERE date = "may 1"
Which 2007 08 season has a Club of genoa c.f.c.?
CREATE TABLE table_46794 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text )
SELECT "2007\u201308 season" FROM table_46794 WHERE "Club" = 'genoa c.f.c.'
Below are sql tables 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 2007 08 season has a Club of genoa c.f.c.? ### Input: CREATE TABLE table_46794 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text ) ### Response: SELECT "2007\u201308 season" FROM table_46794 WHERE "Club" = 'genoa c.f.c.'
what was the last time patient 54825 received a prescription for aspirin ec, in 12/last year?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND prescriptions.drug = 'aspirin ec' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '12' ORDER BY prescriptions.startdate DESC LIMIT 1
Below are sql tables 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 last time patient 54825 received a prescription for aspirin ec, in 12/last year? ### Input: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ### Response: SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND prescriptions.drug = 'aspirin ec' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '12' ORDER BY prescriptions.startdate DESC LIMIT 1
Return a bar chart about the distribution of meter_500 and ID .
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int )
SELECT meter_500, ID FROM swimmer
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of meter_500 and ID . ### Input: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) ### Response: SELECT meter_500, ID FROM swimmer
Labs are in what number of upper level courses ?
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 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 program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course ( 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 ta ( campus_job_id int, student_id int, location varchar )
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Labs are in what number of upper level courses ? ### Input: 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 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 program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course ( 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 ta ( campus_job_id int, student_id int, location varchar ) ### Response: SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
How many loses corresponded to giving up 714 points?
CREATE TABLE table_12792876_2 ( lost VARCHAR, points_against VARCHAR )
SELECT lost FROM table_12792876_2 WHERE points_against = "714"
Below are sql tables 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 loses corresponded to giving up 714 points? ### Input: CREATE TABLE table_12792876_2 ( lost VARCHAR, points_against VARCHAR ) ### Response: SELECT lost FROM table_12792876_2 WHERE points_against = "714"
A line chart shows how many churches open each year?, I want to sort by the X-axis from low to high.
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text )
SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date ORDER BY Open_Date
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A line chart shows how many churches open each year?, I want to sort by the X-axis from low to high. ### Input: CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) ### Response: SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date ORDER BY Open_Date
TOTAL number of SUCCESSFUL questions.
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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
SELECT COUNT(DISTINCT p.Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: TOTAL number of SUCCESSFUL questions. ### Input: 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) ### Response: SELECT COUNT(DISTINCT p.Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL
calculate patient 027-107035's length of stay of the first hospital stay.
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '027-107035' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate patient 027-107035's length of stay of the first hospital stay. ### Input: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) ### Response: SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '027-107035' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
What is L2 Cache, when Model Number is Atom Z625?
CREATE TABLE table_51065 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Socket" text, "Release date" text, "Part number(s)" text )
SELECT "L2 cache" FROM table_51065 WHERE "Model number" = 'atom z625'
Below are sql tables 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 L2 Cache, when Model Number is Atom Z625? ### Input: CREATE TABLE table_51065 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Socket" text, "Release date" text, "Part number(s)" text ) ### Response: SELECT "L2 cache" FROM table_51065 WHERE "Model number" = 'atom z625'
Amazon web service thread volume, page views, unique OPs by month.
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskResultTypes ( 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<amazon-web-services>%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_STR(P.CreationDate, '%-mONT%-H') ORDER BY 'year', Month
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Amazon web service thread volume, page views, unique OPs by month. ### Input: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskResultTypes ( 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) ### Response: SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<amazon-web-services>%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_STR(P.CreationDate, '%-mONT%-H') ORDER BY 'year', Month
Show the number of documents created in each day and bin document date by weekday with a bar chart.
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) )
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code
Below are sql tables 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 documents created in each day and bin document date by weekday with a bar chart. ### Input: CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) ### Response: SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code
from DENVER to PITTSBURGH on 4 21 i need the cheapest flight
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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((((CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'PITTSBURGH' AND DATE_DAY_1.day_number = 21 AND DATE_DAY_1.month_number = 4 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND fare_basis.basis_days = DAYS_1.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND fare.to_airport = AIRPORT_SERVICE_3.airport_code) AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DENVER' AND fare.from_airport = AIRPORT_SERVICE_2.airport_code) AND DATE_DAY_0.day_number = 21 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias4, airport_service AS AIRPORT_SERVICEalias5, city AS CITYalias4, city AS CITYalias5, date_day AS DATE_DAYalias2, days AS DAYSalias2, fare AS FAREalias1, fare_basis AS FARE_BASISalias1 WHERE (CITYalias5.city_code = AIRPORT_SERVICEalias5.city_code AND CITYalias5.city_name = 'PITTSBURGH' AND DATE_DAYalias2.day_number = 21 AND DATE_DAYalias2.month_number = 4 AND DATE_DAYalias2.year = 1991 AND DAYSalias2.day_name = DATE_DAYalias2.day_name AND FARE_BASISalias1.basis_days = DAYSalias2.days_code AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FAREalias1.to_airport = AIRPORT_SERVICEalias5.airport_code) AND CITYalias4.city_code = AIRPORT_SERVICEalias4.city_code AND CITYalias4.city_name = 'DENVER' AND FAREalias1.from_airport = AIRPORT_SERVICEalias4.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_days = DAYS_0.days_code AND flight.flight_id = flight_fare.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: from DENVER to PITTSBURGH on 4 21 i need the cheapest flight ### 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((((CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'PITTSBURGH' AND DATE_DAY_1.day_number = 21 AND DATE_DAY_1.month_number = 4 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND fare_basis.basis_days = DAYS_1.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND fare.to_airport = AIRPORT_SERVICE_3.airport_code) AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DENVER' AND fare.from_airport = AIRPORT_SERVICE_2.airport_code) AND DATE_DAY_0.day_number = 21 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias4, airport_service AS AIRPORT_SERVICEalias5, city AS CITYalias4, city AS CITYalias5, date_day AS DATE_DAYalias2, days AS DAYSalias2, fare AS FAREalias1, fare_basis AS FARE_BASISalias1 WHERE (CITYalias5.city_code = AIRPORT_SERVICEalias5.city_code AND CITYalias5.city_name = 'PITTSBURGH' AND DATE_DAYalias2.day_number = 21 AND DATE_DAYalias2.month_number = 4 AND DATE_DAYalias2.year = 1991 AND DAYSalias2.day_name = DATE_DAYalias2.day_name AND FARE_BASISalias1.basis_days = DAYSalias2.days_code AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FAREalias1.to_airport = AIRPORT_SERVICEalias5.airport_code) AND CITYalias4.city_code = AIRPORT_SERVICEalias4.city_code AND CITYalias4.city_name = 'DENVER' AND FAREalias1.from_airport = AIRPORT_SERVICEalias4.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_days = DAYS_0.days_code AND flight.flight_id = flight_fare.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
what is the number of individuals in this group who were indian ?
CREATE TABLE table_204_698 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text )
SELECT COUNT(*) FROM table_204_698 WHERE "nationality" = 'indian'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of individuals in this group who were indian ? ### Input: CREATE TABLE table_204_698 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) ### Response: SELECT COUNT(*) FROM table_204_698 WHERE "nationality" = 'indian'
What is the earliest year a Baylor player made the list?
CREATE TABLE table_55462 ( "Year" real, "Player" text, "Position" text, "College/Country" text, "WNBA Team" text )
SELECT MIN("Year") FROM table_55462 WHERE "College/Country" = 'baylor'
Below are sql tables 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 earliest year a Baylor player made the list? ### Input: CREATE TABLE table_55462 ( "Year" real, "Player" text, "Position" text, "College/Country" text, "WNBA Team" text ) ### Response: SELECT MIN("Year") FROM table_55462 WHERE "College/Country" = 'baylor'
When tajik is the ethnicity what is islam?
CREATE TABLE table_20936 ( "Ethnicity" text, "Islam" text, "Christianity" text, "Judaism" text, "Buddhism" text, "Other" text, "Atheism" text, "n/a" text )
SELECT "Islam" FROM table_20936 WHERE "Ethnicity" = 'Tajik'
Below are sql tables 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 tajik is the ethnicity what is islam? ### Input: CREATE TABLE table_20936 ( "Ethnicity" text, "Islam" text, "Christianity" text, "Judaism" text, "Buddhism" text, "Other" text, "Atheism" text, "n/a" text ) ### Response: SELECT "Islam" FROM table_20936 WHERE "Ethnicity" = 'Tajik'
What was the result of Game 3 of this searson?
CREATE TABLE table_name_95 ( result VARCHAR, game VARCHAR )
SELECT result FROM table_name_95 WHERE game = "game 3"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of Game 3 of this searson? ### Input: CREATE TABLE table_name_95 ( result VARCHAR, game VARCHAR ) ### Response: SELECT result FROM table_name_95 WHERE game = "game 3"
Which record has a score of 7 6 (12)?
CREATE TABLE table_53206 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Record" FROM table_53206 WHERE "Score" = '7–6 (12)'
Below are sql tables 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 record has a score of 7 6 (12)? ### Input: CREATE TABLE table_53206 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) ### Response: SELECT "Record" FROM table_53206 WHERE "Score" = '7–6 (12)'
What is the highest value in Waggamba were Inglewwod had 2,771, but Goondiwindi had less than 4,374?
CREATE TABLE table_68822 ( "Year" real, "Region total" real, "Goondiwindi" real, "Waggamba" real, "Inglewood" real )
SELECT MAX("Waggamba") FROM table_68822 WHERE "Inglewood" = '2,771' AND "Goondiwindi" < '4,374'
Below are sql tables 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 value in Waggamba were Inglewwod had 2,771, but Goondiwindi had less than 4,374? ### Input: CREATE TABLE table_68822 ( "Year" real, "Region total" real, "Goondiwindi" real, "Waggamba" real, "Inglewood" real ) ### Response: SELECT MAX("Waggamba") FROM table_68822 WHERE "Inglewood" = '2,771' AND "Goondiwindi" < '4,374'
What's the Hangul/Japanese of Boys Over Flowers that's drama?
CREATE TABLE table_64508 ( "Year" real, "Title" text, "Hangul / Japanese" text, "Role" text, "Network" text, "Genre" text )
SELECT "Hangul / Japanese" FROM table_64508 WHERE "Genre" = 'drama' AND "Title" = 'boys over flowers'
Below are sql tables 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 Hangul/Japanese of Boys Over Flowers that's drama? ### Input: CREATE TABLE table_64508 ( "Year" real, "Title" text, "Hangul / Japanese" text, "Role" text, "Network" text, "Genre" text ) ### Response: SELECT "Hangul / Japanese" FROM table_64508 WHERE "Genre" = 'drama' AND "Title" = 'boys over flowers'
Name the fastest lap for round 3
CREATE TABLE table_27536 ( "Round" text, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text )
SELECT "Fastest Lap" FROM table_27536 WHERE "Round" = '3'
Below are sql tables 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 fastest lap for round 3 ### Input: CREATE TABLE table_27536 ( "Round" text, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text ) ### Response: SELECT "Fastest Lap" FROM table_27536 WHERE "Round" = '3'
how much cost is it to perform methemoglobin lab tests?
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
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 = 'methemoglobin'))
Below are sql tables 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 cost is it to perform methemoglobin lab tests? ### Input: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) ### 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 = 'methemoglobin'))
Sandboxed posts that have a positive score and no activity for a month.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE 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 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text )
SELECT Id AS "post_link" FROM Posts WHERE ParentId = 2140 AND LastActivityDate < DATEADD(MONTH, -1, GETDATE()) AND Score > 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Sandboxed posts that have a positive score and no activity for a month. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE 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 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) ### Response: SELECT Id AS "post_link" FROM Posts WHERE ParentId = 2140 AND LastActivityDate < DATEADD(MONTH, -1, GETDATE()) AND Score > 1
Number of questions tagged with Jetbrains.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
SELECT TagName AS Tag, Count FROM Tags WHERE TagName LIKE '%fhir%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of questions tagged with Jetbrains. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) ### Response: SELECT TagName AS Tag, Count FROM Tags WHERE TagName LIKE '%fhir%'
Which Grid has a Time of +13.999?
CREATE TABLE table_8762 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
SELECT MIN("Grid") FROM table_8762 WHERE "Time" = '+13.999'
Below are sql tables 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 Grid has a Time of +13.999? ### Input: CREATE TABLE table_8762 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) ### Response: SELECT MIN("Grid") FROM table_8762 WHERE "Time" = '+13.999'
What event did he have a 2-0 record?
CREATE TABLE table_6120 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
SELECT "Event" FROM table_6120 WHERE "Record" = '2-0'
Below are sql tables 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 did he have a 2-0 record? ### Input: CREATE TABLE table_6120 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) ### Response: SELECT "Event" FROM table_6120 WHERE "Record" = '2-0'
When was the race that set the record for the Izod Indycar Series?
CREATE TABLE table_name_47 ( date VARCHAR, record VARCHAR )
SELECT date FROM table_name_47 WHERE record = "izod indycar series"
Below are sql tables 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 race that set the record for the Izod Indycar Series? ### Input: CREATE TABLE table_name_47 ( date VARCHAR, record VARCHAR ) ### Response: SELECT date FROM table_name_47 WHERE record = "izod indycar series"
What day did St Kilda play as the away team?
CREATE TABLE table_name_53 ( date VARCHAR, away_team VARCHAR )
SELECT date FROM table_name_53 WHERE away_team = "st kilda"
Below are sql tables 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 did St Kilda play as the away team? ### Input: CREATE TABLE table_name_53 ( date VARCHAR, away_team VARCHAR ) ### Response: SELECT date FROM table_name_53 WHERE away_team = "st kilda"
Search my comments by text.
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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( 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 VoteTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
SELECT PostId AS "post_link", Text, Score FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%##Search##%' ORDER BY CreationDate DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Search my comments by text. ### Input: 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( 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 VoteTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) ### Response: SELECT PostId AS "post_link", Text, Score FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%##Search##%' ORDER BY CreationDate DESC
What is the Distance Medell n Downtown (km) when the municipalities Envigado?
CREATE TABLE table_name_86 ( distance_medellín_downtown___km__ VARCHAR, municipalities VARCHAR )
SELECT distance_medellín_downtown___km__ FROM table_name_86 WHERE municipalities = "envigado"
Below are sql tables 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 Distance Medell n Downtown (km) when the municipalities Envigado? ### Input: CREATE TABLE table_name_86 ( distance_medellín_downtown___km__ VARCHAR, municipalities VARCHAR ) ### Response: SELECT distance_medellín_downtown___km__ FROM table_name_86 WHERE municipalities = "envigado"
Which district did Ralph Harvey (r) vacated when he resigned?
CREATE TABLE table_22354 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
SELECT "District" FROM table_22354 WHERE "Vacator" = 'Ralph Harvey (R)'
Below are sql tables 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 district did Ralph Harvey (r) vacated when he resigned? ### Input: CREATE TABLE table_22354 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) ### Response: SELECT "District" FROM table_22354 WHERE "Vacator" = 'Ralph Harvey (R)'
how many patients have received venous cath nec within 2 months after the first procedure of insert spinal canal cath this year?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert spinal canal cath') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have received venous cath nec within 2 months after the first procedure of insert spinal canal cath this year? ### Input: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert spinal canal cath') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month')
What is listed for the Main Location(s) that has a % of National of 2.05%?
CREATE TABLE table_5617 ( "Crop" text, "Area" text, "Output (2007)" text, "% of national" text, "Main location(s)" text )
SELECT "Main location(s)" FROM table_5617 WHERE "% of national" = '2.05%'
Below are sql tables 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 listed for the Main Location(s) that has a % of National of 2.05%? ### Input: CREATE TABLE table_5617 ( "Crop" text, "Area" text, "Output (2007)" text, "% of national" text, "Main location(s)" text ) ### Response: SELECT "Main location(s)" FROM table_5617 WHERE "% of national" = '2.05%'
Name the pursuit for 1994 lillehammer
CREATE TABLE table_name_43 ( pursuit VARCHAR, event VARCHAR )
SELECT pursuit FROM table_name_43 WHERE event = "1994 lillehammer"
Below are sql tables 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 pursuit for 1994 lillehammer ### Input: CREATE TABLE table_name_43 ( pursuit VARCHAR, event VARCHAR ) ### Response: SELECT pursuit FROM table_name_43 WHERE event = "1994 lillehammer"
On how many different dates did schools from Chestnut Hill, Massachusetts join the conference?
CREATE TABLE table_1973842_1 ( joined VARCHAR, location VARCHAR )
SELECT COUNT(joined) FROM table_1973842_1 WHERE location = "Chestnut Hill, Massachusetts"
Below are sql tables 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 how many different dates did schools from Chestnut Hill, Massachusetts join the conference? ### Input: CREATE TABLE table_1973842_1 ( joined VARCHAR, location VARCHAR ) ### Response: SELECT COUNT(joined) FROM table_1973842_1 WHERE location = "Chestnut Hill, Massachusetts"
Who was the opponent of the game on August 8?
CREATE TABLE table_70969 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Opponent" FROM table_70969 WHERE "Date" = 'august 8'
Below are sql tables 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 of the game on August 8? ### Input: CREATE TABLE table_70969 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) ### Response: SELECT "Opponent" FROM table_70969 WHERE "Date" = 'august 8'
What was the venue that featured the Melbourne Tigers as the away team?
CREATE TABLE table_44267 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
SELECT "Venue" FROM table_44267 WHERE "Away team" = 'melbourne tigers'
Below are sql tables 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 venue that featured the Melbourne Tigers as the away team? ### Input: CREATE TABLE table_44267 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text ) ### Response: SELECT "Venue" FROM table_44267 WHERE "Away team" = 'melbourne tigers'
what was the total output patient 2238 had received on 04/12/2104?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238)) AND STRFTIME('%y-%m-%d', outputevents.charttime) = '2104-04-12'
Below are sql tables 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 output patient 2238 had received on 04/12/2104? ### Input: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Response: SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238)) AND STRFTIME('%y-%m-%d', outputevents.charttime) = '2104-04-12'
How many Points have a January of 18?
CREATE TABLE table_75363 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT COUNT("Points") FROM table_75363 WHERE "January" = '18'
Below are sql tables 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 Points have a January of 18? ### Input: CREATE TABLE table_75363 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) ### Response: SELECT COUNT("Points") FROM table_75363 WHERE "January" = '18'
What year was the team named the Raiders established?
CREATE TABLE table_16078390_2 ( founded INTEGER, team_nickname VARCHAR )
SELECT MAX(founded) FROM table_16078390_2 WHERE team_nickname = "Raiders"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the team named the Raiders established? ### Input: CREATE TABLE table_16078390_2 ( founded INTEGER, team_nickname VARCHAR ) ### Response: SELECT MAX(founded) FROM table_16078390_2 WHERE team_nickname = "Raiders"
Which Red Cards has a Season of 1998/1999, and a Games larger than 41?
CREATE TABLE table_name_55 ( red_cards INTEGER, season VARCHAR, games VARCHAR )
SELECT MIN(red_cards) FROM table_name_55 WHERE season = "1998/1999" AND games > 41
Below are sql tables 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 Red Cards has a Season of 1998/1999, and a Games larger than 41? ### Input: CREATE TABLE table_name_55 ( red_cards INTEGER, season VARCHAR, games VARCHAR ) ### Response: SELECT MIN(red_cards) FROM table_name_55 WHERE season = "1998/1999" AND games > 41
Tell me the position in 2012-13 and number of seasons in leigue 1 of 30 with ligue 1 titles of 1
CREATE TABLE table_58207 ( "Club" text, "Position in 2012\u201313" text, "First season in top division" text, "Number of seasons in Ligue 1" real, "First season of current spell in top division" text, "Ligue 1 titles" real, "Last Ligue 1 title" text )
SELECT "Position in 2012\u201313" FROM table_58207 WHERE "Number of seasons in Ligue 1" = '30' AND "Ligue 1 titles" = '1'
Below are sql tables 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 position in 2012-13 and number of seasons in leigue 1 of 30 with ligue 1 titles of 1 ### Input: CREATE TABLE table_58207 ( "Club" text, "Position in 2012\u201313" text, "First season in top division" text, "Number of seasons in Ligue 1" real, "First season of current spell in top division" text, "Ligue 1 titles" real, "Last Ligue 1 title" text ) ### Response: SELECT "Position in 2012\u201313" FROM table_58207 WHERE "Number of seasons in Ligue 1" = '30' AND "Ligue 1 titles" = '1'
Name the total number of material collected for justice league of america by george p rez, vol. 2
CREATE TABLE table_2073 ( "#" real, "Volume line" text, "Volume title" text, "Creators" text, "Material collected" text, "Publication date" text, "ISBN" text )
SELECT COUNT("Material collected") FROM table_2073 WHERE "Volume title" = 'Justice League of America by George Pérez, Vol. 2'
Below are sql tables 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 material collected for justice league of america by george p rez, vol. 2 ### Input: CREATE TABLE table_2073 ( "#" real, "Volume line" text, "Volume title" text, "Creators" text, "Material collected" text, "Publication date" text, "ISBN" text ) ### Response: SELECT COUNT("Material collected") FROM table_2073 WHERE "Volume title" = 'Justice League of America by George Pérez, Vol. 2'
What is the lowest rank for Spain when more than 10 medals were won, 3 of which were bronze?
CREATE TABLE table_69558 ( "Games" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real, "Rank" real )
SELECT MIN("Rank") FROM table_69558 WHERE "Bronze" = '3' AND "Total" > '10'
Below are sql tables 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 rank for Spain when more than 10 medals were won, 3 of which were bronze? ### Input: CREATE TABLE table_69558 ( "Games" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real, "Rank" real ) ### Response: SELECT MIN("Rank") FROM table_69558 WHERE "Bronze" = '3' AND "Total" > '10'
What model has a g green rating, has chrysler jeep as a manufacturer, has an l/100km urban (cold) less than 18, and has an mpg-uk combined of 27.7?
CREATE TABLE table_name_6 ( model VARCHAR, mpg_uk_combined VARCHAR, l_100km_urban__cold_ VARCHAR, green_rating VARCHAR, manufacturer VARCHAR )
SELECT model FROM table_name_6 WHERE green_rating = "g" AND manufacturer = "chrysler jeep" AND l_100km_urban__cold_ < 18 AND mpg_uk_combined = 27.7
Below are sql tables 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 model has a g green rating, has chrysler jeep as a manufacturer, has an l/100km urban (cold) less than 18, and has an mpg-uk combined of 27.7? ### Input: CREATE TABLE table_name_6 ( model VARCHAR, mpg_uk_combined VARCHAR, l_100km_urban__cold_ VARCHAR, green_rating VARCHAR, manufacturer VARCHAR ) ### Response: SELECT model FROM table_name_6 WHERE green_rating = "g" AND manufacturer = "chrysler jeep" AND l_100km_urban__cold_ < 18 AND mpg_uk_combined = 27.7
For how many days did patient with id 18112 stay in the hospital?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "18112"
Below are sql tables 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 how many days did patient with id 18112 stay in the hospital? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Response: SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "18112"
among patients who were prescribed methadone pca after they had been diagnosed with cerebral edema show me the four year survival rate.
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE 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 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cerebral edema') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 4 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'methadone pca') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients who were prescribed methadone pca after they had been diagnosed with cerebral edema show me the four year survival rate. ### Input: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE 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 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) ### Response: SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cerebral edema') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 4 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'methadone pca') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id
Which Height has a Position of c, and a Player of yiannis bourousis?
CREATE TABLE table_name_50 ( height INTEGER, position VARCHAR, player VARCHAR )
SELECT SUM(height) FROM table_name_50 WHERE position = "c" AND player = "yiannis bourousis"
Below are sql tables 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 Height has a Position of c, and a Player of yiannis bourousis? ### Input: CREATE TABLE table_name_50 ( height INTEGER, position VARCHAR, player VARCHAR ) ### Response: SELECT SUM(height) FROM table_name_50 WHERE position = "c" AND player = "yiannis bourousis"
OAKLAND to SAN FRANCISCO please BREAKFAST flight
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_fare ( flight_id int, fare_id 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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_interval ( period text, begin_time int, end_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 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 )
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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'BREAKFAST') AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: OAKLAND to SAN FRANCISCO please BREAKFAST flight ### Input: 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_fare ( flight_id int, fare_id 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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_interval ( period text, begin_time int, end_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 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 ) ### 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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'BREAKFAST') AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
What is the broadcast date of the episode with run time 25:12?
CREATE TABLE table_1785117_1 ( broadcast_date VARCHAR, run_time VARCHAR )
SELECT broadcast_date FROM table_1785117_1 WHERE run_time = "25:12"
Below are sql tables 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 broadcast date of the episode with run time 25:12? ### Input: CREATE TABLE table_1785117_1 ( broadcast_date VARCHAR, run_time VARCHAR ) ### Response: SELECT broadcast_date FROM table_1785117_1 WHERE run_time = "25:12"
what is the venue when the home team is melbourne?
CREATE TABLE table_52259 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
SELECT "Venue" FROM table_52259 WHERE "Home team" = 'melbourne'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the venue when the home team is melbourne? ### Input: CREATE TABLE table_52259 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) ### Response: SELECT "Venue" FROM table_52259 WHERE "Home team" = 'melbourne'
Visualize the total smallest rating of different movie title using a bar chart, rank by the x-axis in desc.
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the total smallest rating of different movie title using a bar chart, rank by the x-axis in desc. ### Input: CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) ### Response: SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC
What is the document type name and the document type description and creation date for all the documents?
CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE projects ( project_id number, project_details text ) CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE statements ( statement_id number, statement_details text )
SELECT T1.document_type_name, T1.document_type_description, T2.document_date FROM ref_document_types AS T1 JOIN documents AS T2 ON T1.document_type_code = T2.document_type_code
Below are sql tables 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 document type name and the document type description and creation date for all the documents? ### Input: CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE ref_budget_codes ( budget_type_code text, budget_type_description text ) CREATE TABLE projects ( project_id number, project_details text ) CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE statements ( statement_id number, statement_details text ) ### Response: SELECT T1.document_type_name, T1.document_type_description, T2.document_date FROM ref_document_types AS T1 JOIN documents AS T2 ON T1.document_type_code = T2.document_type_code
What is the constructor on the team with 8 rounds and a chassis of 156 158 1512?
CREATE TABLE table_name_54 ( constructor VARCHAR, rounds VARCHAR, chassis VARCHAR )
SELECT constructor FROM table_name_54 WHERE rounds = "8" AND chassis = "156 158 1512"
Below are sql tables 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 constructor on the team with 8 rounds and a chassis of 156 158 1512? ### Input: CREATE TABLE table_name_54 ( constructor VARCHAR, rounds VARCHAR, chassis VARCHAR ) ### Response: SELECT constructor FROM table_name_54 WHERE rounds = "8" AND chassis = "156 158 1512"
who was the only athlete to throw more than 18 meters ?
CREATE TABLE table_203_865 ( id number, "place" number, "athlete" text, "nation" text, "best mark" text, "throw 1" number, "throw 2" number, "throw 3" number, "throw 4" number, "throw 5" number, "throw 6" number )
SELECT "athlete" FROM table_203_865 WHERE "best mark" > 18
Below are sql tables 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 only athlete to throw more than 18 meters ? ### Input: CREATE TABLE table_203_865 ( id number, "place" number, "athlete" text, "nation" text, "best mark" text, "throw 1" number, "throw 2" number, "throw 3" number, "throw 4" number, "throw 5" number, "throw 6" number ) ### Response: SELECT "athlete" FROM table_203_865 WHERE "best mark" > 18
Name the party for hutchins g. burton
CREATE TABLE table_2668329_18 ( party VARCHAR, incumbent VARCHAR )
SELECT party FROM table_2668329_18 WHERE incumbent = "Hutchins G. Burton"
Below are sql tables 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 party for hutchins g. burton ### Input: CREATE TABLE table_2668329_18 ( party VARCHAR, incumbent VARCHAR ) ### Response: SELECT party FROM table_2668329_18 WHERE incumbent = "Hutchins G. Burton"
What's the total against when the draws are more than 0?
CREATE TABLE table_64363 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
SELECT COUNT("Against") FROM table_64363 WHERE "Draws" > '0'
Below are sql tables 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 against when the draws are more than 0? ### Input: CREATE TABLE table_64363 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real ) ### Response: SELECT COUNT("Against") FROM table_64363 WHERE "Draws" > '0'
what are the five year survival rate of fetal/neonatal jaund nos patients who were prescribed with morphine sulfate?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label 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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fetal/neonatal jaund nos') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 5 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'morphine sulfate') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id
Below are sql tables 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 five year survival rate of fetal/neonatal jaund nos patients who were prescribed with morphine sulfate? ### Input: CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label 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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Response: SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fetal/neonatal jaund nos') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 5 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'morphine sulfate') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id
Show all the planned delivery dates and bin by year in a line chart, could you rank by the x-axis in ascending please?
CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers_in_Bookings ( Order_ID INTEGER, Performer_ID INTEGER ) CREATE TABLE Clients ( Client_ID INTEGER, Address_ID INTEGER, Customer_Email_Address VARCHAR(255), Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Bookings ( Booking_ID INTEGER, Customer_ID INTEGER, Workshop_Group_ID VARCHAR(100), Status_Code CHAR(15), Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR(255), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Ref_Payment_Methods ( payment_method_code CHAR(10), payment_method_description VARCHAR(80) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_Description VARCHAR(255) ) CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) )
SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the planned delivery dates and bin by year in a line chart, could you rank by the x-axis in ascending please? ### Input: CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers_in_Bookings ( Order_ID INTEGER, Performer_ID INTEGER ) CREATE TABLE Clients ( Client_ID INTEGER, Address_ID INTEGER, Customer_Email_Address VARCHAR(255), Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Bookings ( Booking_ID INTEGER, Customer_ID INTEGER, Workshop_Group_ID VARCHAR(100), Status_Code CHAR(15), Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR(255), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Ref_Payment_Methods ( payment_method_code CHAR(10), payment_method_description VARCHAR(80) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_Description VARCHAR(255) ) CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) ) ### Response: SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date
What is the total number of spectators on week 4?
CREATE TABLE table_44622 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT COUNT("Attendance") FROM table_44622 WHERE "Week" = '4'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of spectators on week 4? ### Input: CREATE TABLE table_44622 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) ### Response: SELECT COUNT("Attendance") FROM table_44622 WHERE "Week" = '4'
When 2012 (85th) is the year (ceremony) how many results?
CREATE TABLE table_26555737_1 ( result VARCHAR, year__ceremony_ VARCHAR )
SELECT COUNT(result) FROM table_26555737_1 WHERE year__ceremony_ = "2012 (85th)"
Below are sql tables 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 2012 (85th) is the year (ceremony) how many results? ### Input: CREATE TABLE table_26555737_1 ( result VARCHAR, year__ceremony_ VARCHAR ) ### Response: SELECT COUNT(result) FROM table_26555737_1 WHERE year__ceremony_ = "2012 (85th)"
TOP 200 - Brazilian Users.
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE 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 PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) 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 )
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%brazil%' OR UPPER(Location) LIKE '%BRA' ORDER BY Reputation DESC LIMIT 200
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: TOP 200 - Brazilian Users. ### Input: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE 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 PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) 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 ) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%brazil%' OR UPPER(Location) LIKE '%BRA' ORDER BY Reputation DESC LIMIT 200
What championships were played on clay and the opponent was virginia ruano pascual paola su rez?
CREATE TABLE table_24638867_4 ( championship VARCHAR, surface VARCHAR, opponent VARCHAR )
SELECT championship FROM table_24638867_4 WHERE surface = "Clay" AND opponent = "Virginia Ruano Pascual Paola Suárez"
Below are sql tables 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 championships were played on clay and the opponent was virginia ruano pascual paola su rez? ### Input: CREATE TABLE table_24638867_4 ( championship VARCHAR, surface VARCHAR, opponent VARCHAR ) ### Response: SELECT championship FROM table_24638867_4 WHERE surface = "Clay" AND opponent = "Virginia Ruano Pascual Paola Suárez"
Which method has a record of 4-0?
CREATE TABLE table_name_83 ( method VARCHAR, record VARCHAR )
SELECT method FROM table_name_83 WHERE record = "4-0"
Below are sql tables 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 method has a record of 4-0? ### Input: CREATE TABLE table_name_83 ( method VARCHAR, record VARCHAR ) ### Response: SELECT method FROM table_name_83 WHERE record = "4-0"
What date has a Position of back, later than 1964, and a Test debut of 1st rl test v new zealand?
CREATE TABLE table_65602 ( "Player" text, "Test debut" text, "Year" real, "Cross-code debut" text, "Date" text, "Position" text )
SELECT "Date" FROM table_65602 WHERE "Position" = 'back' AND "Year" > '1964' AND "Test debut" = '1st rl test v new zealand'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date has a Position of back, later than 1964, and a Test debut of 1st rl test v new zealand? ### Input: CREATE TABLE table_65602 ( "Player" text, "Test debut" text, "Year" real, "Cross-code debut" text, "Date" text, "Position" text ) ### Response: SELECT "Date" FROM table_65602 WHERE "Position" = 'back' AND "Year" > '1964' AND "Test debut" = '1st rl test v new zealand'
Who is the lead for the team with Christina Haller as alternate?
CREATE TABLE table_34776 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text )
SELECT "Lead" FROM table_34776 WHERE "Alternate" = 'christina haller'
Below are sql tables 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 lead for the team with Christina Haller as alternate? ### Input: CREATE TABLE table_34776 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text ) ### Response: SELECT "Lead" FROM table_34776 WHERE "Alternate" = 'christina haller'
How many companies that have ever operated a flight for each type? Draw a bar chart.
CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text )
SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type
Below are sql tables 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 companies that have ever operated a flight for each type? Draw a bar chart. ### Input: CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) ### Response: SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type
how many patients whose gender is f and procedure icd9 code is 12?
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "12"
Below are sql tables 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 gender is f and procedure icd9 code is 12? ### 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "12"
What was the resting potential with an AP duration of 1.0 and a median giant fiber cell type?
CREATE TABLE table_name_69 ( resting_potential__mv_ VARCHAR, ap_duration__ms_ VARCHAR, cell_type VARCHAR )
SELECT resting_potential__mv_ FROM table_name_69 WHERE ap_duration__ms_ = "1.0" AND cell_type = "median giant fiber"
Below are sql tables 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 resting potential with an AP duration of 1.0 and a median giant fiber cell type? ### Input: CREATE TABLE table_name_69 ( resting_potential__mv_ VARCHAR, ap_duration__ms_ VARCHAR, cell_type VARCHAR ) ### Response: SELECT resting_potential__mv_ FROM table_name_69 WHERE ap_duration__ms_ = "1.0" AND cell_type = "median giant fiber"
What are the players that attented long beach state?
CREATE TABLE table_11734041_16 ( player VARCHAR, school_club_team_country VARCHAR )
SELECT player FROM table_11734041_16 WHERE school_club_team_country = "Long Beach State"
Below are sql tables 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 players that attented long beach state? ### Input: CREATE TABLE table_11734041_16 ( player VARCHAR, school_club_team_country VARCHAR ) ### Response: SELECT player FROM table_11734041_16 WHERE school_club_team_country = "Long Beach State"
What were the average laps on a grid of 11?
CREATE TABLE table_name_37 ( laps INTEGER, grid VARCHAR )
SELECT AVG(laps) FROM table_name_37 WHERE grid = 11
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were the average laps on a grid of 11? ### Input: CREATE TABLE table_name_37 ( laps INTEGER, grid VARCHAR ) ### Response: SELECT AVG(laps) FROM table_name_37 WHERE grid = 11
Name Model which has a Years of 2006 2008 and a Torque@rpm of n m (lb ft) @1900 3500?
CREATE TABLE table_65466 ( "Model" text, "Years" text, "Type/code" text, "Power@rpm" text, "Torque@rpm" text )
SELECT "Model" FROM table_65466 WHERE "Years" = '2006–2008' AND "Torque@rpm" = 'n·m (lb·ft) @1900–3500'
Below are sql tables 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 Model which has a Years of 2006 2008 and a Torque@rpm of n m (lb ft) @1900 3500? ### Input: CREATE TABLE table_65466 ( "Model" text, "Years" text, "Type/code" text, "Power@rpm" text, "Torque@rpm" text ) ### Response: SELECT "Model" FROM table_65466 WHERE "Years" = '2006–2008' AND "Torque@rpm" = 'n·m (lb·ft) @1900–3500'
Which publisher released Martial Law: Substitutes?
CREATE TABLE table_74992 ( "Release date" text, "Release title" text, "Country" text, "Publisher" text, "Format" text, "Language" text, "Subtitles" text, "Notes" text )
SELECT "Publisher" FROM table_74992 WHERE "Release title" = 'martial law: substitutes'
Below are sql tables 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 publisher released Martial Law: Substitutes? ### Input: CREATE TABLE table_74992 ( "Release date" text, "Release title" text, "Country" text, "Publisher" text, "Format" text, "Language" text, "Subtitles" text, "Notes" text ) ### Response: SELECT "Publisher" FROM table_74992 WHERE "Release title" = 'martial law: substitutes'
Which Blagojevich (D) has a Source of zogby/wsj, and a Topinka (R) of 33.2%?
CREATE TABLE table_75303 ( "Source" text, "Date" text, "Blagojevich (D)" text, "Topinka (R)" text, "Remainder" text )
SELECT "Blagojevich (D)" FROM table_75303 WHERE "Source" = 'zogby/wsj' AND "Topinka (R)" = '33.2%'
Below are sql tables 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 Blagojevich (D) has a Source of zogby/wsj, and a Topinka (R) of 33.2%? ### Input: CREATE TABLE table_75303 ( "Source" text, "Date" text, "Blagojevich (D)" text, "Topinka (R)" text, "Remainder" text ) ### Response: SELECT "Blagojevich (D)" FROM table_75303 WHERE "Source" = 'zogby/wsj' AND "Topinka (R)" = '33.2%'
What is the On-air ID of the broadcaster at frequency 0 801?
CREATE TABLE table_name_13 ( on_air_id VARCHAR, frequency VARCHAR )
SELECT on_air_id FROM table_name_13 WHERE frequency = "0 801"
Below are sql tables 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 On-air ID of the broadcaster at frequency 0 801? ### Input: CREATE TABLE table_name_13 ( on_air_id VARCHAR, frequency VARCHAR ) ### Response: SELECT on_air_id FROM table_name_13 WHERE frequency = "0 801"
Give me the comparison about School_ID over the All_Home , and group by attribute ACC_Road, and display from low to high by the Y.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text )
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about School_ID over the All_Home , and group by attribute ACC_Road, and display from low to high by the Y. ### Input: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) ### Response: SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID
in 2102 what was the four most frequent medications prescribed during the same month to the male patients with age 50s after they were diagnosed with late effect acute polio?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late effect acute polio') AND STRFTIME('%y', diagnoses_icd.charttime) = '2102') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'm') AND admissions.age BETWEEN 50 AND 59 AND STRFTIME('%y', prescriptions.startdate) = '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.startdate, 'start of month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4
Below are sql tables 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 2102 what was the four most frequent medications prescribed during the same month to the male patients with age 50s after they were diagnosed with late effect acute polio? ### Input: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late effect acute polio') AND STRFTIME('%y', diagnoses_icd.charttime) = '2102') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'm') AND admissions.age BETWEEN 50 AND 59 AND STRFTIME('%y', prescriptions.startdate) = '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.startdate, 'start of month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4
how many patients whose marital status is divorced and procedure long title is small-to-small intestinal anastomosis?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Small-to-small intestinal anastomosis"
Below are sql tables 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 marital status is divorced and procedure long title is small-to-small intestinal anastomosis? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Small-to-small intestinal anastomosis"
What is the city in Alabama that opened in 1996?
CREATE TABLE table_name_89 ( city VARCHAR, year_opened VARCHAR, state VARCHAR )
SELECT city FROM table_name_89 WHERE year_opened = "1996" AND state = "alabama"
Below are sql tables 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 city in Alabama that opened in 1996? ### Input: CREATE TABLE table_name_89 ( city VARCHAR, year_opened VARCHAR, state VARCHAR ) ### Response: SELECT city FROM table_name_89 WHERE year_opened = "1996" AND state = "alabama"
how many patients whose drug code is warf25 had elective admission type?
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 ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "WARF25"
Below are sql tables 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 drug code is warf25 had elective admission type? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE 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 ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "WARF25"
what was the last output on 12/31/this year for patient 55360?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', outputevents.charttime) = '12-31' ORDER BY outputevents.charttime DESC LIMIT 1)
Below are sql tables 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 last output on 12/31/this year for patient 55360? ### Input: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) ### Response: SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', outputevents.charttime) = '12-31' ORDER BY outputevents.charttime DESC LIMIT 1)
Tell me the stages for 1981
CREATE TABLE table_31596 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text )
SELECT "Stages" FROM table_31596 WHERE "Year" = '1981'
Below are sql tables 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 stages for 1981 ### Input: CREATE TABLE table_31596 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text ) ### Response: SELECT "Stages" FROM table_31596 WHERE "Year" = '1981'
What's the average interview with Preliminaries larger than 8.27, an Evening Gown of 8.85, and an Average smaller than 8.842?
CREATE TABLE table_69211 ( "State" text, "Preliminaries" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
SELECT AVG("Interview") FROM table_69211 WHERE "Preliminaries" > '8.27' AND "Evening Gown" = '8.85' AND "Average" < '8.842'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the average interview with Preliminaries larger than 8.27, an Evening Gown of 8.85, and an Average smaller than 8.842? ### Input: CREATE TABLE table_69211 ( "State" text, "Preliminaries" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) ### Response: SELECT AVG("Interview") FROM table_69211 WHERE "Preliminaries" > '8.27' AND "Evening Gown" = '8.85' AND "Average" < '8.842'
A bar chart about what is minimum hours of the students playing in different position?
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) )
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what is minimum hours of the students playing in different position? ### Input: CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ### Response: SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos
When Efrain Valdez was pitching, what was the highest home run?
CREATE TABLE table_name_82 ( home_run INTEGER, opposing_pitcher VARCHAR )
SELECT MAX(home_run) FROM table_name_82 WHERE opposing_pitcher = "efrain valdez"
Below are sql tables 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 Efrain Valdez was pitching, what was the highest home run? ### Input: CREATE TABLE table_name_82 ( home_run INTEGER, opposing_pitcher VARCHAR ) ### Response: SELECT MAX(home_run) FROM table_name_82 WHERE opposing_pitcher = "efrain valdez"
Bounties: on own questions vs. others' questions.
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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text )
SELECT SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) AS "Own", 100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) / COUNT(*) AS "%", SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) AS "Other", 100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) / COUNT(*) AS "%" FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id WHERE v.VoteTypeId = 8
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bounties: on own questions vs. others' questions. ### Input: 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) ### Response: SELECT SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) AS "Own", 100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) / COUNT(*) AS "%", SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) AS "Other", 100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) / COUNT(*) AS "%" FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id WHERE v.VoteTypeId = 8
Which country has a Euro that equals larger than 1.46611, and an usd equal to 1.76650?
CREATE TABLE table_70191 ( "Country" text, "Currency" text, "1 Euro =" real, "1 USD =" text, "Central bank" text )
SELECT "Country" FROM table_70191 WHERE "1 Euro =" > '1.46611' AND "1 USD =" = '1.76650'
Below are sql tables 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 country has a Euro that equals larger than 1.46611, and an usd equal to 1.76650? ### Input: CREATE TABLE table_70191 ( "Country" text, "Currency" text, "1 Euro =" real, "1 USD =" text, "Central bank" text ) ### Response: SELECT "Country" FROM table_70191 WHERE "1 Euro =" > '1.46611' AND "1 USD =" = '1.76650'
Name the population 2011 for luxembourg
CREATE TABLE table_1789 ( "Country" text, "Population (2011)" real, "GDP (nominal) (2010, US$ millions)" real, "Military expenditures (2011, US$ millions)" real, "Military expenditures (2011, % of GDP)" text, "Defence expenditures, (2011, per capita)" real, "Deployable military (2011, thousands)" text )
SELECT "Population (2011)" FROM table_1789 WHERE "Country" = 'Luxembourg'
Below are sql tables 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 population 2011 for luxembourg ### Input: CREATE TABLE table_1789 ( "Country" text, "Population (2011)" real, "GDP (nominal) (2010, US$ millions)" real, "Military expenditures (2011, US$ millions)" real, "Military expenditures (2011, % of GDP)" text, "Defence expenditures, (2011, per capita)" real, "Deployable military (2011, thousands)" text ) ### Response: SELECT "Population (2011)" FROM table_1789 WHERE "Country" = 'Luxembourg'
When did the Chargers play the Denver Broncos before Week 10?
CREATE TABLE table_7587 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT "Date" FROM table_7587 WHERE "Week" < '10' AND "Opponent" = 'denver broncos'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the Chargers play the Denver Broncos before Week 10? ### Input: CREATE TABLE table_7587 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) ### Response: SELECT "Date" FROM table_7587 WHERE "Week" < '10' AND "Opponent" = 'denver broncos'
what is the best supported club with a 25 Goal and a per game larger than 1,156?
CREATE TABLE table_name_75 ( best_supported_club VARCHAR, goals VARCHAR, per_game VARCHAR )
SELECT best_supported_club FROM table_name_75 WHERE goals = 25 AND per_game > 1 OFFSET 156
Below are sql tables 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 best supported club with a 25 Goal and a per game larger than 1,156? ### Input: CREATE TABLE table_name_75 ( best_supported_club VARCHAR, goals VARCHAR, per_game VARCHAR ) ### Response: SELECT best_supported_club FROM table_name_75 WHERE goals = 25 AND per_game > 1 OFFSET 156
Name the resolution for ketftv.com and callsign of kldo-dt2
CREATE TABLE table_79815 ( "Dish" text, "Callsign" text, "Network" text, "Resolution" text, "City of License" text, "Official Website" text )
SELECT "Resolution" FROM table_79815 WHERE "Official Website" = 'ketftv.com' AND "Callsign" = 'kldo-dt2'
Below are sql tables 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 resolution for ketftv.com and callsign of kldo-dt2 ### Input: CREATE TABLE table_79815 ( "Dish" text, "Callsign" text, "Network" text, "Resolution" text, "City of License" text, "Official Website" text ) ### Response: SELECT "Resolution" FROM table_79815 WHERE "Official Website" = 'ketftv.com' AND "Callsign" = 'kldo-dt2'
What engine was used by the teams that used a Lola b02/00 chassis and ranked 1st?
CREATE TABLE table_name_45 ( engine VARCHAR, chassis VARCHAR, rank VARCHAR )
SELECT engine FROM table_name_45 WHERE chassis = "lola b02/00" AND rank = "1st"
Below are sql tables 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 engine was used by the teams that used a Lola b02/00 chassis and ranked 1st? ### Input: CREATE TABLE table_name_45 ( engine VARCHAR, chassis VARCHAR, rank VARCHAR ) ### Response: SELECT engine FROM table_name_45 WHERE chassis = "lola b02/00" AND rank = "1st"
What is the total brup for the team?
CREATE TABLE table_72957 ( "Name" text, "GP-GS" text, "Solo" real, "Ast" real, "Total" real, "TFL-Yds" text, "No-Yds" text, "BrUp" real, "QBH" real, "No.-Yds" text, "Avg" text, "TD" real, "Long" real, "Rcv-Yds" text, "FF" real, "Blkd Kick" real )
SELECT "BrUp" FROM table_72957 WHERE "Name" = 'Total'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total brup for the team? ### Input: CREATE TABLE table_72957 ( "Name" text, "GP-GS" text, "Solo" real, "Ast" real, "Total" real, "TFL-Yds" text, "No-Yds" text, "BrUp" real, "QBH" real, "No.-Yds" text, "Avg" text, "TD" real, "Long" real, "Rcv-Yds" text, "FF" real, "Blkd Kick" real ) ### Response: SELECT "BrUp" FROM table_72957 WHERE "Name" = 'Total'
who won after jan in week 9 ?
CREATE TABLE table_204_628 ( id number, "trial number" text, "date" text, "name of trial" text, "celebrity/ies taking part" text, "winner/number of stars" text, "notes" text )
SELECT "winner/number of stars" FROM table_204_628 WHERE id = (SELECT id FROM table_204_628 WHERE "winner/number of stars" = 'jan') + 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who won after jan in week 9 ? ### Input: CREATE TABLE table_204_628 ( id number, "trial number" text, "date" text, "name of trial" text, "celebrity/ies taking part" text, "winner/number of stars" text, "notes" text ) ### Response: SELECT "winner/number of stars" FROM table_204_628 WHERE id = (SELECT id FROM table_204_628 WHERE "winner/number of stars" = 'jan') + 1
Who is the Candidate when the Riding is Hochelaga?
CREATE TABLE table_15440 ( "Riding" text, "Province" text, "Candidate" text, "Votes" real, "Placement" text )
SELECT "Candidate" FROM table_15440 WHERE "Riding" = 'hochelaga'
Below are sql tables 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 Candidate when the Riding is Hochelaga? ### Input: CREATE TABLE table_15440 ( "Riding" text, "Province" text, "Candidate" text, "Votes" real, "Placement" text ) ### Response: SELECT "Candidate" FROM table_15440 WHERE "Riding" = 'hochelaga'
Show all origins and the number of flights from each origin Show bar chart, display in desc by the y axis please.
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) )
SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all origins and the number of flights from each origin Show bar chart, display in desc by the y axis please. ### Input: CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) ### Response: SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*) DESC
what's the highest player number from the list from 2000-2001
CREATE TABLE table_72793 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
SELECT MAX("No.") FROM table_72793 WHERE "Years for Grizzlies" = '2000-2001'
Below are sql tables 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 highest player number from the list from 2000-2001 ### Input: CREATE TABLE table_72793 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) ### Response: SELECT MAX("No.") FROM table_72793 WHERE "Years for Grizzlies" = '2000-2001'
What is the biggest crowd when carlton is the away squad?
CREATE TABLE table_name_48 ( crowd INTEGER, away_team VARCHAR )
SELECT MAX(crowd) FROM table_name_48 WHERE away_team = "carlton"
Below are sql tables 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 biggest crowd when carlton is the away squad? ### Input: CREATE TABLE table_name_48 ( crowd INTEGER, away_team VARCHAR ) ### Response: SELECT MAX(crowd) FROM table_name_48 WHERE away_team = "carlton"
What is the maximum enrollment for Concordia University?
CREATE TABLE table_1974443_1 ( enrollment INTEGER, institution VARCHAR )
SELECT MAX(enrollment) FROM table_1974443_1 WHERE institution = "Concordia University"
Below are sql tables 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 maximum enrollment for Concordia University? ### Input: CREATE TABLE table_1974443_1 ( enrollment INTEGER, institution VARCHAR ) ### Response: SELECT MAX(enrollment) FROM table_1974443_1 WHERE institution = "Concordia University"
how many games did the senators play in january ?
CREATE TABLE table_203_517 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text, "pts" number )
SELECT COUNT(*) FROM table_203_517 WHERE "date" = 1
Below are sql tables 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 games did the senators play in january ? ### Input: CREATE TABLE table_203_517 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text, "pts" number ) ### Response: SELECT COUNT(*) FROM table_203_517 WHERE "date" = 1