instruction
stringlengths
8
460
input
stringlengths
37
7.14k
output
stringlengths
9
2.37k
text
stringlengths
302
7.71k
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of manufacturer , and group by attribute name in a bar chart, and I want to order in desc by the y axis please.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the distribution of name and the average of manufacturer , and group by attribute name in a bar chart, and I want to order in desc by the y axis please. ### Input: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) ### Response: SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
What is listed as the average Date that has U-boats destroyed (KuK) of 2 with Tonnage of 1,514,050?
CREATE TABLE table_name_13 ( date INTEGER, u_boats_destroyed__kuk_ VARCHAR, tonnage VARCHAR )
SELECT AVG(date) FROM table_name_13 WHERE u_boats_destroyed__kuk_ = "2" AND tonnage = "1,514,050"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is listed as the average Date that has U-boats destroyed (KuK) of 2 with Tonnage of 1,514,050? ### Input: CREATE TABLE table_name_13 ( date INTEGER, u_boats_destroyed__kuk_ VARCHAR, tonnage VARCHAR ) ### Response: SELECT AVG(date) FROM table_name_13 WHERE u_boats_destroyed__kuk_ = "2" AND tonnage = "1,514,050"
in the last year what are the five most commonly ordered specimen tests?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
Below are sql tables 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 last year what are the five most commonly ordered specimen tests? ### Input: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) ### Response: SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
What is the place of player peter oosterhuis, who has $7,500?
CREATE TABLE table_name_7 ( place VARCHAR, money___$__ VARCHAR, player VARCHAR )
SELECT place FROM table_name_7 WHERE money___$__ = "7,500" AND player = "peter oosterhuis"
Below are sql tables 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 of player peter oosterhuis, who has $7,500? ### Input: CREATE TABLE table_name_7 ( place VARCHAR, money___$__ VARCHAR, player VARCHAR ) ### Response: SELECT place FROM table_name_7 WHERE money___$__ = "7,500" AND player = "peter oosterhuis"
when patient 032-24135 was first diagnosed with ventricular tachycardia - non-sustained during this year?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135')) AND diagnosis.diagnosisname = 'ventricular tachycardia - non-sustained' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY diagnosis.diagnosistime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when patient 032-24135 was first diagnosed with ventricular tachycardia - non-sustained during this year? ### Input: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135')) AND diagnosis.diagnosisname = 'ventricular tachycardia - non-sustained' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY diagnosis.diagnosistime LIMIT 1
On which circuit does lorenzo bandini have the fastest lap as well as the pole position?
CREATE TABLE table_57912 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
SELECT "Circuit" FROM table_57912 WHERE "Fastest lap" = 'lorenzo bandini' AND "Pole position" = 'lorenzo bandini'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On which circuit does lorenzo bandini have the fastest lap as well as the pole position? ### Input: CREATE TABLE table_57912 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) ### Response: SELECT "Circuit" FROM table_57912 WHERE "Fastest lap" = 'lorenzo bandini' AND "Pole position" = 'lorenzo bandini'
against which opponent were there the most people in attendance ?
CREATE TABLE table_203_478 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
SELECT "opponent" FROM table_203_478 ORDER BY "attendance" DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: against which opponent were there the most people in attendance ? ### Input: CREATE TABLE table_203_478 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) ### Response: SELECT "opponent" FROM table_203_478 ORDER BY "attendance" DESC LIMIT 1
List the grapes and appelations of all wines.
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text )
SELECT grape, appelation FROM wine
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the grapes and appelations of all wines. ### Input: CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) ### Response: SELECT grape, appelation FROM wine
in which years did civallero only have one achievement ?
CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
SELECT "year" FROM table_203_734 GROUP BY "year" HAVING COUNT(*) = 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in which years did civallero only have one achievement ? ### Input: CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) ### Response: SELECT "year" FROM table_203_734 GROUP BY "year" HAVING COUNT(*) = 1
provide the number of patients who underwent procedure on single vessel and had inpatient hospital discharge.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Procedure-one vessel"
Below are sql tables 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 who underwent procedure on single vessel and had inpatient hospital discharge. ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Procedure-one vessel"
What is every value for Under-11 when value of under-17 is Salma Nassar?
CREATE TABLE table_28618 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text )
SELECT "Under-11" FROM table_28618 WHERE "Under-17" = 'Salma Nassar'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every value for Under-11 when value of under-17 is Salma Nassar? ### Input: CREATE TABLE table_28618 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text ) ### Response: SELECT "Under-11" FROM table_28618 WHERE "Under-17" = 'Salma Nassar'
What was the attendance at Kardinia Park?
CREATE TABLE table_name_63 ( crowd INTEGER, venue VARCHAR )
SELECT AVG(crowd) FROM table_name_63 WHERE venue = "kardinia park"
Below are sql tables 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 attendance at Kardinia Park? ### Input: CREATE TABLE table_name_63 ( crowd INTEGER, venue VARCHAR ) ### Response: SELECT AVG(crowd) FROM table_name_63 WHERE venue = "kardinia park"
Who was the away team at South Melbourne with a crowd size larger than 10,000.
CREATE TABLE table_53983 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_53983 WHERE "Crowd" > '10,000' AND "Away team" = 'south melbourne'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the away team at South Melbourne with a crowd size larger than 10,000. ### Input: CREATE TABLE table_53983 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Response: SELECT "Home team" FROM table_53983 WHERE "Crowd" > '10,000' AND "Away team" = 'south melbourne'
What is the fewest games played for teams with 73 goals for and more than 69 goals against?
CREATE TABLE table_name_17 ( played INTEGER, goals_for VARCHAR, goals_against VARCHAR )
SELECT MIN(played) FROM table_name_17 WHERE goals_for = 73 AND goals_against > 69
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the fewest games played for teams with 73 goals for and more than 69 goals against? ### Input: CREATE TABLE table_name_17 ( played INTEGER, goals_for VARCHAR, goals_against VARCHAR ) ### Response: SELECT MIN(played) FROM table_name_17 WHERE goals_for = 73 AND goals_against > 69
among the patients aged 60 or above in this year, what were the top five most frequent procedures?
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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) 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 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 ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among the patients aged 60 or above in this year, what were the top five most frequent procedures? ### 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) 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 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 ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ### Response: SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
My answers for a given tag.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
SELECT * FROM (SELECT Posts.Id FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN Posts ON Posts.Id = PostTags.PostId WHERE TagName = '##tagName##' AND Posts.PostTypeId = 1) AS questions JOIN Posts ON Posts.ParentId = questions.Id WHERE Posts.PostTypeId = 2 AND Posts.OwnerUserId = '##UserId##' AND Posts.CreationDate > '2019/9/01'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: My answers for a given tag. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE 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 ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE 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 PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) ### Response: SELECT * FROM (SELECT Posts.Id FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN Posts ON Posts.Id = PostTags.PostId WHERE TagName = '##tagName##' AND Posts.PostTypeId = 1) AS questions JOIN Posts ON Posts.ParentId = questions.Id WHERE Posts.PostTypeId = 2 AND Posts.OwnerUserId = '##UserId##' AND Posts.CreationDate > '2019/9/01'
count the number of times during the last hospital encounter that patient 15107 had received inject/infus nesiritide procedures.
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject/infus nesiritide') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15107 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of times during the last hospital encounter that patient 15107 had received inject/infus nesiritide procedures. ### Input: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) ### Response: SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject/infus nesiritide') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15107 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
what hospital in los angeles county providing hospital beds specifically for rehabilitation is ranked at least among the top 10 hospitals ?
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text )
SELECT "hospital" FROM table_203_216 WHERE "county" = 'los angeles' AND "type of hospital" = 'rehabilitaion' AND "rank" <= 10
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what hospital in los angeles county providing hospital beds specifically for rehabilitation is ranked at least among the top 10 hospitals ? ### Input: CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text ) ### Response: SELECT "hospital" FROM table_203_216 WHERE "county" = 'los angeles' AND "type of hospital" = 'rehabilitaion' AND "rank" <= 10
what is the fare going from BOSTON to DALLAS FORT WORTH one way on 11 7
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 time_interval ( period text, begin_time int, end_time 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 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE 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 month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int )
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'FORT WORTH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND flight.to_airport = AIRPORT_SERVICE_2.airport_code) AND DATE_DAY_1.day_number = 7 AND DATE_DAY_1.month_number = 11 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND DATE_DAY_0.day_number = 7 AND DATE_DAY_0.month_number = 11 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare_basis.basis_days = DAYS_0.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND fare.round_trip_required = 'NO'
Below are sql tables 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 fare going from BOSTON to DALLAS FORT WORTH one way on 11 7 ### Input: CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 time_interval ( period text, begin_time int, end_time 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 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE 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 month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) ### Response: SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'FORT WORTH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND flight.to_airport = AIRPORT_SERVICE_2.airport_code) AND DATE_DAY_1.day_number = 7 AND DATE_DAY_1.month_number = 11 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND flight.flight_days = DAYS_1.days_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND DATE_DAY_0.day_number = 7 AND DATE_DAY_0.month_number = 11 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare_basis.basis_days = DAYS_0.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND fare.round_trip_required = 'NO'
What is the points against for the team that played 22 and lost 6?
CREATE TABLE table_name_81 ( points_against VARCHAR, played VARCHAR, lost VARCHAR )
SELECT points_against FROM table_name_81 WHERE played = "22" AND lost = "6"
Below are sql tables 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 points against for the team that played 22 and lost 6? ### Input: CREATE TABLE table_name_81 ( points_against VARCHAR, played VARCHAR, lost VARCHAR ) ### Response: SELECT points_against FROM table_name_81 WHERE played = "22" AND lost = "6"
Name the highest pick number for PI GP more than 55
CREATE TABLE table_55419 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
SELECT MAX("Pick #") FROM table_55419 WHERE "Pl GP" > '55'
Below are sql tables 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 highest pick number for PI GP more than 55 ### Input: CREATE TABLE table_55419 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real ) ### Response: SELECT MAX("Pick #") FROM table_55419 WHERE "Pl GP" > '55'
what is the date for tirrana?
CREATE TABLE table_8468 ( "Name" text, "Type" text, "Nationality" text, "Date" text, "Displacement" text )
SELECT "Date" FROM table_8468 WHERE "Name" = 'tirrana'
Below are sql tables 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 for tirrana? ### Input: CREATE TABLE table_8468 ( "Name" text, "Type" text, "Nationality" text, "Date" text, "Displacement" text ) ### Response: SELECT "Date" FROM table_8468 WHERE "Name" = 'tirrana'
What is the lowest round for the player Claude Periard?
CREATE TABLE table_9202 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
SELECT MIN("Round") FROM table_9202 WHERE "Player" = 'claude periard'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest round for the player Claude Periard? ### Input: CREATE TABLE table_9202 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) ### Response: SELECT MIN("Round") FROM table_9202 WHERE "Player" = 'claude periard'
What are the number of rooms for each bed type Show bar chart, order by the total number from low to high.
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER )
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of rooms for each bed type Show bar chart, order by the total number from low to high. ### Input: CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) ### Response: SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*)
What are the full names and ages for all female students whose sex is F?
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text )
SELECT fname, lname, age FROM student WHERE sex = 'F'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the full names and ages for all female students whose sex is F? ### Input: CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text ) ### Response: SELECT fname, lname, age FROM student WHERE sex = 'F'
How many hours were flown in each of the years where more than 64379058.0 kilometers were flown?
CREATE TABLE table_52 ( "Year" real, "Aircraft kilometers" real, "Departures" real, "Flying hours" real, "Passengers" real, "Seat factor" text, "Employees" real, "Profit/loss" text )
SELECT "Flying hours" FROM table_52 WHERE "Aircraft kilometers" > '64379058.0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many hours were flown in each of the years where more than 64379058.0 kilometers were flown? ### Input: CREATE TABLE table_52 ( "Year" real, "Aircraft kilometers" real, "Departures" real, "Flying hours" real, "Passengers" real, "Seat factor" text, "Employees" real, "Profit/loss" text ) ### Response: SELECT "Flying hours" FROM table_52 WHERE "Aircraft kilometers" > '64379058.0'
What is the capital (endonym) where Douglas is the Capital (exonym)?
CREATE TABLE table_1008653_9 ( capital___endonym__ VARCHAR, capital___exonym__ VARCHAR )
SELECT capital___endonym__ FROM table_1008653_9 WHERE capital___exonym__ = "Douglas"
Below are sql tables 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 capital (endonym) where Douglas is the Capital (exonym)? ### Input: CREATE TABLE table_1008653_9 ( capital___endonym__ VARCHAR, capital___exonym__ VARCHAR ) ### Response: SELECT capital___endonym__ FROM table_1008653_9 WHERE capital___exonym__ = "Douglas"
how many patients died within the same month after being diagnosed until 2102 with drug overdose- general?
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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE 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 )
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug overdose- general') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosistime) = t1.diagnosistime AND STRFTIME('%y', t1.diagnosistime) <= '2102') AS t2 JOIN (SELECT patient.uniquepid, patient.patienthealthsystemstayid, patient.hospitaldischargetime FROM patient WHERE patient.hospitaldischargestatus = 'expired') AS t3 ON t2.uniquepid = t3.uniquepid WHERE DATETIME(t2.diagnosistime, 'start of month') = DATETIME(t3.hospitaldischargetime, 'start of month')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients died within the same month after being diagnosed until 2102 with drug overdose- general? ### Input: 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE 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 ) ### Response: SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug overdose- general') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosistime) = t1.diagnosistime AND STRFTIME('%y', t1.diagnosistime) <= '2102') AS t2 JOIN (SELECT patient.uniquepid, patient.patienthealthsystemstayid, patient.hospitaldischargetime FROM patient WHERE patient.hospitaldischargestatus = 'expired') AS t3 ON t2.uniquepid = t3.uniquepid WHERE DATETIME(t2.diagnosistime, 'start of month') = DATETIME(t3.hospitaldischargetime, 'start of month')
is german above or below russia in the number of people who speak that language ?
CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number )
SELECT (SELECT "number" FROM table_203_88 WHERE "language" = 'german') > (SELECT "number" FROM table_203_88 WHERE "language" = 'russian')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is german above or below russia in the number of people who speak that language ? ### Input: CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number ) ### Response: SELECT (SELECT "number" FROM table_203_88 WHERE "language" = 'german') > (SELECT "number" FROM table_203_88 WHERE "language" = 'russian')
How many patients are with asian ethnicity and with lab test name gentamicin?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "ASIAN" AND lab.label = "Gentamicin"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients are with asian ethnicity and with lab test name gentamicin? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "ASIAN" AND lab.label = "Gentamicin"
what was the only nation to win less than 10 medals total ?
CREATE TABLE table_203_497 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT "nation" FROM table_203_497 WHERE "total" < 10
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the only nation to win less than 10 medals total ? ### Input: CREATE TABLE table_203_497 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) ### Response: SELECT "nation" FROM table_203_497 WHERE "total" < 10
which team is previous to cska moscow on team 1
CREATE TABLE table_204_510 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
SELECT "team 1" FROM table_204_510 WHERE id = (SELECT id FROM table_204_510 WHERE "team 1" = 'cska moscow') - 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which team is previous to cska moscow on team 1 ### Input: CREATE TABLE table_204_510 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text ) ### Response: SELECT "team 1" FROM table_204_510 WHERE id = (SELECT id FROM table_204_510 WHERE "team 1" = 'cska moscow') - 1
What is Place, when Player is 'Steve Pate'?
CREATE TABLE table_61132 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Place" FROM table_61132 WHERE "Player" = 'steve pate'
Below are sql tables 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 Place, when Player is 'Steve Pate'? ### Input: CREATE TABLE table_61132 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) ### Response: SELECT "Place" FROM table_61132 WHERE "Player" = 'steve pate'
What is the average game number when the record is 4-1?
CREATE TABLE table_48453 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
SELECT AVG("Game") FROM table_48453 WHERE "Record" = '4-1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average game number when the record is 4-1? ### Input: CREATE TABLE table_48453 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text ) ### Response: SELECT AVG("Game") FROM table_48453 WHERE "Record" = '4-1'
number of times patient 54281 was prescribed emtriva in their first hospital visit.
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time )
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'emtriva'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: number of times patient 54281 was prescribed emtriva in their first hospital visit. ### Input: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) ### Response: SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'emtriva'
Which Away team has a Venue of mcg?
CREATE TABLE table_name_82 ( away_team VARCHAR, venue VARCHAR )
SELECT away_team FROM table_name_82 WHERE venue = "mcg"
Below are sql tables 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 Away team has a Venue of mcg? ### Input: CREATE TABLE table_name_82 ( away_team VARCHAR, venue VARCHAR ) ### Response: SELECT away_team FROM table_name_82 WHERE venue = "mcg"
What is the number of contestants who are 5'7' and exactly 26 years of age?
CREATE TABLE table_27692 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text )
SELECT COUNT("Contestant") FROM table_27692 WHERE "Height (ft)" = '5''7' AND "Age" = '26'
Below are sql tables 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 contestants who are 5'7' and exactly 26 years of age? ### Input: CREATE TABLE table_27692 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text ) ### Response: SELECT COUNT("Contestant") FROM table_27692 WHERE "Height (ft)" = '5''7' AND "Age" = '26'
plot scatter on what is the average price range of hotels for each each star rating code?
CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Theme_Parks ( Theme_Park_ID INTEGER, Theme_Park_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) ) CREATE TABLE Museums ( Museum_ID INTEGER, Museum_Details VARCHAR(255) ) CREATE TABLE Visits ( Visit_ID INTEGER, Tourist_Attraction_ID INTEGER, Tourist_ID INTEGER, Visit_Date DATETIME, Visit_Details VARCHAR(40) ) CREATE TABLE Ref_Hotel_Star_Ratings ( star_rating_code CHAR(15), star_rating_description VARCHAR(80) ) CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Attraction_Types ( Attraction_Type_Code CHAR(15), Attraction_Type_Description VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) ) CREATE TABLE Tourist_Attraction_Features ( Tourist_Attraction_ID INTEGER, Feature_ID INTEGER ) CREATE TABLE Photos ( Photo_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(255), Description VARCHAR(255), Filename VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_hotel_details VARCHAR(255) ) CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) ) CREATE TABLE Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) ) CREATE TABLE Tourist_Attractions ( Tourist_Attraction_ID INTEGER, Attraction_Type_Code CHAR(15), Location_ID INTEGER, How_to_Get_There VARCHAR(255), Name VARCHAR(255), Description VARCHAR(255), Opening_Hours VARCHAR(255), Other_Details VARCHAR(255) )
SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: plot scatter on what is the average price range of hotels for each each star rating code? ### Input: CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Theme_Parks ( Theme_Park_ID INTEGER, Theme_Park_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) ) CREATE TABLE Museums ( Museum_ID INTEGER, Museum_Details VARCHAR(255) ) CREATE TABLE Visits ( Visit_ID INTEGER, Tourist_Attraction_ID INTEGER, Tourist_ID INTEGER, Visit_Date DATETIME, Visit_Details VARCHAR(40) ) CREATE TABLE Ref_Hotel_Star_Ratings ( star_rating_code CHAR(15), star_rating_description VARCHAR(80) ) CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Attraction_Types ( Attraction_Type_Code CHAR(15), Attraction_Type_Description VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) ) CREATE TABLE Tourist_Attraction_Features ( Tourist_Attraction_ID INTEGER, Feature_ID INTEGER ) CREATE TABLE Photos ( Photo_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(255), Description VARCHAR(255), Filename VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_hotel_details VARCHAR(255) ) CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) ) CREATE TABLE Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) ) CREATE TABLE Tourist_Attractions ( Tourist_Attraction_ID INTEGER, Attraction_Type_Code CHAR(15), Location_ID INTEGER, How_to_Get_There VARCHAR(255), Name VARCHAR(255), Description VARCHAR(255), Opening_Hours VARCHAR(255), Other_Details VARCHAR(255) ) ### Response: SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code
What is the lowest par for Bobby Cruickshank?
CREATE TABLE table_13160 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
SELECT MIN("To par") FROM table_13160 WHERE "Player" = 'bobby cruickshank'
Below are sql tables 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 par for Bobby Cruickshank? ### Input: CREATE TABLE table_13160 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) ### Response: SELECT MIN("To par") FROM table_13160 WHERE "Player" = 'bobby cruickshank'
Who was the opponent in week 13?
CREATE TABLE table_79230 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text )
SELECT "Opponent" FROM table_79230 WHERE "Week" = '13'
Below are sql tables 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 week 13? ### Input: CREATE TABLE table_79230 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text ) ### Response: SELECT "Opponent" FROM table_79230 WHERE "Week" = '13'
What leading man earlier than 1932 was directed by archie mayo?
CREATE TABLE table_name_1 ( leading_man VARCHAR, year VARCHAR, director VARCHAR )
SELECT leading_man FROM table_name_1 WHERE year < 1932 AND director = "archie mayo"
Below are sql tables 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 leading man earlier than 1932 was directed by archie mayo? ### Input: CREATE TABLE table_name_1 ( leading_man VARCHAR, year VARCHAR, director VARCHAR ) ### Response: SELECT leading_man FROM table_name_1 WHERE year < 1932 AND director = "archie mayo"
What was week 17's date?
CREATE TABLE table_47964 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Date" FROM table_47964 WHERE "Week" = '17'
Below are sql tables 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 week 17's date? ### Input: CREATE TABLE table_47964 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) ### Response: SELECT "Date" FROM table_47964 WHERE "Week" = '17'
Which 2013 has a 2006 of grand slam tournaments?
CREATE TABLE table_33983 ( "Tournament" text, "2006" text, "2007" text, "2008-12" text, "2013" text )
SELECT "2013" FROM table_33983 WHERE "2006" = 'grand slam tournaments'
Below are sql tables 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 2013 has a 2006 of grand slam tournaments? ### Input: CREATE TABLE table_33983 ( "Tournament" text, "2006" text, "2007" text, "2008-12" text, "2013" text ) ### Response: SELECT "2013" FROM table_33983 WHERE "2006" = 'grand slam tournaments'
When dennis ross (r) unopposed is the candidate what is the party?
CREATE TABLE table_3186 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
SELECT "Party" FROM table_3186 WHERE "Candidates" = 'Dennis Ross (R) unopposed'
Below are sql tables 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 dennis ross (r) unopposed is the candidate what is the party? ### Input: CREATE TABLE table_3186 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) ### Response: SELECT "Party" FROM table_3186 WHERE "Candidates" = 'Dennis Ross (R) unopposed'
What party was Kevin Brady?
CREATE TABLE table_1341395_44 ( party VARCHAR, incumbent VARCHAR )
SELECT party FROM table_1341395_44 WHERE incumbent = "Kevin Brady"
Below are sql tables 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 party was Kevin Brady? ### Input: CREATE TABLE table_1341395_44 ( party VARCHAR, incumbent VARCHAR ) ### Response: SELECT party FROM table_1341395_44 WHERE incumbent = "Kevin Brady"
how many patients have diagnoses icd9 code 28803?
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "28803"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have diagnoses icd9 code 28803? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "28803"
Which City or town has top division smaller than 40 and Gaziantepspor Club ?
CREATE TABLE table_name_70 ( city_or_town VARCHAR, number_of_seasons_in_top_division VARCHAR, club VARCHAR )
SELECT city_or_town FROM table_name_70 WHERE number_of_seasons_in_top_division < 40 AND club = "gaziantepspor"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which City or town has top division smaller than 40 and Gaziantepspor Club ? ### Input: CREATE TABLE table_name_70 ( city_or_town VARCHAR, number_of_seasons_in_top_division VARCHAR, club VARCHAR ) ### Response: SELECT city_or_town FROM table_name_70 WHERE number_of_seasons_in_top_division < 40 AND club = "gaziantepspor"
count the number of patients whose ethnicity is black/cape verdean and item id is 51249?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.itemid = "51249"
Below are sql tables 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 ethnicity is black/cape verdean and item id is 51249? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.itemid = "51249"
Round of 9 involved what name?
CREATE TABLE table_69683 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT "Name" FROM table_69683 WHERE "Round" = '9'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Round of 9 involved what name? ### Input: CREATE TABLE table_69683 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) ### Response: SELECT "Name" FROM table_69683 WHERE "Round" = '9'
Name the us exclusive for miley cyrus
CREATE TABLE table_24600706_1 ( us_exclusive VARCHAR, artist_band VARCHAR )
SELECT us_exclusive FROM table_24600706_1 WHERE artist_band = "Miley Cyrus"
Below are sql tables 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 us exclusive for miley cyrus ### Input: CREATE TABLE table_24600706_1 ( us_exclusive VARCHAR, artist_band VARCHAR ) ### Response: SELECT us_exclusive FROM table_24600706_1 WHERE artist_band = "Miley Cyrus"
Which Gold has a Bronze larger than 6?
CREATE TABLE table_36676 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Gold") FROM table_36676 WHERE "Bronze" > '6'
Below are sql tables 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 Gold has a Bronze larger than 6? ### Input: CREATE TABLE table_36676 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) ### Response: SELECT MIN("Gold") FROM table_36676 WHERE "Bronze" > '6'
What is Tony Jacklin's total?
CREATE TABLE table_name_33 ( total VARCHAR, player VARCHAR )
SELECT total FROM table_name_33 WHERE player = "tony jacklin"
Below are sql tables 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 Tony Jacklin's total? ### Input: CREATE TABLE table_name_33 ( total VARCHAR, player VARCHAR ) ### Response: SELECT total FROM table_name_33 WHERE player = "tony jacklin"
When the clippers are the team how many games are there?
CREATE TABLE table_25870 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT COUNT("Game") FROM table_25870 WHERE "Team" = 'Clippers'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the clippers are the team how many games are there? ### Input: CREATE TABLE table_25870 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) ### Response: SELECT COUNT("Game") FROM table_25870 WHERE "Team" = 'Clippers'
Who is Winners that has editions of 1992, 2003 as Not Winning
CREATE TABLE table_name_77 ( winners VARCHAR, not_winning_editions VARCHAR )
SELECT winners FROM table_name_77 WHERE not_winning_editions = "1992, 2003"
Below are sql tables 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 Winners that has editions of 1992, 2003 as Not Winning ### Input: CREATE TABLE table_name_77 ( winners VARCHAR, not_winning_editions VARCHAR ) ### Response: SELECT winners FROM table_name_77 WHERE not_winning_editions = "1992, 2003"
Who was the opponent in week 4?
CREATE TABLE table_19637 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
SELECT "Opponent" FROM table_19637 WHERE "Week" = '4'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent in week 4? ### Input: CREATE TABLE table_19637 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) ### Response: SELECT "Opponent" FROM table_19637 WHERE "Week" = '4'
What are the family relations of the king with the throne name 303?
CREATE TABLE table_36347 ( "Throne Name" text, "Title" text, "Born-Died" text, "Entered office" text, "Left office" text, "Family Relations" text )
SELECT "Family Relations" FROM table_36347 WHERE "Throne Name" = '303'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the family relations of the king with the throne name 303? ### Input: CREATE TABLE table_36347 ( "Throne Name" text, "Title" text, "Born-Died" text, "Entered office" text, "Left office" text, "Family Relations" text ) ### Response: SELECT "Family Relations" FROM table_36347 WHERE "Throne Name" = '303'
What was the location of the match that had a result of 3-3?
CREATE TABLE table_47982 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
SELECT "Location" FROM table_47982 WHERE "Result" = '3-3'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the location of the match that had a result of 3-3? ### Input: CREATE TABLE table_47982 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text ) ### Response: SELECT "Location" FROM table_47982 WHERE "Result" = '3-3'
Which Round has a Player of damon jones?
CREATE TABLE table_51067 ( "Round" real, "Pick" real, "Player" text, "Position" text, "College" text )
SELECT SUM("Round") FROM table_51067 WHERE "Player" = 'damon jones'
Below are sql tables 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 Round has a Player of damon jones? ### Input: CREATE TABLE table_51067 ( "Round" real, "Pick" real, "Player" text, "Position" text, "College" text ) ### Response: SELECT SUM("Round") FROM table_51067 WHERE "Player" = 'damon jones'
what are all the gold medals when the silver medals is smaller than 1.0?
CREATE TABLE table_17964 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
SELECT "Gold Medals" FROM table_17964 WHERE "Silver Medals" < '1.0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are all the gold medals when the silver medals is smaller than 1.0? ### Input: CREATE TABLE table_17964 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real ) ### Response: SELECT "Gold Medals" FROM table_17964 WHERE "Silver Medals" < '1.0'
list the cheapest one way flight from MIAMI FLORIDA to CHARLOTTE NORTH CAROLINA
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare, state AS STATE_0, state AS STATE_1 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MIAMI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND STATE_0.state_code = CITY_0.state_code AND STATE_0.state_name = 'FLORIDA' AND STATE_1.state_code = CITY_1.state_code AND STATE_1.state_name = 'NORTH CAROLINA') AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1, state AS STATEalias2, state AS STATEalias3 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'MIAMI' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'CHARLOTTE' AND FAREalias1.round_trip_required = 'NO' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code AND STATEalias2.state_code = CITYalias2.state_code AND STATEalias2.state_name = 'FLORIDA' AND STATEalias3.state_code = CITYalias3.state_code AND STATEalias3.state_name = 'NORTH CAROLINA') AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the cheapest one way flight from MIAMI FLORIDA to CHARLOTTE NORTH CAROLINA ### Input: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare, state AS STATE_0, state AS STATE_1 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MIAMI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND STATE_0.state_code = CITY_0.state_code AND STATE_0.state_name = 'FLORIDA' AND STATE_1.state_code = CITY_1.state_code AND STATE_1.state_name = 'NORTH CAROLINA') AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1, state AS STATEalias2, state AS STATEalias3 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'MIAMI' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'CHARLOTTE' AND FAREalias1.round_trip_required = 'NO' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code AND STATEalias2.state_code = CITYalias2.state_code AND STATEalias2.state_name = 'FLORIDA' AND STATEalias3.state_code = CITYalias3.state_code AND STATEalias3.state_name = 'NORTH CAROLINA') AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
what 's the capacity of an F28
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE flight ( 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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
SELECT DISTINCT aircraft_code FROM aircraft WHERE basic_type = 'F28'
Below are sql tables 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 capacity of an F28 ### Input: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) CREATE TABLE flight ( 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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) ### Response: SELECT DISTINCT aircraft_code FROM aircraft WHERE basic_type = 'F28'
How many schools did Derrick Green attend?
CREATE TABLE table_11677691_11 ( school VARCHAR, player VARCHAR )
SELECT COUNT(school) FROM table_11677691_11 WHERE player = "Derrick Green"
Below are sql tables 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 schools did Derrick Green attend? ### Input: CREATE TABLE table_11677691_11 ( school VARCHAR, player VARCHAR ) ### Response: SELECT COUNT(school) FROM table_11677691_11 WHERE player = "Derrick Green"
In New Zealand, what's the value that has an unknown date and is an energy business?
CREATE TABLE table_71611 ( "Date" text, "Company" text, "Business" text, "Country" text, "Value ( USD )" text )
SELECT "Value ( USD )" FROM table_71611 WHERE "Date" = 'unknown' AND "Business" = 'energy' AND "Country" = 'new zealand'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In New Zealand, what's the value that has an unknown date and is an energy business? ### Input: CREATE TABLE table_71611 ( "Date" text, "Company" text, "Business" text, "Country" text, "Value ( USD )" text ) ### Response: SELECT "Value ( USD )" FROM table_71611 WHERE "Date" = 'unknown' AND "Business" = 'energy' AND "Country" = 'new zealand'
What is Score, when Team is 'Washington'?
CREATE TABLE table_name_81 ( score VARCHAR, team VARCHAR )
SELECT score FROM table_name_81 WHERE team = "washington"
Below are sql tables 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 Score, when Team is 'Washington'? ### Input: CREATE TABLE table_name_81 ( score VARCHAR, team VARCHAR ) ### Response: SELECT score FROM table_name_81 WHERE team = "washington"
How many games have a Result of 4 0, and an Attendance larger than 12,256?
CREATE TABLE table_62815 ( "Game" real, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
SELECT COUNT("Game") FROM table_62815 WHERE "Result" = '4–0' AND "Attendance" > '12,256'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games have a Result of 4 0, and an Attendance larger than 12,256? ### Input: CREATE TABLE table_62815 ( "Game" real, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) ### Response: SELECT COUNT("Game") FROM table_62815 WHERE "Result" = '4–0' AND "Attendance" > '12,256'
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, order X from high to low order.
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT )
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY booking_status_code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, order X from high to low order. ### Input: CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) ### Response: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY booking_status_code DESC
count the number of patients on ng route of drug administration who have diagnoses icd9 code 99799.
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "99799" AND prescriptions.route = "NG"
Below are sql tables 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 on ng route of drug administration who have diagnoses icd9 code 99799. ### 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "99799" AND prescriptions.route = "NG"
how many patients aged below 83 years had the drug code cipr200pm?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "CIPR200PM"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients aged below 83 years had the drug code cipr200pm? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "CIPR200PM"
how many black/haitian american patients had the drug name collagenase ointment
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug = "Collagenase Ointment"
Below are sql tables 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 black/haitian american patients had the drug name collagenase ointment ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug = "Collagenase Ointment"
What was the date for the game in week 7?
CREATE TABLE table_52230 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Date" FROM table_52230 WHERE "Week" = '7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date for the game in week 7? ### Input: CREATE TABLE table_52230 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) ### Response: SELECT "Date" FROM table_52230 WHERE "Week" = '7'
Compare the distribution of the players' gender using a bar chart, show by the total number from high to low please.
CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int )
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Compare the distribution of the players' gender using a bar chart, show by the total number from high to low please. ### Input: CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) ### Response: SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) DESC
List all the results for mahmoud ahmadinejad when candidate mir-hossein mousavi obtained 218481 votes.
CREATE TABLE table_26001 ( "Province" text, "Mahmoud Ahmadinejad" real, "Mehdi Karroubi" real, "Mir-Hossein Mousavi" real, "Mohsen Rezaee" real, "Spoiled ballots" real, "Total votes" real )
SELECT "Mahmoud Ahmadinejad" FROM table_26001 WHERE "Mir-Hossein Mousavi" = '218481'
Below are sql tables 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 the results for mahmoud ahmadinejad when candidate mir-hossein mousavi obtained 218481 votes. ### Input: CREATE TABLE table_26001 ( "Province" text, "Mahmoud Ahmadinejad" real, "Mehdi Karroubi" real, "Mir-Hossein Mousavi" real, "Mohsen Rezaee" real, "Spoiled ballots" real, "Total votes" real ) ### Response: SELECT "Mahmoud Ahmadinejad" FROM table_26001 WHERE "Mir-Hossein Mousavi" = '218481'
What locations did sid o'neill play football?
CREATE TABLE table_16527640_2 ( location VARCHAR, player VARCHAR )
SELECT location FROM table_16527640_2 WHERE player = "Sid O'Neill"
Below are sql tables 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 locations did sid o'neill play football? ### Input: CREATE TABLE table_16527640_2 ( location VARCHAR, player VARCHAR ) ### Response: SELECT location FROM table_16527640_2 WHERE player = "Sid O'Neill"
How much Drawn has Goals Against larger than 74, and a Lost smaller than 20, and a Played larger than 38?
CREATE TABLE table_name_43 ( drawn VARCHAR, played VARCHAR, goals_against VARCHAR, lost VARCHAR )
SELECT COUNT(drawn) FROM table_name_43 WHERE goals_against > 74 AND lost < 20 AND played > 38
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Drawn has Goals Against larger than 74, and a Lost smaller than 20, and a Played larger than 38? ### Input: CREATE TABLE table_name_43 ( drawn VARCHAR, played VARCHAR, goals_against VARCHAR, lost VARCHAR ) ### Response: SELECT COUNT(drawn) FROM table_name_43 WHERE goals_against > 74 AND lost < 20 AND played > 38
Number of posts by user from France or India per age and location.
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
SELECT a2."age" AS "Age", a2.Location AS "Location", COUNT(*) AS "count_posts" FROM "Posts " AS a1 LEFT OUTER JOIN Users AS a2 ON (a2.Id = a1."LastEditorUserId ") WHERE (a2.Location IN ('France', 'India')) GROUP BY a2."age", a2.Location ORDER BY 'Age' DESC, 'Location' DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of posts by user from France or India per age and location. ### Input: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) ### Response: SELECT a2."age" AS "Age", a2.Location AS "Location", COUNT(*) AS "count_posts" FROM "Posts " AS a1 LEFT OUTER JOIN Users AS a2 ON (a2.Id = a1."LastEditorUserId ") WHERE (a2.Location IN ('France', 'India')) GROUP BY a2."age", a2.Location ORDER BY 'Age' DESC, 'Location' DESC
What was the score of the game that led to a 79-77 record?
CREATE TABLE table_name_64 ( score VARCHAR, record VARCHAR )
SELECT score FROM table_name_64 WHERE record = "79-77"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the game that led to a 79-77 record? ### Input: CREATE TABLE table_name_64 ( score VARCHAR, record VARCHAR ) ### Response: SELECT score FROM table_name_64 WHERE record = "79-77"
how many times is the seasons 2 and the coach guy lowman?
CREATE TABLE table_9759 ( "Coach" text, "Years" text, "Seasons" real, "Record" text, "Winning %" real )
SELECT COUNT("Winning %") FROM table_9759 WHERE "Seasons" = '2' AND "Coach" = 'guy lowman'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times is the seasons 2 and the coach guy lowman? ### Input: CREATE TABLE table_9759 ( "Coach" text, "Years" text, "Seasons" real, "Record" text, "Winning %" real ) ### Response: SELECT COUNT("Winning %") FROM table_9759 WHERE "Seasons" = '2' AND "Coach" = 'guy lowman'
between what years was tears of the antarctic shown ?
CREATE TABLE table_204_379 ( id number, "year" text, "title" text, "hangul" text, "network" text, "further info" text )
SELECT "year" FROM table_204_379 WHERE "title" = 'tears of the antarctic'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: between what years was tears of the antarctic shown ? ### Input: CREATE TABLE table_204_379 ( id number, "year" text, "title" text, "hangul" text, "network" text, "further info" text ) ### Response: SELECT "year" FROM table_204_379 WHERE "title" = 'tears of the antarctic'
Show me the frequency of those years (bin year into year interval) that the team Boston Red Stockings won in the postseasons with a bar chart, I want to order by the x axis in desc please.
CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE player_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes TEXT ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, points_max INTEGER, votes_first NUMERIC ) CREATE TABLE manager ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, g INTEGER, w INTEGER, l INTEGER, rank NUMERIC, plyr_mgr TEXT ) CREATE TABLE park ( park_id TEXT, park_name TEXT, park_alias TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE hall_of_fame ( player_id TEXT, yearid INTEGER, votedby TEXT, ballots NUMERIC, needed NUMERIC, votes NUMERIC, inducted TEXT, category TEXT, needed_note TEXT ) CREATE TABLE fielding_postseason ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, round TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po INTEGER, a INTEGER, e INTEGER, dp INTEGER, tp INTEGER, pb NUMERIC, sb NUMERIC, cs NUMERIC ) CREATE TABLE team_franchise ( franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT ) CREATE TABLE batting_postseason ( year INTEGER, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INTEGER, ab INTEGER, r INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, rbi INTEGER, sb INTEGER, cs NUMERIC, bb INTEGER, so INTEGER, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, g INTEGER, ghome NUMERIC, w INTEGER, l INTEGER, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r INTEGER, ab INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, bb INTEGER, so NUMERIC, sb NUMERIC, cs NUMERIC, hbp NUMERIC, sf NUMERIC, ra INTEGER, er INTEGER, era NUMERIC, cg INTEGER, sho INTEGER, sv INTEGER, ipouts INTEGER, ha INTEGER, hra INTEGER, bba INTEGER, soa INTEGER, e INTEGER, dp NUMERIC, fp NUMERIC, name TEXT, park TEXT, attendance NUMERIC, bpf INTEGER, ppf INTEGER, team_id_br TEXT, team_id_lahman45 TEXT, team_id_retro TEXT ) CREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC, r NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, rbi NUMERIC, sb NUMERIC, cs NUMERIC, bb NUMERIC, so NUMERIC, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts NUMERIC, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so INTEGER, baopp NUMERIC, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk INTEGER, bfp NUMERIC, gf NUMERIC, r INTEGER, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE fielding ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po NUMERIC, a NUMERIC, e NUMERIC, dp NUMERIC, pb NUMERIC, wp NUMERIC, sb NUMERIC, cs NUMERIC, zr NUMERIC ) CREATE TABLE team_half ( year INTEGER, league_id TEXT, team_id TEXT, half INTEGER, div_id TEXT, div_win TEXT, rank INTEGER, g INTEGER, w INTEGER, l INTEGER ) CREATE TABLE manager_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes NUMERIC ) CREATE TABLE postseason ( year INTEGER, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INTEGER, losses INTEGER, ties INTEGER ) CREATE TABLE pitching_postseason ( player_id TEXT, year INTEGER, round TEXT, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts INTEGER, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so INTEGER, baopp TEXT, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk NUMERIC, bfp NUMERIC, gf INTEGER, r INTEGER, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE all_star ( player_id TEXT, year INTEGER, game_num INTEGER, game_id TEXT, team_id TEXT, league_id TEXT, gp NUMERIC, starting_pos NUMERIC ) CREATE TABLE player ( player_id TEXT, birth_year NUMERIC, birth_month NUMERIC, birth_day NUMERIC, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year NUMERIC, death_month NUMERIC, death_day NUMERIC, death_country TEXT, death_state TEXT, death_city TEXT, name_first TEXT, name_last TEXT, name_given TEXT, weight NUMERIC, height NUMERIC, bats TEXT, throws TEXT, debut TEXT, final_game TEXT, retro_id TEXT, bbref_id TEXT ) CREATE TABLE player_college ( player_id TEXT, college_id TEXT, year INTEGER ) CREATE TABLE manager_half ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, half INTEGER, g INTEGER, w INTEGER, l INTEGER, rank INTEGER ) CREATE TABLE college ( college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE home_game ( year INTEGER, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INTEGER, openings INTEGER, attendance INTEGER ) CREATE TABLE appearances ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, g_all NUMERIC, gs NUMERIC, g_batting INTEGER, g_defense NUMERIC, g_p INTEGER, g_c INTEGER, g_1b INTEGER, g_2b INTEGER, g_3b INTEGER, g_ss INTEGER, g_lf INTEGER, g_cf INTEGER, g_rf INTEGER, g_of INTEGER, g_dh NUMERIC, g_ph NUMERIC, g_pr NUMERIC )
SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me the frequency of those years (bin year into year interval) that the team Boston Red Stockings won in the postseasons with a bar chart, I want to order by the x axis in desc please. ### Input: CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE player_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes TEXT ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, points_max INTEGER, votes_first NUMERIC ) CREATE TABLE manager ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, g INTEGER, w INTEGER, l INTEGER, rank NUMERIC, plyr_mgr TEXT ) CREATE TABLE park ( park_id TEXT, park_name TEXT, park_alias TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE hall_of_fame ( player_id TEXT, yearid INTEGER, votedby TEXT, ballots NUMERIC, needed NUMERIC, votes NUMERIC, inducted TEXT, category TEXT, needed_note TEXT ) CREATE TABLE fielding_postseason ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, round TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po INTEGER, a INTEGER, e INTEGER, dp INTEGER, tp INTEGER, pb NUMERIC, sb NUMERIC, cs NUMERIC ) CREATE TABLE team_franchise ( franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT ) CREATE TABLE batting_postseason ( year INTEGER, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INTEGER, ab INTEGER, r INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, rbi INTEGER, sb INTEGER, cs NUMERIC, bb INTEGER, so INTEGER, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, g INTEGER, ghome NUMERIC, w INTEGER, l INTEGER, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r INTEGER, ab INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, bb INTEGER, so NUMERIC, sb NUMERIC, cs NUMERIC, hbp NUMERIC, sf NUMERIC, ra INTEGER, er INTEGER, era NUMERIC, cg INTEGER, sho INTEGER, sv INTEGER, ipouts INTEGER, ha INTEGER, hra INTEGER, bba INTEGER, soa INTEGER, e INTEGER, dp NUMERIC, fp NUMERIC, name TEXT, park TEXT, attendance NUMERIC, bpf INTEGER, ppf INTEGER, team_id_br TEXT, team_id_lahman45 TEXT, team_id_retro TEXT ) CREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC, r NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, rbi NUMERIC, sb NUMERIC, cs NUMERIC, bb NUMERIC, so NUMERIC, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts NUMERIC, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so INTEGER, baopp NUMERIC, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk INTEGER, bfp NUMERIC, gf NUMERIC, r INTEGER, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE fielding ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po NUMERIC, a NUMERIC, e NUMERIC, dp NUMERIC, pb NUMERIC, wp NUMERIC, sb NUMERIC, cs NUMERIC, zr NUMERIC ) CREATE TABLE team_half ( year INTEGER, league_id TEXT, team_id TEXT, half INTEGER, div_id TEXT, div_win TEXT, rank INTEGER, g INTEGER, w INTEGER, l INTEGER ) CREATE TABLE manager_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes NUMERIC ) CREATE TABLE postseason ( year INTEGER, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INTEGER, losses INTEGER, ties INTEGER ) CREATE TABLE pitching_postseason ( player_id TEXT, year INTEGER, round TEXT, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts INTEGER, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so INTEGER, baopp TEXT, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk NUMERIC, bfp NUMERIC, gf INTEGER, r INTEGER, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE all_star ( player_id TEXT, year INTEGER, game_num INTEGER, game_id TEXT, team_id TEXT, league_id TEXT, gp NUMERIC, starting_pos NUMERIC ) CREATE TABLE player ( player_id TEXT, birth_year NUMERIC, birth_month NUMERIC, birth_day NUMERIC, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year NUMERIC, death_month NUMERIC, death_day NUMERIC, death_country TEXT, death_state TEXT, death_city TEXT, name_first TEXT, name_last TEXT, name_given TEXT, weight NUMERIC, height NUMERIC, bats TEXT, throws TEXT, debut TEXT, final_game TEXT, retro_id TEXT, bbref_id TEXT ) CREATE TABLE player_college ( player_id TEXT, college_id TEXT, year INTEGER ) CREATE TABLE manager_half ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, half INTEGER, g INTEGER, w INTEGER, l INTEGER, rank INTEGER ) CREATE TABLE college ( college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE home_game ( year INTEGER, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INTEGER, openings INTEGER, attendance INTEGER ) CREATE TABLE appearances ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, g_all NUMERIC, gs NUMERIC, g_batting INTEGER, g_defense NUMERIC, g_p INTEGER, g_c INTEGER, g_1b INTEGER, g_2b INTEGER, g_3b INTEGER, g_ss INTEGER, g_lf INTEGER, g_cf INTEGER, g_rf INTEGER, g_of INTEGER, g_dh NUMERIC, g_ph NUMERIC, g_pr NUMERIC ) ### Response: SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
What's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of scheduled time (over three months)?
CREATE TABLE table_1636 ( "Period" text, "% trains arriving within 5 mins of scheduled time (over three months)" text, "Change over same quarter the previous year" text, "% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text, "Change over previous year as a whole" text )
SELECT "Change over same quarter the previous year" FROM table_1636 WHERE "% trains arriving within 5 mins of scheduled time (over three months)" = '89.6%'
Below are sql tables 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 change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of scheduled time (over three months)? ### Input: CREATE TABLE table_1636 ( "Period" text, "% trains arriving within 5 mins of scheduled time (over three months)" text, "Change over same quarter the previous year" text, "% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text, "Change over previous year as a whole" text ) ### Response: SELECT "Change over same quarter the previous year" FROM table_1636 WHERE "% trains arriving within 5 mins of scheduled time (over three months)" = '89.6%'
In 1978 what is the NFL team?
CREATE TABLE table_name_30 ( nfl_team VARCHAR, draft_year VARCHAR )
SELECT nfl_team FROM table_name_30 WHERE draft_year = 1978
Below are sql tables 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 1978 what is the NFL team? ### Input: CREATE TABLE table_name_30 ( nfl_team VARCHAR, draft_year VARCHAR ) ### Response: SELECT nfl_team FROM table_name_30 WHERE draft_year = 1978
next manager of ttm samut sakhon after prajuk viengsong
CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text )
SELECT "name" FROM table_204_805 WHERE "club" = 'ttm samut sakhon' AND "date of departure" > (SELECT "date of departure" FROM table_204_805 WHERE "name" = 'prajuk viengsong') ORDER BY "date of departure" LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: next manager of ttm samut sakhon after prajuk viengsong ### Input: CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text ) ### Response: SELECT "name" FROM table_204_805 WHERE "club" = 'ttm samut sakhon' AND "date of departure" > (SELECT "date of departure" FROM table_204_805 WHERE "name" = 'prajuk viengsong') ORDER BY "date of departure" LIMIT 1
What is the total number of Games, when Losses is greater than 6, when Club is 'Club Sportif Sfaxien', and when Wins is less than 3?
CREATE TABLE table_12918 ( "Club" text, "Games" real, "Wins" real, "Losses" real, "Draws" real )
SELECT COUNT("Games") FROM table_12918 WHERE "Losses" > '6' AND "Club" = 'club sportif sfaxien' AND "Wins" < '3'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Games, when Losses is greater than 6, when Club is 'Club Sportif Sfaxien', and when Wins is less than 3? ### Input: CREATE TABLE table_12918 ( "Club" text, "Games" real, "Wins" real, "Losses" real, "Draws" real ) ### Response: SELECT COUNT("Games") FROM table_12918 WHERE "Losses" > '6' AND "Club" = 'club sportif sfaxien' AND "Wins" < '3'
Bar chart x axis card type code y axis the total number, and display by the y-axis from high to low please.
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) )
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis card type code y axis the total number, and display by the y-axis from high to low please. ### Input: CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) ### Response: SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
how many patients whose admission type is urgent and item id is 50806?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50806"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is urgent and item id is 50806? ### 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50806"
In next semester , the number of MKT classes offered is ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction 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 ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_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 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 comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
Below are sql tables 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 next semester , the number of MKT classes offered is ? ### Input: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction 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 ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_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 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 comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) ### Response: SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
what is discharge location and primary disease of subject name charley pescatore?
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 demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.name = "Charley Pescatore"
Below are sql tables 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 discharge location and primary disease of subject name charley pescatore? ### 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 demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.name = "Charley Pescatore"
What was the turnout percentage when the percentage of people that voted no was 36.51?
CREATE TABLE table_29392 ( "Province" text, "Registered voters" real, "People voted" real, "Valid votes" real, "Invalid votes" real, "Yes" real, "Yes (%)" text, "No" real, "No (%)" text, "Turnout (%)" text )
SELECT "Turnout (%)" FROM table_29392 WHERE "No (%)" = '36.51'
Below are sql tables 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 turnout percentage when the percentage of people that voted no was 36.51? ### Input: CREATE TABLE table_29392 ( "Province" text, "Registered voters" real, "People voted" real, "Valid votes" real, "Invalid votes" real, "Yes" real, "Yes (%)" text, "No" real, "No (%)" text, "Turnout (%)" text ) ### Response: SELECT "Turnout (%)" FROM table_29392 WHERE "No (%)" = '36.51'
What was the lowest Attendance on 8 October 1986?
CREATE TABLE table_7385 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
SELECT MIN("Attendance") FROM table_7385 WHERE "Date" = '8 october 1986'
Below are sql tables 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 Attendance on 8 October 1986? ### Input: CREATE TABLE table_7385 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) ### Response: SELECT MIN("Attendance") FROM table_7385 WHERE "Date" = '8 october 1986'
What's the frequency of the device that has a Multi 1 of 7.5 ?
CREATE TABLE table_name_28 ( frequency VARCHAR, multi_1 VARCHAR )
SELECT frequency FROM table_name_28 WHERE multi_1 = "7.5×"
Below are sql tables 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 frequency of the device that has a Multi 1 of 7.5 ? ### Input: CREATE TABLE table_name_28 ( frequency VARCHAR, multi_1 VARCHAR ) ### Response: SELECT frequency FROM table_name_28 WHERE multi_1 = "7.5×"
which had the least amount of time ?
CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
SELECT "competition" FROM table_203_734 ORDER BY "notes" LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which had the least amount of time ? ### Input: CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) ### Response: SELECT "competition" FROM table_203_734 ORDER BY "notes" LIMIT 1
What's Great Britain's lane with a heat less than 3?
CREATE TABLE table_name_40 ( lane INTEGER, nationality VARCHAR, heat VARCHAR )
SELECT AVG(lane) FROM table_name_40 WHERE nationality = "great britain" AND heat < 3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's Great Britain's lane with a heat less than 3? ### Input: CREATE TABLE table_name_40 ( lane INTEGER, nationality VARCHAR, heat VARCHAR ) ### Response: SELECT AVG(lane) FROM table_name_40 WHERE nationality = "great britain" AND heat < 3
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and employee_id , show in asc by the y-axis please.
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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) )
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and employee_id , show in asc by the y-axis please. ### 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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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) ) ### Response: SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
What was the maximum amount of the poles?
CREATE TABLE table_2190919_3 ( poles INTEGER )
SELECT MAX(poles) FROM table_2190919_3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the maximum amount of the poles? ### Input: CREATE TABLE table_2190919_3 ( poles INTEGER ) ### Response: SELECT MAX(poles) FROM table_2190919_3
What is the affiliation of a location called Issaquah?
CREATE TABLE table_name_51 ( affiliation VARCHAR, location VARCHAR )
SELECT affiliation FROM table_name_51 WHERE location = "issaquah"
Below are sql tables 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 affiliation of a location called Issaquah? ### Input: CREATE TABLE table_name_51 ( affiliation VARCHAR, location VARCHAR ) ### Response: SELECT affiliation FROM table_name_51 WHERE location = "issaquah"
Which Pre-Season has a A-League of 0 1, and a Finals larger than 0?
CREATE TABLE table_8657 ( "Name" text, "Pre-Season" real, "A-League" text, "Finals" real, "Total" text )
SELECT MIN("Pre-Season") FROM table_8657 WHERE "A-League" = '0 1' AND "Finals" > '0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Pre-Season has a A-League of 0 1, and a Finals larger than 0? ### Input: CREATE TABLE table_8657 ( "Name" text, "Pre-Season" real, "A-League" text, "Finals" real, "Total" text ) ### Response: SELECT MIN("Pre-Season") FROM table_8657 WHERE "A-League" = '0 1' AND "Finals" > '0'
I want to know the pens with conv of 6
CREATE TABLE table_name_10 ( pens VARCHAR, conv VARCHAR )
SELECT pens FROM table_name_10 WHERE conv = "6"
Below are sql tables 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 to know the pens with conv of 6 ### Input: CREATE TABLE table_name_10 ( pens VARCHAR, conv VARCHAR ) ### Response: SELECT pens FROM table_name_10 WHERE conv = "6"
Show all the Store_Name of drama workshop groups.
CREATE TABLE stores ( store_id text, address_id number, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text ) CREATE TABLE invoices ( invoice_id number, order_id number, payment_method_code text, product_id number, order_quantity text, other_item_details text, order_item_id number ) CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE drama_workshop_groups ( workshop_group_id number, address_id number, currency_code text, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text, other_item_details text ) CREATE TABLE customer_orders ( order_id number, customer_id number, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text ) CREATE TABLE customers ( customer_id text, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text ) CREATE TABLE performers_in_bookings ( order_id number, performer_id number ) CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text ) CREATE TABLE addresses ( address_id text, line_1 text, line_2 text, city_town text, state_county text, other_details text ) CREATE TABLE ref_payment_methods ( payment_method_code text, payment_method_description text ) CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, other_product_service_details text ) CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_region_descriptrion text, other_details text ) CREATE TABLE bookings_services ( order_id number, product_id number ) CREATE TABLE invoice_items ( invoice_item_id number, invoice_id number, order_id number, order_item_id number, product_id number, order_quantity number, other_item_details text ) CREATE TABLE bookings ( booking_id number, customer_id number, workshop_group_id text, status_code text, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text ) CREATE TABLE products ( product_id text, product_name text, product_price number, product_description text, other_product_service_details text ) CREATE TABLE clients ( client_id number, address_id number, customer_email_address text, customer_name text, customer_phone text, other_details text )
SELECT store_name FROM drama_workshop_groups
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the Store_Name of drama workshop groups. ### Input: CREATE TABLE stores ( store_id text, address_id number, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text ) CREATE TABLE invoices ( invoice_id number, order_id number, payment_method_code text, product_id number, order_quantity text, other_item_details text, order_item_id number ) CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE drama_workshop_groups ( workshop_group_id number, address_id number, currency_code text, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text, other_item_details text ) CREATE TABLE customer_orders ( order_id number, customer_id number, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text ) CREATE TABLE customers ( customer_id text, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text ) CREATE TABLE performers_in_bookings ( order_id number, performer_id number ) CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text ) CREATE TABLE addresses ( address_id text, line_1 text, line_2 text, city_town text, state_county text, other_details text ) CREATE TABLE ref_payment_methods ( payment_method_code text, payment_method_description text ) CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, other_product_service_details text ) CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_region_descriptrion text, other_details text ) CREATE TABLE bookings_services ( order_id number, product_id number ) CREATE TABLE invoice_items ( invoice_item_id number, invoice_id number, order_id number, order_item_id number, product_id number, order_quantity number, other_item_details text ) CREATE TABLE bookings ( booking_id number, customer_id number, workshop_group_id text, status_code text, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text ) CREATE TABLE products ( product_id text, product_name text, product_price number, product_description text, other_product_service_details text ) CREATE TABLE clients ( client_id number, address_id number, customer_email_address text, customer_name text, customer_phone text, other_details text ) ### Response: SELECT store_name FROM drama_workshop_groups
Specify the maximum age of patients who received long-term hospital care but whose survival status is unkown/unspecified
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Specify the maximum age of patients who received long-term hospital care but whose survival status is unkown/unspecified ### Input: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
What is the position when the League is the malaysian super league, and a Year of 2011?
CREATE TABLE table_name_85 ( position VARCHAR, league VARCHAR, year VARCHAR )
SELECT position FROM table_name_85 WHERE league = "malaysian super league" AND year = "2011"
Below are sql tables 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 position when the League is the malaysian super league, and a Year of 2011? ### Input: CREATE TABLE table_name_85 ( position VARCHAR, league VARCHAR, year VARCHAR ) ### Response: SELECT position FROM table_name_85 WHERE league = "malaysian super league" AND year = "2011"