instruction
stringlengths
0
1.06k
input
stringlengths
33
7.14k
response
stringlengths
2
4.44k
source
stringclasses
25 values
text
stringlengths
302
8.5k
For those records from the products and each product's manufacturer, give me the comparison about the average of price over the founder , and group by attribute founder by a bar chart, rank in desc by the x-axis.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the average of price over the founder , and group by attribute founder by a bar chart, rank in desc by the x-axis. ### Input: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) ### Response: SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
Who was the 20 Questions section aimed at when Centerfold Model was Rachel Je n Marteen?
CREATE TABLE table_41520 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text )
SELECT "20 Questions" FROM table_41520 WHERE "Centerfold model" = 'rachel jeán marteen'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the 20 Questions section aimed at when Centerfold Model was Rachel Je n Marteen? ### Input: CREATE TABLE table_41520 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text ) ### Response: SELECT "20 Questions" FROM table_41520 WHERE "Centerfold model" = 'rachel jeán marteen'
What Grid has a Time/Retired of clutch?
CREATE TABLE table_57703 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT SUM("Grid") FROM table_57703 WHERE "Time/Retired" = 'clutch'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Grid has a Time/Retired of clutch? ### Input: CREATE TABLE table_57703 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) ### Response: SELECT SUM("Grid") FROM table_57703 WHERE "Time/Retired" = 'clutch'
What was the score when Bornor Regis Town was the opponent?
CREATE TABLE table_name_58 ( score VARCHAR, opponent VARCHAR )
SELECT score FROM table_name_58 WHERE opponent = "bornor regis town"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score when Bornor Regis Town was the opponent? ### Input: CREATE TABLE table_name_58 ( score VARCHAR, opponent VARCHAR ) ### Response: SELECT score FROM table_name_58 WHERE opponent = "bornor regis town"
What is the oldest model Porsche v12 that has points less than or equal to 0.
CREATE TABLE table_70082 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real )
SELECT MIN("Year") FROM table_70082 WHERE "Engine" = 'porsche v12' AND "Pts." < '0'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the oldest model Porsche v12 that has points less than or equal to 0. ### Input: CREATE TABLE table_70082 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real ) ### Response: SELECT MIN("Year") FROM table_70082 WHERE "Engine" = 'porsche v12' AND "Pts." < '0'
get me the top four most frequent treatments since 2101?
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2101' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
eicu
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the top four most frequent treatments since 2101? ### Input: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) ### Response: SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2101' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
What is the title of book number 7?
CREATE TABLE table_74392 ( "#" text, "Title" text, "Author" text, "Doctor" text, "Featuring companion" text, "Published" text, "ISBN" text, "Audiobook narrator" text )
SELECT "Title" FROM table_74392 WHERE "#" = '7'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title of book number 7? ### Input: CREATE TABLE table_74392 ( "#" text, "Title" text, "Author" text, "Doctor" text, "Featuring companion" text, "Published" text, "ISBN" text, "Audiobook narrator" text ) ### Response: SELECT "Title" FROM table_74392 WHERE "#" = '7'
What is the greatest Wins with Matches smaller than 5, and a Year of 1994?
CREATE TABLE table_name_26 ( wins INTEGER, matches VARCHAR, year VARCHAR )
SELECT MAX(wins) FROM table_name_26 WHERE matches < 5 AND year = 1994
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the greatest Wins with Matches smaller than 5, and a Year of 1994? ### Input: CREATE TABLE table_name_26 ( wins INTEGER, matches VARCHAR, year VARCHAR ) ### Response: SELECT MAX(wins) FROM table_name_26 WHERE matches < 5 AND year = 1994
How many original air dates were there for episodes with a production code of 4398016?
CREATE TABLE table_21164557_1 ( original_air_date VARCHAR, production_code VARCHAR )
SELECT COUNT(original_air_date) FROM table_21164557_1 WHERE production_code = 4398016
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many original air dates were there for episodes with a production code of 4398016? ### Input: CREATE TABLE table_21164557_1 ( original_air_date VARCHAR, production_code VARCHAR ) ### Response: SELECT COUNT(original_air_date) FROM table_21164557_1 WHERE production_code = 4398016
How many wines with a price higher than 100 of each year? Show a bar chart that converts year into weekday interval.
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT )
SELECT Year, COUNT(Year) FROM wine WHERE Price > 100
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many wines with a price higher than 100 of each year? Show a bar chart that converts year into weekday interval. ### Input: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) ### Response: SELECT Year, COUNT(Year) FROM wine WHERE Price > 100
Questions Count for User Reputation Range.
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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
SELECT COUNT(*) FROM (SELECT (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId LEFT JOIN Users AS u ON u.Id = d.OwnerUserId WHERE d.PostTypeId = 1 AND u.Reputation > 999 AND u.Reputation < 10000) AS t1
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions Count for User Reputation Range. ### Input: 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) ### Response: SELECT COUNT(*) FROM (SELECT (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId LEFT JOIN Users AS u ON u.Id = d.OwnerUserId WHERE d.PostTypeId = 1 AND u.Reputation > 999 AND u.Reputation < 10000) AS t1
Which event in the 2008 Beijing Games had a bronze medal?
CREATE TABLE table_33800 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
SELECT "Event" FROM table_33800 WHERE "Games" = '2008 beijing' AND "Medal" = 'bronze'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which event in the 2008 Beijing Games had a bronze medal? ### Input: CREATE TABLE table_33800 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text ) ### Response: SELECT "Event" FROM table_33800 WHERE "Games" = '2008 beijing' AND "Medal" = 'bronze'
what administrative area comes before nightingale island ?
CREATE TABLE table_204_332 ( id number, "administrative\narea" text, "area\nkm2" number, "area\nsq mi" number, "population" number, "administrative\ncentre" text )
SELECT "administrative\narea" FROM table_204_332 WHERE id = (SELECT id FROM table_204_332 WHERE "administrative\narea" = 'nightingale island') - 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what administrative area comes before nightingale island ? ### Input: CREATE TABLE table_204_332 ( id number, "administrative\narea" text, "area\nkm2" number, "area\nsq mi" number, "population" number, "administrative\ncentre" text ) ### Response: SELECT "administrative\narea" FROM table_204_332 WHERE id = (SELECT id FROM table_204_332 WHERE "administrative\narea" = 'nightingale island') - 1
What is the lowest amount of floors after rank 1 in the Trillium (residential) building?
CREATE TABLE table_name_33 ( floors INTEGER, rank VARCHAR, building VARCHAR )
SELECT MIN(floors) FROM table_name_33 WHERE rank > 1 AND building = "the trillium (residential)"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest amount of floors after rank 1 in the Trillium (residential) building? ### Input: CREATE TABLE table_name_33 ( floors INTEGER, rank VARCHAR, building VARCHAR ) ### Response: SELECT MIN(floors) FROM table_name_33 WHERE rank > 1 AND building = "the trillium (residential)"
What is the total number of Week, when Opponent is At Chicago Bears, and when Attendance is greater than 49,070?
CREATE TABLE table_name_81 ( week VARCHAR, opponent VARCHAR, attendance VARCHAR )
SELECT COUNT(week) FROM table_name_81 WHERE opponent = "at chicago bears" AND attendance > 49 OFFSET 070
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Week, when Opponent is At Chicago Bears, and when Attendance is greater than 49,070? ### Input: CREATE TABLE table_name_81 ( week VARCHAR, opponent VARCHAR, attendance VARCHAR ) ### Response: SELECT COUNT(week) FROM table_name_81 WHERE opponent = "at chicago bears" AND attendance > 49 OFFSET 070
I want the average events for top 10 less than 4
CREATE TABLE table_name_17 ( events INTEGER, top_10 INTEGER )
SELECT AVG(events) FROM table_name_17 WHERE top_10 < 4
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want the average events for top 10 less than 4 ### Input: CREATE TABLE table_name_17 ( events INTEGER, top_10 INTEGER ) ### Response: SELECT AVG(events) FROM table_name_17 WHERE top_10 < 4
what was the name of the output the last time patient 51177 had since 08/01/2101?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE 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 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 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( 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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 = 51177)) AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2101-08-01' ORDER BY outputevents.charttime DESC LIMIT 1)
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the output the last time patient 51177 had since 08/01/2101? ### Input: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE 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 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 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( 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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 = 51177)) AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2101-08-01' ORDER BY outputevents.charttime DESC LIMIT 1)
In the game resulting in a 5-11 record, who scored the high rebounds?
CREATE TABLE table_21340 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
SELECT "High rebounds" FROM table_21340 WHERE "Record" = '5-11'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game resulting in a 5-11 record, who scored the high rebounds? ### Input: CREATE TABLE table_21340 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text ) ### Response: SELECT "High rebounds" FROM table_21340 WHERE "Record" = '5-11'
What years have 10 (0) in the finals?
CREATE TABLE table_64565 ( "Name" text, "Years" text, "A-League" text, "Finals" text, "Total" text )
SELECT "Years" FROM table_64565 WHERE "Finals" = '10 (0)'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years have 10 (0) in the finals? ### Input: CREATE TABLE table_64565 ( "Name" text, "Years" text, "A-League" text, "Finals" text, "Total" text ) ### Response: SELECT "Years" FROM table_64565 WHERE "Finals" = '10 (0)'
What is the away team against Omiya Ardija in 2018?
CREATE TABLE betfront ( year number, datetime time, country text, competion text, match text, home_opening number, draw_opening number, away_opening number, home_closing number, draw_closing number, away_closing number ) CREATE TABLE football_data ( season text, datetime time, div text, country text, league text, referee text, hometeam text, awayteam text, fthg number, ftag number, ftr text, hthg number, htag number, htr text, psh number, psd number, psa number, b365h number, b365d number, b365a number, lbh number, lbd number, lba number, bwh number, bwd number, bwa number )
SELECT awayteam FROM football_data WHERE hometeam = "Omiya Ardija" AND season LIKE "%2018%"
worldsoccerdatabase
Below are sql tables 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 away team against Omiya Ardija in 2018? ### Input: CREATE TABLE betfront ( year number, datetime time, country text, competion text, match text, home_opening number, draw_opening number, away_opening number, home_closing number, draw_closing number, away_closing number ) CREATE TABLE football_data ( season text, datetime time, div text, country text, league text, referee text, hometeam text, awayteam text, fthg number, ftag number, ftr text, hthg number, htag number, htr text, psh number, psd number, psa number, b365h number, b365d number, b365a number, lbh number, lbd number, lba number, bwh number, bwd number, bwa number ) ### Response: SELECT awayteam FROM football_data WHERE hometeam = "Omiya Ardija" AND season LIKE "%2018%"
Questions by hour of day.
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseReasonTypes ( 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE 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 PostTags ( PostId number, TagId number )
SELECT TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M') AS minute, SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS questions, SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS answers FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 AND CreationDate >= '##mindate:string?20140101##' GROUP BY TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M') ORDER BY TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M')
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions by hour of day. ### Input: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE 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 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseReasonTypes ( 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) ### Response: SELECT TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M') AS minute, SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS questions, SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS answers FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 AND CreationDate >= '##mindate:string?20140101##' GROUP BY TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M') ORDER BY TIME_TO_STR(CreationDate, '%h') * 60 + TIME_TO_STR(CreationDate, '%M')
what flights are there on DL from BOSTON to DALLAS
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE 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 code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name 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 compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'DL'
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights are there on DL from BOSTON to DALLAS ### Input: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE 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 code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name 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 compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'DL'
When was the archbishop that was born on February 10, 1858 ordained a bishop?
CREATE TABLE table_44492 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text )
SELECT "Ordained Bishop" FROM table_44492 WHERE "Born" = 'february 10, 1858'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the archbishop that was born on February 10, 1858 ordained a bishop? ### Input: CREATE TABLE table_44492 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text ) ### Response: SELECT "Ordained Bishop" FROM table_44492 WHERE "Born" = 'february 10, 1858'
tell me the date of patient 6940's birth?
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE 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 )
SELECT patients.dob FROM patients WHERE patients.subject_id = 6940
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the date of patient 6940's birth? ### 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE 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 ) ### Response: SELECT patients.dob FROM patients WHERE patients.subject_id = 6940
List some courses worth 11 credits .
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
SELECT DISTINCT name, number FROM course WHERE credits = 11 AND department = 'EECS'
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List some courses worth 11 credits . ### Input: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) ### Response: SELECT DISTINCT name, number FROM course WHERE credits = 11 AND department = 'EECS'
how many male patients had the lab test for amylase?
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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Amylase"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many male patients had the lab test for amylase? ### 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Amylase"
What is the 98kg for Santo Domingo, Domincan on 1 October 2006?
CREATE TABLE table_65003 ( "World record" text, "Snatch" text, "Yang Lian ( CHN )" text, "98kg" text, "Santo Domingo , Dominican" text )
SELECT "98kg" FROM table_65003 WHERE "Santo Domingo , Dominican" = '1 october 2006'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 98kg for Santo Domingo, Domincan on 1 October 2006? ### Input: CREATE TABLE table_65003 ( "World record" text, "Snatch" text, "Yang Lian ( CHN )" text, "98kg" text, "Santo Domingo , Dominican" text ) ### Response: SELECT "98kg" FROM table_65003 WHERE "Santo Domingo , Dominican" = '1 october 2006'
how many elective hospital admission patients are diagnosed with blood in stool?
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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Blood in stool"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many elective hospital admission patients are diagnosed with blood in stool? ### Input: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Blood in stool"
Name the rally base for rallye de france alsace
CREATE TABLE table_23385853_1 ( rally_base VARCHAR, rally_name VARCHAR )
SELECT rally_base FROM table_23385853_1 WHERE rally_name = "Rallye de France Alsace"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the rally base for rallye de france alsace ### Input: CREATE TABLE table_23385853_1 ( rally_base VARCHAR, rally_name VARCHAR ) ### Response: SELECT rally_base FROM table_23385853_1 WHERE rally_name = "Rallye de France Alsace"
How many seats were up for election during the vote where the election result was 9 and the new council 27?
CREATE TABLE table_name_10 ( seats_up_for_election INTEGER, election_result VARCHAR, new_council VARCHAR )
SELECT SUM(seats_up_for_election) FROM table_name_10 WHERE election_result = 9 AND new_council > 27
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many seats were up for election during the vote where the election result was 9 and the new council 27? ### Input: CREATE TABLE table_name_10 ( seats_up_for_election INTEGER, election_result VARCHAR, new_council VARCHAR ) ### Response: SELECT SUM(seats_up_for_election) FROM table_name_10 WHERE election_result = 9 AND new_council > 27
What is the Raw bandwidth (Mbit/s) for the SAS 300?
CREATE TABLE table_45237 ( "Name" text, "Raw bandwidth (Mbit/s)" text, "Max. cable length (m)" text, "Power provided" text, "Devices per channel" text )
SELECT "Raw bandwidth (Mbit/s)" FROM table_45237 WHERE "Name" = 'sas 300'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Raw bandwidth (Mbit/s) for the SAS 300? ### Input: CREATE TABLE table_45237 ( "Name" text, "Raw bandwidth (Mbit/s)" text, "Max. cable length (m)" text, "Power provided" text, "Devices per channel" text ) ### Response: SELECT "Raw bandwidth (Mbit/s)" FROM table_45237 WHERE "Name" = 'sas 300'
For the sum of monthly_rental, date_address_to, visualize the trend.
CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER )
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the sum of monthly_rental, date_address_to, visualize the trend. ### Input: CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) ### Response: SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC
What is the least amount of draws with an against of 1261?
CREATE TABLE table_41307 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
SELECT MIN("Draws") FROM table_41307 WHERE "Against" = '1261'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least amount of draws with an against of 1261? ### Input: CREATE TABLE table_41307 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) ### Response: SELECT MIN("Draws") FROM table_41307 WHERE "Against" = '1261'
Show institution types, along with the number of institutions and total enrollment for each type.
CREATE TABLE institution ( TYPE VARCHAR, enrollment INTEGER )
SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show institution types, along with the number of institutions and total enrollment for each type. ### Input: CREATE TABLE institution ( TYPE VARCHAR, enrollment INTEGER ) ### Response: SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE
What was the name of the epiode written by Gary M. Goodrich?
CREATE TABLE table_2409041_9 ( title VARCHAR, written_by VARCHAR )
SELECT title FROM table_2409041_9 WHERE written_by = "Gary M. Goodrich"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the name of the epiode written by Gary M. Goodrich? ### Input: CREATE TABLE table_2409041_9 ( title VARCHAR, written_by VARCHAR ) ### Response: SELECT title FROM table_2409041_9 WHERE written_by = "Gary M. Goodrich"
How many people attended the game on October 31?
CREATE TABLE table_36594 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real )
SELECT "Attendance" FROM table_36594 WHERE "Date" = 'october 31'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the game on October 31? ### Input: CREATE TABLE table_36594 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real ) ### Response: SELECT "Attendance" FROM table_36594 WHERE "Date" = 'october 31'
what is minimum age of patients whose admission type is newborn and insurance is government?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Government"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose admission type is newborn and insurance is government? ### Input: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Government"
What team was Paolo Quinteros on?
CREATE TABLE table_41417 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
SELECT "Team" FROM table_41417 WHERE "Name" = 'paolo quinteros'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team was Paolo Quinteros on? ### Input: CREATE TABLE table_41417 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real ) ### Response: SELECT "Team" FROM table_41417 WHERE "Name" = 'paolo quinteros'
What was the lowest re-elected result for Sylvester C. Smith?
CREATE TABLE table_name_47 ( first_elected INTEGER, result VARCHAR, incumbent VARCHAR )
SELECT MIN(first_elected) FROM table_name_47 WHERE result = "re-elected" AND incumbent = "sylvester c. smith"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the lowest re-elected result for Sylvester C. Smith? ### Input: CREATE TABLE table_name_47 ( first_elected INTEGER, result VARCHAR, incumbent VARCHAR ) ### Response: SELECT MIN(first_elected) FROM table_name_47 WHERE result = "re-elected" AND incumbent = "sylvester c. smith"
What years for the rockets did player ford, alton alton ford play?
CREATE TABLE table_17170 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
SELECT "Years for Rockets" FROM table_17170 WHERE "Player" = 'Ford, Alton Alton Ford'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years for the rockets did player ford, alton alton ford play? ### Input: CREATE TABLE table_17170 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) ### Response: SELECT "Years for Rockets" FROM table_17170 WHERE "Player" = 'Ford, Alton Alton Ford'
what are connecting flights from CHICAGO to SEATTLE on 6 1
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE 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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time 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_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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 class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int )
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 1 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.connections > 0
atis
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are connecting flights from CHICAGO to SEATTLE on 6 1 ### Input: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE 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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time 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_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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 class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 1 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.connections > 0
Who did the high points of game 5?
CREATE TABLE table_11960196_3 ( high_points VARCHAR, game VARCHAR )
SELECT high_points FROM table_11960196_3 WHERE game = 5
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who did the high points of game 5? ### Input: CREATE TABLE table_11960196_3 ( high_points VARCHAR, game VARCHAR ) ### Response: SELECT high_points FROM table_11960196_3 WHERE game = 5
In what year is the notes distance 1.83m?
CREATE TABLE table_5268 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
SELECT "Year" FROM table_5268 WHERE "Notes" = '1.83m'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what year is the notes distance 1.83m? ### Input: CREATE TABLE table_5268 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) ### Response: SELECT "Year" FROM table_5268 WHERE "Notes" = '1.83m'
Who has the first leg that has a round in the semi-final?
CREATE TABLE table_40548 ( "Round" text, "Opposition" text, "First leg" text, "Second leg" text, "Aggregate score" text )
SELECT "First leg" FROM table_40548 WHERE "Round" = 'semi-final'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who has the first leg that has a round in the semi-final? ### Input: CREATE TABLE table_40548 ( "Round" text, "Opposition" text, "First leg" text, "Second leg" text, "Aggregate score" text ) ### Response: SELECT "First leg" FROM table_40548 WHERE "Round" = 'semi-final'
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and department_id in a bar chart, and I want to sort from high to low by the Y-axis.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and department_id in a bar chart, and I want to sort from high to low by the Y-axis. ### Input: CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) ### Response: SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
what is the number of patients whose year of death is less than or equal to 2112 and drug name is voriconazole?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Voriconazole"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose year of death is less than or equal to 2112 and drug name is voriconazole? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Voriconazole"
Which ISHAA school joined in 2012 and has a mascot of the panthers?
CREATE TABLE table_name_64 ( ihsaa_class VARCHAR, year_joined VARCHAR, mascot VARCHAR )
SELECT ihsaa_class FROM table_name_64 WHERE year_joined < 2012 AND mascot = "panthers"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which ISHAA school joined in 2012 and has a mascot of the panthers? ### Input: CREATE TABLE table_name_64 ( ihsaa_class VARCHAR, year_joined VARCHAR, mascot VARCHAR ) ### Response: SELECT ihsaa_class FROM table_name_64 WHERE year_joined < 2012 AND mascot = "panthers"
Where did the Lightning play the NY Rangers at 7:00 pm?
CREATE TABLE table_46216 ( "Date" text, "Opponent" text, "Location" text, "Time" text, "Result" text )
SELECT "Location" FROM table_46216 WHERE "Opponent" = 'ny rangers' AND "Time" = '7:00 pm'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the Lightning play the NY Rangers at 7:00 pm? ### Input: CREATE TABLE table_46216 ( "Date" text, "Opponent" text, "Location" text, "Time" text, "Result" text ) ### Response: SELECT "Location" FROM table_46216 WHERE "Opponent" = 'ny rangers' AND "Time" = '7:00 pm'
what is the number of patients whose discharge location is home health care and procedure short title is tonsil&adenoid biopsy?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Tonsil&adenoid biopsy"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose discharge location is home health care and procedure short title is tonsil&adenoid biopsy? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Tonsil&adenoid biopsy"
In the Spring-Summer term are any PreMajor or MDE courses offered ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE 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 instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) 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 area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar )
SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 GROUP BY course.department, course.number
advising
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the Spring-Summer term are any PreMajor or MDE courses offered ? ### Input: CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE 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 instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) 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 area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) ### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 GROUP BY course.department, course.number
What name has a Rocket of titan iv(401)b and a Block of block i/ii hybrid?
CREATE TABLE table_name_2 ( name VARCHAR, rocket VARCHAR, block VARCHAR )
SELECT name FROM table_name_2 WHERE rocket = "titan iv(401)b" AND block = "block i/ii hybrid"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What name has a Rocket of titan iv(401)b and a Block of block i/ii hybrid? ### Input: CREATE TABLE table_name_2 ( name VARCHAR, rocket VARCHAR, block VARCHAR ) ### Response: SELECT name FROM table_name_2 WHERE rocket = "titan iv(401)b" AND block = "block i/ii hybrid"
What is the language of the film directed by Federico Fellini?
CREATE TABLE table_name_27 ( language VARCHAR, director VARCHAR )
SELECT language FROM table_name_27 WHERE director = "federico fellini"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the language of the film directed by Federico Fellini? ### Input: CREATE TABLE table_name_27 ( language VARCHAR, director VARCHAR ) ### Response: SELECT language FROM table_name_27 WHERE director = "federico fellini"
Who is the father that was born on January 2, 1842?
CREATE TABLE table_59105 ( "Child" text, "Date of birth" text, "Mother" text, "Father" text, "DNA testing status" text )
SELECT "Father" FROM table_59105 WHERE "Date of birth" = 'january 2, 1842'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the father that was born on January 2, 1842? ### Input: CREATE TABLE table_59105 ( "Child" text, "Date of birth" text, "Mother" text, "Father" text, "DNA testing status" text ) ### Response: SELECT "Father" FROM table_59105 WHERE "Date of birth" = 'january 2, 1842'
What launch has a Ship of fearless?
CREATE TABLE table_name_64 ( launched VARCHAR, ship VARCHAR )
SELECT launched FROM table_name_64 WHERE ship = "fearless"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What launch has a Ship of fearless? ### Input: CREATE TABLE table_name_64 ( launched VARCHAR, ship VARCHAR ) ### Response: SELECT launched FROM table_name_64 WHERE ship = "fearless"
what is the place when the score is 68-72-77-74=291?
CREATE TABLE table_49969 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text )
SELECT "Place" FROM table_49969 WHERE "Score" = '68-72-77-74=291'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the place when the score is 68-72-77-74=291? ### Input: CREATE TABLE table_49969 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text ) ### Response: SELECT "Place" FROM table_49969 WHERE "Score" = '68-72-77-74=291'
What is the least amount of tropical lows for the 1993 94 season with less than 11 tropical cyclones
CREATE TABLE table_name_41 ( tropical_lows INTEGER, season VARCHAR, tropical_cyclones VARCHAR )
SELECT MIN(tropical_lows) FROM table_name_41 WHERE season = "1993–94" AND tropical_cyclones < 11
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least amount of tropical lows for the 1993 94 season with less than 11 tropical cyclones ### Input: CREATE TABLE table_name_41 ( tropical_lows INTEGER, season VARCHAR, tropical_cyclones VARCHAR ) ### Response: SELECT MIN(tropical_lows) FROM table_name_41 WHERE season = "1993–94" AND tropical_cyclones < 11
Which Rally Name has a Surface of asphalt and gravel?
CREATE TABLE table_name_17 ( rally_name VARCHAR, surface VARCHAR )
SELECT rally_name FROM table_name_17 WHERE surface = "asphalt and gravel"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Rally Name has a Surface of asphalt and gravel? ### Input: CREATE TABLE table_name_17 ( rally_name VARCHAR, surface VARCHAR ) ### Response: SELECT rally_name FROM table_name_17 WHERE surface = "asphalt and gravel"
what is the nhl team for round 10?
CREATE TABLE table_58035 ( "Round" real, "Player" text, "Nationality" text, "NHL Team" text, "College/Junior/Club Team (League)" text )
SELECT "NHL Team" FROM table_58035 WHERE "Round" = '10'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the nhl team for round 10? ### Input: CREATE TABLE table_58035 ( "Round" real, "Player" text, "Nationality" text, "NHL Team" text, "College/Junior/Club Team (League)" text ) ### Response: SELECT "NHL Team" FROM table_58035 WHERE "Round" = '10'
what were three of the most frequent intakes until 2 years ago?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_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 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were three of the most frequent intakes until 2 years ago? ### 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 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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_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 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) ### Response: SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3)
What is the nationality of the player who played for the Peterborough Petes (OHL)?
CREATE TABLE table_name_6 ( nationality VARCHAR, college_junior_club_team__league_ VARCHAR )
SELECT nationality FROM table_name_6 WHERE college_junior_club_team__league_ = "peterborough petes (ohl)"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the nationality of the player who played for the Peterborough Petes (OHL)? ### Input: CREATE TABLE table_name_6 ( nationality VARCHAR, college_junior_club_team__league_ VARCHAR ) ### Response: SELECT nationality FROM table_name_6 WHERE college_junior_club_team__league_ = "peterborough petes (ohl)"
Name what succeeded by for foam
CREATE TABLE table_1601027_2 ( succeeded_by VARCHAR, earpads VARCHAR )
SELECT succeeded_by FROM table_1601027_2 WHERE earpads = "Foam"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name what succeeded by for foam ### Input: CREATE TABLE table_1601027_2 ( succeeded_by VARCHAR, earpads VARCHAR ) ### Response: SELECT succeeded_by FROM table_1601027_2 WHERE earpads = "Foam"
what is the highest ngc number when the declination (j2000) is 25 26 ?
CREATE TABLE table_name_51 ( ngc_number INTEGER, declination___j2000__ VARCHAR )
SELECT MAX(ngc_number) FROM table_name_51 WHERE declination___j2000__ = "°25′26″"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the highest ngc number when the declination (j2000) is 25 26 ? ### Input: CREATE TABLE table_name_51 ( ngc_number INTEGER, declination___j2000__ VARCHAR ) ### Response: SELECT MAX(ngc_number) FROM table_name_51 WHERE declination___j2000__ = "°25′26″"
When was the release that was in SACD (hybrid) format?
CREATE TABLE table_13858 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
SELECT "Date" FROM table_13858 WHERE "Format" = 'sacd (hybrid)'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the release that was in SACD (hybrid) format? ### Input: CREATE TABLE table_13858 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text ) ### Response: SELECT "Date" FROM table_13858 WHERE "Format" = 'sacd (hybrid)'
Top Answerers for Tag: score = sum of scores with a cap score per answer.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 PostTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskTypes ( 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 VoteTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 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 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
SELECT P.OwnerUserId AS "user_link", SUM(CASE WHEN P.Score < @Cap THEN P.Score ELSE @Cap END) AS TotalScore, COUNT(*) AS "#Answers" FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE T.TagName = '##TagName##' AND NOT P.OwnerUserId IS NULL GROUP BY P.OwnerUserId ORDER BY TotalScore DESC LIMIT 200
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top Answerers for Tag: score = sum of scores with a cap score per answer. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 PostTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskTypes ( 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 VoteTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 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 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) ### Response: SELECT P.OwnerUserId AS "user_link", SUM(CASE WHEN P.Score < @Cap THEN P.Score ELSE @Cap END) AS TotalScore, COUNT(*) AS "#Answers" FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE T.TagName = '##TagName##' AND NOT P.OwnerUserId IS NULL GROUP BY P.OwnerUserId ORDER BY TotalScore DESC LIMIT 200
What is the method of resolution for the fight that had a time of 5:00 and a record of 5-0?
CREATE TABLE table_name_57 ( method VARCHAR, time VARCHAR, record VARCHAR )
SELECT method FROM table_name_57 WHERE time = "5:00" AND record = "5-0"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the method of resolution for the fight that had a time of 5:00 and a record of 5-0? ### Input: CREATE TABLE table_name_57 ( method VARCHAR, time VARCHAR, record VARCHAR ) ### Response: SELECT method FROM table_name_57 WHERE time = "5:00" AND record = "5-0"
How many users on Stack.
CREATE TABLE PostTypes ( Id number, Name 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
SELECT COUNT(*) FROM Users
sede
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many users on Stack. ### Input: CREATE TABLE PostTypes ( Id number, Name 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) 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 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) ### Response: SELECT COUNT(*) FROM Users
What cataglogue has 27 tracks?
CREATE TABLE table_name_51 ( catalogue VARCHAR, track VARCHAR )
SELECT catalogue FROM table_name_51 WHERE track = 27
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What cataglogue has 27 tracks? ### Input: CREATE TABLE table_name_51 ( catalogue VARCHAR, track VARCHAR ) ### Response: SELECT catalogue FROM table_name_51 WHERE track = 27
Who were the semifinalists when sammy giammalva was runner-up?
CREATE TABLE table_31066 ( "Week of" text, "Tournament" text, "Champion" text, "Runner-up" text, "Semifinalists" text, "Quarterfinalists" text )
SELECT "Semifinalists" FROM table_31066 WHERE "Runner-up" = 'Sammy Giammalva'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the semifinalists when sammy giammalva was runner-up? ### Input: CREATE TABLE table_31066 ( "Week of" text, "Tournament" text, "Champion" text, "Runner-up" text, "Semifinalists" text, "Quarterfinalists" text ) ### Response: SELECT "Semifinalists" FROM table_31066 WHERE "Runner-up" = 'Sammy Giammalva'
What was Gassaway's record at the fight in mississippi, united states against anthony macias?
CREATE TABLE table_50636 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Location" text )
SELECT "Record" FROM table_50636 WHERE "Location" = 'mississippi, united states' AND "Opponent" = 'anthony macias'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Gassaway's record at the fight in mississippi, united states against anthony macias? ### Input: CREATE TABLE table_50636 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Location" text ) ### Response: SELECT "Record" FROM table_50636 WHERE "Location" = 'mississippi, united states' AND "Opponent" = 'anthony macias'
provide the number of patients whose lab test chart time is 2144-12-08 03:27:00?
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2144-12-08 03:27:00"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose lab test chart time is 2144-12-08 03:27:00? ### 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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2144-12-08 03:27:00"
What is the Date of the match with a Score of 0 6, 2 6 with Partner Marcella Mesker?
CREATE TABLE table_name_57 ( date VARCHAR, partner VARCHAR, score VARCHAR )
SELECT date FROM table_name_57 WHERE partner = "marcella mesker" AND score = "0–6, 2–6"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date of the match with a Score of 0 6, 2 6 with Partner Marcella Mesker? ### Input: CREATE TABLE table_name_57 ( date VARCHAR, partner VARCHAR, score VARCHAR ) ### Response: SELECT date FROM table_name_57 WHERE partner = "marcella mesker" AND score = "0–6, 2–6"
What is the average episode # located in Tanzania and whose # in season is larger than 5?
CREATE TABLE table_55121 ( "Episode #" real, "# in Season" real, "Episode Name" text, "Airdate" text, "Location" text )
SELECT AVG("Episode #") FROM table_55121 WHERE "Location" = 'tanzania' AND "# in Season" > '5'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average episode # located in Tanzania and whose # in season is larger than 5? ### Input: CREATE TABLE table_55121 ( "Episode #" real, "# in Season" real, "Episode Name" text, "Airdate" text, "Location" text ) ### Response: SELECT AVG("Episode #") FROM table_55121 WHERE "Location" = 'tanzania' AND "# in Season" > '5'
Show me about the distribution of Sex and the sum of Height , and group by attribute Sex in a bar chart, show sum height in descending order.
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real )
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of Sex and the sum of Height , and group by attribute Sex in a bar chart, show sum height in descending order. ### Input: CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) ### Response: SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC
How many U.S. air dates were from an episode in Season 4?
CREATE TABLE table_73103 ( "No. in season" real, "No. in series" real, "Title" text, "Canadian airdate" text, "US airdate" text, "Production code" real )
SELECT COUNT("US airdate") FROM table_73103 WHERE "No. in season" = '4'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many U.S. air dates were from an episode in Season 4? ### Input: CREATE TABLE table_73103 ( "No. in season" real, "No. in series" real, "Title" text, "Canadian airdate" text, "US airdate" text, "Production code" real ) ### Response: SELECT COUNT("US airdate") FROM table_73103 WHERE "No. in season" = '4'
What competition had more than 40 assists?
CREATE TABLE table_name_19 ( competition VARCHAR, assists INTEGER )
SELECT competition FROM table_name_19 WHERE assists > 40
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What competition had more than 40 assists? ### Input: CREATE TABLE table_name_19 ( competition VARCHAR, assists INTEGER ) ### Response: SELECT competition FROM table_name_19 WHERE assists > 40
A bar chart about what are the ids and details of events that have more than one participants?
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) )
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what are the ids and details of events that have more than one participants? ### Input: CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) ### Response: SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details
What is the average AE 2011 ranking with a Forbes 2011 ranking of 24 and a FT 2011 ranking less than 44?
CREATE TABLE table_name_21 ( ae_2011 INTEGER, forbes_2011 VARCHAR, ft_2011 VARCHAR )
SELECT AVG(ae_2011) FROM table_name_21 WHERE forbes_2011 = 24 AND ft_2011 < 44
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average AE 2011 ranking with a Forbes 2011 ranking of 24 and a FT 2011 ranking less than 44? ### Input: CREATE TABLE table_name_21 ( ae_2011 INTEGER, forbes_2011 VARCHAR, ft_2011 VARCHAR ) ### Response: SELECT AVG(ae_2011) FROM table_name_21 WHERE forbes_2011 = 24 AND ft_2011 < 44
how many days was the wikimania 2011 ?
CREATE TABLE table_203_33 ( id number, "conference" text, "date" text, "place" text, "attendance" number, "archive of presentations" text )
SELECT "date" - "date" FROM table_203_33 WHERE "conference" = 'wikimania 2011'
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days was the wikimania 2011 ? ### Input: CREATE TABLE table_203_33 ( id number, "conference" text, "date" text, "place" text, "attendance" number, "archive of presentations" text ) ### Response: SELECT "date" - "date" FROM table_203_33 WHERE "conference" = 'wikimania 2011'
how many consecutive players were released on july 9 ?
CREATE TABLE table_204_968 ( id number, "squad #" number, "position" text, "player" text, "transferred to" text, "fee" text, "date" text )
SELECT COUNT("player") FROM table_204_968 WHERE "date" = '9 july 2012'
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many consecutive players were released on july 9 ? ### Input: CREATE TABLE table_204_968 ( id number, "squad #" number, "position" text, "player" text, "transferred to" text, "fee" text, "date" text ) ### Response: SELECT COUNT("player") FROM table_204_968 WHERE "date" = '9 july 2012'
Did the nominated work of white valentine win an award?
CREATE TABLE table_name_61 ( result VARCHAR, nominated_work VARCHAR )
SELECT result FROM table_name_61 WHERE nominated_work = "white valentine"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Did the nominated work of white valentine win an award? ### Input: CREATE TABLE table_name_61 ( result VARCHAR, nominated_work VARCHAR ) ### Response: SELECT result FROM table_name_61 WHERE nominated_work = "white valentine"
What is the mean Fall 09 number where fall 05 is less than 3?
CREATE TABLE table_name_34 ( fall_09 INTEGER, fall_05 INTEGER )
SELECT AVG(fall_09) FROM table_name_34 WHERE fall_05 < 3
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mean Fall 09 number where fall 05 is less than 3? ### Input: CREATE TABLE table_name_34 ( fall_09 INTEGER, fall_05 INTEGER ) ### Response: SELECT AVG(fall_09) FROM table_name_34 WHERE fall_05 < 3
Visualize a bar chart about the distribution of Name and Weight , could you sort from high to low by the Name?
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real )
SELECT Name, Weight FROM people ORDER BY Name DESC
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of Name and Weight , could you sort from high to low by the Name? ### Input: CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) ### Response: SELECT Name, Weight FROM people ORDER BY Name DESC
What artist has a mintage of greater than 34,135?
CREATE TABLE table_51306 ( "Year" real, "Design" text, "Issue" text, "Artist" text, "Mintage" real, "Issue Price" text )
SELECT "Artist" FROM table_51306 WHERE "Mintage" > '34,135'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What artist has a mintage of greater than 34,135? ### Input: CREATE TABLE table_51306 ( "Year" real, "Design" text, "Issue" text, "Artist" text, "Mintage" real, "Issue Price" text ) ### Response: SELECT "Artist" FROM table_51306 WHERE "Mintage" > '34,135'
Find All_Home and the average of School_ID , and group by attribute All_Home, and visualize them by a bar chart, rank mean school id in ascending order.
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 ) CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID)
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find All_Home and the average of School_ID , and group by attribute All_Home, and visualize them by a bar chart, rank mean school id in ascending order. ### Input: 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 ) CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) ### Response: SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID)
list all female (sex is F) candidate names in the alphabetical order.
CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number, unsure_rate number ) CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number )
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name
spider
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all female (sex is F) candidate names in the alphabetical order. ### Input: CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number, unsure_rate number ) CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) ### Response: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name
What is Date, when Away Team is 'Minehead'?
CREATE TABLE table_61638 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Date" FROM table_61638 WHERE "Away team" = 'minehead'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Date, when Away Team is 'Minehead'? ### Input: CREATE TABLE table_61638 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) ### Response: SELECT "Date" FROM table_61638 WHERE "Away team" = 'minehead'
What was Bill Glasson's score to par after 2 rounds?
CREATE TABLE table_50379 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "To par" FROM table_50379 WHERE "Player" = 'bill glasson'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Bill Glasson's score to par after 2 rounds? ### Input: CREATE TABLE table_50379 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) ### Response: SELECT "To par" FROM table_50379 WHERE "Player" = 'bill glasson'
What was the first numbered episode in the series titled 'the wind beneath our wings'?
CREATE TABLE table_29102 ( "Series #" real, "Episode #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text )
SELECT MIN("Series #") FROM table_29102 WHERE "Title" = 'The Wind Beneath Our Wings'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the first numbered episode in the series titled 'the wind beneath our wings'? ### Input: CREATE TABLE table_29102 ( "Series #" real, "Episode #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text ) ### Response: SELECT MIN("Series #") FROM table_29102 WHERE "Title" = 'The Wind Beneath Our Wings'
What is the race with the track distance of 6 furlongs and spectacular bid stakes?
CREATE TABLE table_name_29 ( track VARCHAR, distance VARCHAR, race VARCHAR )
SELECT track FROM table_name_29 WHERE distance = "6 furlongs" AND race = "spectacular bid stakes"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the race with the track distance of 6 furlongs and spectacular bid stakes? ### Input: CREATE TABLE table_name_29 ( track VARCHAR, distance VARCHAR, race VARCHAR ) ### Response: SELECT track FROM table_name_29 WHERE distance = "6 furlongs" AND race = "spectacular bid stakes"
What's the rank when the time was 59.65?
CREATE TABLE table_name_43 ( rank VARCHAR, time VARCHAR )
SELECT rank FROM table_name_43 WHERE time = "59.65"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the rank when the time was 59.65? ### Input: CREATE TABLE table_name_43 ( rank VARCHAR, time VARCHAR ) ### Response: SELECT rank FROM table_name_43 WHERE time = "59.65"
who has the most number of years until their mandatory retirement ?
CREATE TABLE table_203_671 ( id number, "name" text, "rank" text, "age" number, "years until mandatory retirement" text, "appointed by" text, "year appointed" number )
SELECT "name" FROM table_203_671 ORDER BY "years until mandatory retirement" DESC LIMIT 1
squall
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who has the most number of years until their mandatory retirement ? ### Input: CREATE TABLE table_203_671 ( id number, "name" text, "rank" text, "age" number, "years until mandatory retirement" text, "appointed by" text, "year appointed" number ) ### Response: SELECT "name" FROM table_203_671 ORDER BY "years until mandatory retirement" DESC LIMIT 1
What position does Zack Torquato play?
CREATE TABLE table_name_6 ( position VARCHAR, player VARCHAR )
SELECT position FROM table_name_6 WHERE player = "zack torquato"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What position does Zack Torquato play? ### Input: CREATE TABLE table_name_6 ( position VARCHAR, player VARCHAR ) ### Response: SELECT position FROM table_name_6 WHERE player = "zack torquato"
What is the Score of the T3 Place Player?
CREATE TABLE table_name_33 ( score VARCHAR, place VARCHAR )
SELECT score FROM table_name_33 WHERE place = "t3"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Score of the T3 Place Player? ### Input: CREATE TABLE table_name_33 ( score VARCHAR, place VARCHAR ) ### Response: SELECT score FROM table_name_33 WHERE place = "t3"
Who was the opponent in round 2?
CREATE TABLE table_13328239_4 ( opponent VARCHAR, round VARCHAR )
SELECT opponent FROM table_13328239_4 WHERE round = "2"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent in round 2? ### Input: CREATE TABLE table_13328239_4 ( opponent VARCHAR, round VARCHAR ) ### Response: SELECT opponent FROM table_13328239_4 WHERE round = "2"
Which Score has an October smaller than 15, and a Record of 2 0 0?
CREATE TABLE table_39156 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT "Score" FROM table_39156 WHERE "October" < '15' AND "Record" = '2–0–0'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Score has an October smaller than 15, and a Record of 2 0 0? ### Input: CREATE TABLE table_39156 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) ### Response: SELECT "Score" FROM table_39156 WHERE "October" < '15' AND "Record" = '2–0–0'
What was the conference when Arizona State won the regular season?
CREATE TABLE table_73441 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
SELECT "Conference" FROM table_73441 WHERE "Regular Season Winner" = 'Arizona State'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the conference when Arizona State won the regular season? ### Input: CREATE TABLE table_73441 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text ) ### Response: SELECT "Conference" FROM table_73441 WHERE "Regular Season Winner" = 'Arizona State'
count the number of patients whose insurance is government and procedure long title is creation of conduit between left ventricle and aorta?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Creation of conduit between left ventricle and aorta"
mimicsql_data
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose insurance is government and procedure long title is creation of conduit between left ventricle and aorta? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Creation of conduit between left ventricle and aorta"
Who was the opponent that led to a 10-13 record?
CREATE TABLE table_name_38 ( opponent VARCHAR, record VARCHAR )
SELECT opponent FROM table_name_38 WHERE record = "10-13"
sql_create_context
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent that led to a 10-13 record? ### Input: CREATE TABLE table_name_38 ( opponent VARCHAR, record VARCHAR ) ### Response: SELECT opponent FROM table_name_38 WHERE record = "10-13"
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a line chart shows the trend of salary over hire_date , and display X-axis in asc order.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
nvbench
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a line chart shows the trend of salary over hire_date , and display X-axis in asc order. ### Input: CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) ### Response: SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
What player had less than 6 appearances at the FA cup, 33 at the premier league, and more than 5 at the UEFA cup?
CREATE TABLE table_45019 ( "Player" text, "Position" text, "Premier League" real, "FA Cup" real, "League Cup" real, "UEFA Cup" real, "Total" real )
SELECT "Player" FROM table_45019 WHERE "FA Cup" < '6' AND "Premier League" = '33' AND "UEFA Cup" > '5'
wikisql
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player had less than 6 appearances at the FA cup, 33 at the premier league, and more than 5 at the UEFA cup? ### Input: CREATE TABLE table_45019 ( "Player" text, "Position" text, "Premier League" real, "FA Cup" real, "League Cup" real, "UEFA Cup" real, "Total" real ) ### Response: SELECT "Player" FROM table_45019 WHERE "FA Cup" < '6' AND "Premier League" = '33' AND "UEFA Cup" > '5'