instruction
stringlengths 8
460
| input
stringlengths 37
7.14k
| output
stringlengths 9
2.37k
| text
stringlengths 302
7.71k
|
---|---|---|---|
What is the last year that someone is first elected? | CREATE TABLE table_1342359_2 (
first_elected INTEGER
) | SELECT MAX(first_elected) FROM table_1342359_2 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the last year that someone is first elected? ### Input: CREATE TABLE table_1342359_2 (
first_elected INTEGER
) ### Response: SELECT MAX(first_elected) FROM table_1342359_2 |
In which venue did the home team score 11.13 (79)? | CREATE TABLE table_10814 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_10814 WHERE "Home team score" = '11.13 (79)' | Below are sql tables 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 venue did the home team score 11.13 (79)? ### Input: CREATE TABLE table_10814 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Venue" FROM table_10814 WHERE "Home team score" = '11.13 (79)' |
What is the highest swimsuit a contestant from Kansas with an average larger than 8.48, an interview higher than 8.58, and an evening gown higher than 8.82 has? | CREATE TABLE table_name_69 (
swimsuit INTEGER,
state VARCHAR,
evening_gown VARCHAR,
average VARCHAR,
interview VARCHAR
) | SELECT MAX(swimsuit) FROM table_name_69 WHERE average > 8.48 AND interview > 8.58 AND evening_gown > 8.82 AND state = "kansas" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest swimsuit a contestant from Kansas with an average larger than 8.48, an interview higher than 8.58, and an evening gown higher than 8.82 has? ### Input: CREATE TABLE table_name_69 (
swimsuit INTEGER,
state VARCHAR,
evening_gown VARCHAR,
average VARCHAR,
interview VARCHAR
) ### Response: SELECT MAX(swimsuit) FROM table_name_69 WHERE average > 8.48 AND interview > 8.58 AND evening_gown > 8.82 AND state = "kansas" |
What is the pick with Dean Sears and round larger than 6? | CREATE TABLE table_name_61 (
pick INTEGER,
round VARCHAR,
player VARCHAR
) | SELECT MIN(pick) FROM table_name_61 WHERE round > 6 AND player = "dean sears" | Below are sql tables 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 pick with Dean Sears and round larger than 6? ### Input: CREATE TABLE table_name_61 (
pick INTEGER,
round VARCHAR,
player VARCHAR
) ### Response: SELECT MIN(pick) FROM table_name_61 WHERE round > 6 AND player = "dean sears" |
Which Against has Losses smaller than 5, and a Wimmera FL of warrack eagles, and Draws smaller than 0? | CREATE TABLE table_name_68 (
against INTEGER,
draws VARCHAR,
losses VARCHAR,
wimmera_fl VARCHAR
) | SELECT AVG(against) FROM table_name_68 WHERE losses < 5 AND wimmera_fl = "warrack eagles" AND draws < 0 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Against has Losses smaller than 5, and a Wimmera FL of warrack eagles, and Draws smaller than 0? ### Input: CREATE TABLE table_name_68 (
against INTEGER,
draws VARCHAR,
losses VARCHAR,
wimmera_fl VARCHAR
) ### Response: SELECT AVG(against) FROM table_name_68 WHERE losses < 5 AND wimmera_fl = "warrack eagles" AND draws < 0 |
When was the date that had a Loss of Shirley (0-1)? | CREATE TABLE table_15395 (
"Date" text,
"Opponent" text,
"Site" text,
"Score" text,
"Loss" text
) | SELECT "Date" FROM table_15395 WHERE "Loss" = 'shirley (0-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 was the date that had a Loss of Shirley (0-1)? ### Input: CREATE TABLE table_15395 (
"Date" text,
"Opponent" text,
"Site" text,
"Score" text,
"Loss" text
) ### Response: SELECT "Date" FROM table_15395 WHERE "Loss" = 'shirley (0-1)' |
Which player went to Emporia State? | CREATE TABLE table_16078 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
) | SELECT "Player name" FROM table_16078 WHERE "College" = 'Emporia State' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player went to Emporia State? ### Input: CREATE TABLE table_16078 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
) ### Response: SELECT "Player name" FROM table_16078 WHERE "College" = 'Emporia State' |
What was the press like in Paris for Roger Francois, and Carlo Galimberti? | CREATE TABLE table_name_67 (
paris___fra__ VARCHAR,
roger_françois VARCHAR
) | SELECT paris___fra__ FROM table_name_67 WHERE "press" = "press" AND roger_françois = "carlo galimberti" | Below are sql tables 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 press like in Paris for Roger Francois, and Carlo Galimberti? ### Input: CREATE TABLE table_name_67 (
paris___fra__ VARCHAR,
roger_françois VARCHAR
) ### Response: SELECT paris___fra__ FROM table_name_67 WHERE "press" = "press" AND roger_françois = "carlo galimberti" |
Give me the comparison about ACC_Percent over the ACC_Regular_Season . | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
) | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about ACC_Percent over the ACC_Regular_Season . ### Input: CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
) ### Response: SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match |
What is the highest number of wins for Quambatook when Against is less than 1129? | CREATE TABLE table_name_83 (
wins INTEGER,
golden_rivers VARCHAR,
against VARCHAR
) | SELECT MAX(wins) FROM table_name_83 WHERE golden_rivers = "quambatook" AND against < 1129 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest number of wins for Quambatook when Against is less than 1129? ### Input: CREATE TABLE table_name_83 (
wins INTEGER,
golden_rivers VARCHAR,
against VARCHAR
) ### Response: SELECT MAX(wins) FROM table_name_83 WHERE golden_rivers = "quambatook" AND against < 1129 |
What round pick was pick number 101 who plays defensive back? | CREATE TABLE table_name_92 (
round VARCHAR,
position VARCHAR,
pick__number VARCHAR
) | SELECT round FROM table_name_92 WHERE position = "defensive back" AND pick__number = "101" | Below are sql tables 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 round pick was pick number 101 who plays defensive back? ### Input: CREATE TABLE table_name_92 (
round VARCHAR,
position VARCHAR,
pick__number VARCHAR
) ### Response: SELECT round FROM table_name_92 WHERE position = "defensive back" AND pick__number = "101" |
Compare how many events by different event details using a bar chart, and sort names from high to low order. | CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
) | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details 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 how many events by different event details using a bar chart, and sort names from high to low order. ### Input: CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
) ### Response: SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details DESC |
Who is the incumbent in district Massachusetts7? | CREATE TABLE table_18206 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
) | SELECT "Incumbent" FROM table_18206 WHERE "District" = 'Massachusetts7' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the incumbent in district Massachusetts7? ### Input: CREATE TABLE table_18206 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
) ### Response: SELECT "Incumbent" FROM table_18206 WHERE "District" = 'Massachusetts7' |
What safari has 2012 q4 as the period? | CREATE TABLE table_79299 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other" text
) | SELECT "Safari" FROM table_79299 WHERE "Period" = '2012 q4' | Below are sql tables 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 safari has 2012 q4 as the period? ### Input: CREATE TABLE table_79299 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other" text
) ### Response: SELECT "Safari" FROM table_79299 WHERE "Period" = '2012 q4' |
how many people are not driving a chevrolet silverado ? | CREATE TABLE table_204_89 (
id number,
"team" text,
"truck(s)" text,
"#" number,
"driver(s)" text,
"primary sponsor(s)" text,
"listed owner(s)" text,
"crew chief" text
) | SELECT COUNT("driver(s)") FROM table_204_89 WHERE "truck(s)" <> 'chevrolet silverado' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many people are not driving a chevrolet silverado ? ### Input: CREATE TABLE table_204_89 (
id number,
"team" text,
"truck(s)" text,
"#" number,
"driver(s)" text,
"primary sponsor(s)" text,
"listed owner(s)" text,
"crew chief" text
) ### Response: SELECT COUNT("driver(s)") FROM table_204_89 WHERE "truck(s)" <> 'chevrolet silverado' |
On October 24, who played at home when there was a decision of Ward? | CREATE TABLE table_58477 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | SELECT "Home" FROM table_58477 WHERE "Decision" = 'ward' AND "Date" = 'october 24' | Below are sql tables 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 October 24, who played at home when there was a decision of Ward? ### Input: CREATE TABLE table_58477 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) ### Response: SELECT "Home" FROM table_58477 WHERE "Decision" = 'ward' AND "Date" = 'october 24' |
What 7:00 has a 10:00 of dirty sexy money? | CREATE TABLE table_67978 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) | SELECT "7:00" FROM table_67978 WHERE "10:00" = 'dirty sexy money' | Below are sql tables 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 7:00 has a 10:00 of dirty sexy money? ### Input: CREATE TABLE table_67978 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) ### Response: SELECT "7:00" FROM table_67978 WHERE "10:00" = 'dirty sexy money' |
Which Tie #has an Attendance of 54,591? | CREATE TABLE table_36003 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | SELECT "Tie no" FROM table_36003 WHERE "Attendance" = '54,591' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Tie #has an Attendance of 54,591? ### Input: CREATE TABLE table_36003 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) ### Response: SELECT "Tie no" FROM table_36003 WHERE "Attendance" = '54,591' |
Visualize a bar chart about the distribution of Team_Name and Team_ID , and list X-axis in descending order. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
) | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of Team_Name and Team_ID , and list X-axis in descending order. ### Input: CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
) ### Response: SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name DESC |
where was the total attendance-regular season record made | CREATE TABLE table_21436373_12 (
stadium VARCHAR,
type_of_record VARCHAR
) | SELECT stadium FROM table_21436373_12 WHERE type_of_record = "Total attendance-Regular season" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: where was the total attendance-regular season record made ### Input: CREATE TABLE table_21436373_12 (
stadium VARCHAR,
type_of_record VARCHAR
) ### Response: SELECT stadium FROM table_21436373_12 WHERE type_of_record = "Total attendance-Regular season" |
what is the season when the third is shawn rojeski? | CREATE TABLE table_8028 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | SELECT "Season" FROM table_8028 WHERE "Third" = 'shawn rojeski' | Below are sql tables 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 season when the third is shawn rojeski? ### Input: CREATE TABLE table_8028 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) ### Response: SELECT "Season" FROM table_8028 WHERE "Third" = 'shawn rojeski' |
What is the Translated Title of Steinulven? | CREATE TABLE table_10455 (
"Swedish title" text,
"Norwegian title" text,
"Translated title" text,
"Published" text,
"Pages" real,
"ISBN" text
) | SELECT "Translated title" FROM table_10455 WHERE "Norwegian title" = 'steinulven' | Below are sql tables 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 Translated Title of Steinulven? ### Input: CREATE TABLE table_10455 (
"Swedish title" text,
"Norwegian title" text,
"Translated title" text,
"Published" text,
"Pages" real,
"ISBN" text
) ### Response: SELECT "Translated title" FROM table_10455 WHERE "Norwegian title" = 'steinulven' |
what is the team with the position in table of 24th and the date of appointment 15 september 2008? | CREATE TABLE table_64561 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | SELECT "Team" FROM table_64561 WHERE "Position in table" = '24th' AND "Date of appointment" = '15 september 2008' | Below are sql tables 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 team with the position in table of 24th and the date of appointment 15 september 2008? ### Input: CREATE TABLE table_64561 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) ### Response: SELECT "Team" FROM table_64561 WHERE "Position in table" = '24th' AND "Date of appointment" = '15 september 2008' |
List from which date and to which date these staff work: project staff of the project which hires the most staffs | CREATE TABLE Project_Staff (
date_from VARCHAR,
date_to VARCHAR,
project_id VARCHAR,
role_code VARCHAR
) | SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader' | Below are sql tables 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 from which date and to which date these staff work: project staff of the project which hires the most staffs ### Input: CREATE TABLE Project_Staff (
date_from VARCHAR,
date_to VARCHAR,
project_id VARCHAR,
role_code VARCHAR
) ### Response: SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader' |
For Stellenbosch, which has a population larger than 155,733, what is the average area? | CREATE TABLE table_42838 (
"Name" text,
"Seat" text,
"Population (2011)" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real
) | SELECT AVG("Area (km 2 )") FROM table_42838 WHERE "Name" = 'stellenbosch' AND "Population (2011)" > '155,733' | Below are sql tables 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 Stellenbosch, which has a population larger than 155,733, what is the average area? ### Input: CREATE TABLE table_42838 (
"Name" text,
"Seat" text,
"Population (2011)" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real
) ### Response: SELECT AVG("Area (km 2 )") FROM table_42838 WHERE "Name" = 'stellenbosch' AND "Population (2011)" > '155,733' |
has patient 033-32465 received administration of electrolytes - oral in other hospitals, since 6 years ago? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
) | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'administration of electrolytes - oral' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 033-32465 received administration of electrolytes - oral in other hospitals, since 6 years ago? ### Input: CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
) ### Response: SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'administration of electrolytes - oral' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year') |
What are the names of the directors who made exactly one movie excluding director NULL? | CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | SELECT director FROM movie WHERE director <> "null" GROUP BY director 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: What are the names of the directors who made exactly one movie excluding director NULL? ### Input: CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) ### Response: SELECT director FROM movie WHERE director <> "null" GROUP BY director HAVING COUNT(*) = 1 |
Display a bar chart for how many counties correspond to each police force?, and rank X in asc order. | CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
Black real,
Amerindian real,
Asian real,
Multiracial real,
Hispanic real
) | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a bar chart for how many counties correspond to each police force?, and rank X in asc order. ### Input: CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
Black real,
Amerindian real,
Asian real,
Multiracial real,
Hispanic real
) ### Response: SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force |
What is the Score of ? | CREATE TABLE table_name_78 (
score VARCHAR,
song VARCHAR
) | SELECT score FROM table_name_78 WHERE song = "我等的人会是谁" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Score of ? ### Input: CREATE TABLE table_name_78 (
score VARCHAR,
song VARCHAR
) ### Response: SELECT score FROM table_name_78 WHERE song = "我等的人会是谁" |
For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter in a bar chart. | 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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | Below are sql tables 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 headquarter and the sum of manufacturer , and group by attribute headquarter in a bar chart. ### 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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
What country were the athletes where ranked smaller than 5 with notes listed as fb? | CREATE TABLE table_65513 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | SELECT "Country" FROM table_65513 WHERE "Rank" < '5' AND "Notes" = 'fb' | Below are sql tables 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 country were the athletes where ranked smaller than 5 with notes listed as fb? ### Input: CREATE TABLE table_65513 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) ### Response: SELECT "Country" FROM table_65513 WHERE "Rank" < '5' AND "Notes" = 'fb' |
What rank was the swimmer in lane 4? | CREATE TABLE table_name_41 (
rank VARCHAR,
lane VARCHAR
) | SELECT rank FROM table_name_41 WHERE lane = 4 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What rank was the swimmer in lane 4? ### Input: CREATE TABLE table_name_41 (
rank VARCHAR,
lane VARCHAR
) ### Response: SELECT rank FROM table_name_41 WHERE lane = 4 |
A bar chart for showing the number of the countries that have managers of age above 50 or below 46, I want to rank by the total number in ascending. | CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
) | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY COUNT(Country) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for showing the number of the countries that have managers of age above 50 or below 46, I want to rank by the total number in ascending. ### Input: CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
) ### Response: SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY COUNT(Country) |
What was the sum of ranks of those called Fernando Cavenaghi who appeared less than 7. | CREATE TABLE table_31898 (
"Rank" real,
"Name" text,
"Team" text,
"Goals" real,
"Appearances" real
) | SELECT SUM("Rank") FROM table_31898 WHERE "Name" = 'fernando cavenaghi' AND "Appearances" < '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 sum of ranks of those called Fernando Cavenaghi who appeared less than 7. ### Input: CREATE TABLE table_31898 (
"Rank" real,
"Name" text,
"Team" text,
"Goals" real,
"Appearances" real
) ### Response: SELECT SUM("Rank") FROM table_31898 WHERE "Name" = 'fernando cavenaghi' AND "Appearances" < '7' |
Group and count the move in date in a bar chart, could you display X-axis from low to high order? | CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Services (
service_id INTEGER,
organization_id INTEGER,
service_type_code CHAR(15),
service_details VARCHAR(255)
) | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY date_moved_in | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Group and count the move in date in a bar chart, could you display X-axis from low to high order? ### Input: CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Timed_Status_of_Things (
thing_id INTEGER,
Date_and_Date DATETIME,
Status_of_Thing_Code CHAR(15)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME
)
CREATE TABLE Services (
service_id INTEGER,
organization_id INTEGER,
service_type_code CHAR(15),
service_details VARCHAR(255)
) ### Response: SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY date_moved_in |
Which democratic incumbent is from the district of ohio 7? | CREATE TABLE table_name_93 (
incumbent VARCHAR,
party VARCHAR,
district VARCHAR
) | SELECT incumbent FROM table_name_93 WHERE party = "democratic" AND district = "ohio 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: Which democratic incumbent is from the district of ohio 7? ### Input: CREATE TABLE table_name_93 (
incumbent VARCHAR,
party VARCHAR,
district VARCHAR
) ### Response: SELECT incumbent FROM table_name_93 WHERE party = "democratic" AND district = "ohio 7" |
when was the building at 10 court street built ? | CREATE TABLE table_204_749 (
id number,
"courthouse" text,
"city" text,
"street address" text,
"jurisdiction" text,
"dates of use" text,
"named for" number
) | SELECT "dates of use" FROM table_204_749 WHERE "street address" = '10 court street' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the building at 10 court street built ? ### Input: CREATE TABLE table_204_749 (
id number,
"courthouse" text,
"city" text,
"street address" text,
"jurisdiction" text,
"dates of use" text,
"named for" number
) ### Response: SELECT "dates of use" FROM table_204_749 WHERE "street address" = '10 court street' |
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id by a bar chart. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_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 was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id by a bar chart. ### Input: CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) ### Response: SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID |
What is the name for the entry that has a public of Yes, a personal sites of No, and a team sites of No? | CREATE TABLE table_60937 (
"Name" text,
"Public" text,
"Intranet" text,
"Extranet" text,
"Personal Sites" text,
"Team Sites" text,
"Developer" text
) | SELECT "Name" FROM table_60937 WHERE "Public" = 'yes' AND "Personal Sites" = 'no' AND "Team Sites" = '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 name for the entry that has a public of Yes, a personal sites of No, and a team sites of No? ### Input: CREATE TABLE table_60937 (
"Name" text,
"Public" text,
"Intranet" text,
"Extranet" text,
"Personal Sites" text,
"Team Sites" text,
"Developer" text
) ### Response: SELECT "Name" FROM table_60937 WHERE "Public" = 'yes' AND "Personal Sites" = 'no' AND "Team Sites" = 'no' |
Which parts have more than 2 faults? Show the part name and id Plot them as bar chart, and could you sort in desc by the y axis? | CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DATETIME,
other_visit_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
asset_disposed_date DATETIME,
other_asset_details VARCHAR(255)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
) | SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id 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: Which parts have more than 2 faults? Show the part name and id Plot them as bar chart, and could you sort in desc by the y axis? ### Input: CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DATETIME,
other_visit_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
asset_disposed_date DATETIME,
other_asset_details VARCHAR(255)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
) ### Response: SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id DESC |
Which candidates ran in the Alabama 6 district? | CREATE TABLE table_1341973_3 (
candidates VARCHAR,
district VARCHAR
) | SELECT candidates FROM table_1341973_3 WHERE district = "Alabama 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 candidates ran in the Alabama 6 district? ### Input: CREATE TABLE table_1341973_3 (
candidates VARCHAR,
district VARCHAR
) ### Response: SELECT candidates FROM table_1341973_3 WHERE district = "Alabama 6" |
How many contestants were there when the runner-up was Monique Evans? | CREATE TABLE table_25214321_1 (
contestants INTEGER,
runner_up VARCHAR
) | SELECT MAX(contestants) FROM table_25214321_1 WHERE runner_up = "Monique Evans" | Below are sql tables 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 contestants were there when the runner-up was Monique Evans? ### Input: CREATE TABLE table_25214321_1 (
contestants INTEGER,
runner_up VARCHAR
) ### Response: SELECT MAX(contestants) FROM table_25214321_1 WHERE runner_up = "Monique Evans" |
give me the five most common output events since 2 years ago? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
) | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY outputevents.itemid) 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: give me the five most common output events since 2 years ago? ### Input: CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
) ### Response: SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5) |
What is the highest Year with a Competition that is new york city marathon? | CREATE TABLE table_41086 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | SELECT MAX("Year") FROM table_41086 WHERE "Competition" = 'new york city marathon' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest Year with a Competition that is new york city marathon? ### Input: CREATE TABLE table_41086 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) ### Response: SELECT MAX("Year") FROM table_41086 WHERE "Competition" = 'new york city marathon' |
What is the earliest year that Assists were less than 13 and minutes were under 91? | CREATE TABLE table_name_47 (
season INTEGER,
assists VARCHAR,
minutes VARCHAR
) | SELECT MIN(season) FROM table_name_47 WHERE assists < 13 AND minutes < 91 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the earliest year that Assists were less than 13 and minutes were under 91? ### Input: CREATE TABLE table_name_47 (
season INTEGER,
assists VARCHAR,
minutes VARCHAR
) ### Response: SELECT MIN(season) FROM table_name_47 WHERE assists < 13 AND minutes < 91 |
what is the number of patients whose age is less than 68 and lab test fluid is joint fluid? | 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.age < "68" AND lab.fluid = "Joint Fluid" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose age is less than 68 and lab test fluid is joint fluid? ### 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.age < "68" AND lab.fluid = "Joint Fluid" |
What is the lowest Frequency where the Hemholtz pitch is d? | CREATE TABLE table_77930 (
"String" text,
"Scientific pitch" text,
"Helmholtz pitch" text,
"Interval from middle C" text,
"Frequency ( Hz )" real
) | SELECT MIN("Frequency ( Hz )") FROM table_77930 WHERE "Helmholtz pitch" = 'd' | Below are sql tables 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 Frequency where the Hemholtz pitch is d? ### Input: CREATE TABLE table_77930 (
"String" text,
"Scientific pitch" text,
"Helmholtz pitch" text,
"Interval from middle C" text,
"Frequency ( Hz )" real
) ### Response: SELECT MIN("Frequency ( Hz )") FROM table_77930 WHERE "Helmholtz pitch" = 'd' |
Which stories have a rank of 14? | CREATE TABLE table_name_43 (
stories VARCHAR,
rank VARCHAR
) | SELECT stories FROM table_name_43 WHERE rank = "14" | Below are sql tables 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 stories have a rank of 14? ### Input: CREATE TABLE table_name_43 (
stories VARCHAR,
rank VARCHAR
) ### Response: SELECT stories FROM table_name_43 WHERE rank = "14" |
Short WHYT comments, Id only. | 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE 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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE 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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
) | SELECT Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE 'what have you tried%' AND LENGTH(Text) < 75 ORDER BY LENGTH(Text), 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: Short WHYT comments, Id only. ### Input: 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE 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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE 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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
) ### Response: SELECT Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE 'what have you tried%' AND LENGTH(Text) < 75 ORDER BY LENGTH(Text), Id |
For driver Mark Skaife what is the result for race 1? | CREATE TABLE table_256 (
"Driver" text,
"No." real,
"Team" text,
"Car" text,
"Race 1" text,
"GP 100" text,
"Race 3" text,
"Points" real
) | SELECT "Race 1" FROM table_256 WHERE "Driver" = 'Mark Skaife' | Below are sql tables 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 driver Mark Skaife what is the result for race 1? ### Input: CREATE TABLE table_256 (
"Driver" text,
"No." real,
"Team" text,
"Car" text,
"Race 1" text,
"GP 100" text,
"Race 3" text,
"Points" real
) ### Response: SELECT "Race 1" FROM table_256 WHERE "Driver" = 'Mark Skaife' |
What is the highest overall prior to 1996 with a slalom of 39? | CREATE TABLE table_name_33 (
overall INTEGER,
slalom VARCHAR,
season VARCHAR
) | SELECT MAX(overall) FROM table_name_33 WHERE slalom = "39" AND season < 1996 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest overall prior to 1996 with a slalom of 39? ### Input: CREATE TABLE table_name_33 (
overall INTEGER,
slalom VARCHAR,
season VARCHAR
) ### Response: SELECT MAX(overall) FROM table_name_33 WHERE slalom = "39" AND season < 1996 |
how many patients whose marital status is widowed and lab test fluid is urine? | 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 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
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Urine" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose marital status is widowed and lab test fluid is urine? ### Input: 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 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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Urine" |
What was the attendance of the game where fitzroy was the away team? | CREATE TABLE table_52235 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT COUNT("Crowd") FROM table_52235 WHERE "Away team" = 'fitzroy' | Below are sql tables 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 of the game where fitzroy was the away team? ### Input: CREATE TABLE table_52235 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT COUNT("Crowd") FROM table_52235 WHERE "Away team" = 'fitzroy' |
How many written by have wendey stanzler as the director? | CREATE TABLE table_22570439_1 (
written_by VARCHAR,
directed_by VARCHAR
) | SELECT COUNT(written_by) FROM table_22570439_1 WHERE directed_by = "Wendey Stanzler" | Below are sql tables 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 written by have wendey stanzler as the director? ### Input: CREATE TABLE table_22570439_1 (
written_by VARCHAR,
directed_by VARCHAR
) ### Response: SELECT COUNT(written_by) FROM table_22570439_1 WHERE directed_by = "Wendey Stanzler" |
How many years did the team place 2nd in Antwerp, Belgium? | CREATE TABLE table_name_21 (
year VARCHAR,
venue VARCHAR,
result VARCHAR
) | SELECT COUNT(year) FROM table_name_21 WHERE venue = "antwerp, belgium" AND result = "2nd" | Below are sql tables 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 years did the team place 2nd in Antwerp, Belgium? ### Input: CREATE TABLE table_name_21 (
year VARCHAR,
venue VARCHAR,
result VARCHAR
) ### Response: SELECT COUNT(year) FROM table_name_21 WHERE venue = "antwerp, belgium" AND result = "2nd" |
is the number of enemy aircraft more or less than the other foes combined ? | CREATE TABLE table_204_353 (
id number,
"no." number,
"date/time" text,
"aircraft" text,
"foe" text,
"result" text,
"location" text,
"notes" text
) | SELECT (SELECT COUNT(*) FROM table_204_353 WHERE "foe" = 'enemy aircraft') > (SELECT COUNT(*) FROM table_204_353 WHERE "foe" <> 'enemy aircraft') | Below are sql tables 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 the number of enemy aircraft more or less than the other foes combined ? ### Input: CREATE TABLE table_204_353 (
id number,
"no." number,
"date/time" text,
"aircraft" text,
"foe" text,
"result" text,
"location" text,
"notes" text
) ### Response: SELECT (SELECT COUNT(*) FROM table_204_353 WHERE "foe" = 'enemy aircraft') > (SELECT COUNT(*) FROM table_204_353 WHERE "foe" <> 'enemy aircraft') |
Which Zone has a Champion of surozh sudak? | CREATE TABLE table_44580 (
"Season" text,
"Zone" real,
"Champion" text,
"Second" text,
"Third" text,
"Top scorer" text
) | SELECT SUM("Zone") FROM table_44580 WHERE "Champion" = 'surozh sudak' | Below are sql tables 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 Zone has a Champion of surozh sudak? ### Input: CREATE TABLE table_44580 (
"Season" text,
"Zone" real,
"Champion" text,
"Second" text,
"Third" text,
"Top scorer" text
) ### Response: SELECT SUM("Zone") FROM table_44580 WHERE "Champion" = 'surozh sudak' |
When did Mathieu play against Flavio Cipolla? | CREATE TABLE table_name_60 (
date VARCHAR,
opponent_in_the_final VARCHAR
) | SELECT date FROM table_name_60 WHERE opponent_in_the_final = "flavio cipolla" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did Mathieu play against Flavio Cipolla? ### Input: CREATE TABLE table_name_60 (
date VARCHAR,
opponent_in_the_final VARCHAR
) ### Response: SELECT date FROM table_name_60 WHERE opponent_in_the_final = "flavio cipolla" |
was the score in the 1st match between svendborg and goteborgs kvinnliga the same as the score in the secon match ? | CREATE TABLE table_204_230 (
id number,
"team #1" text,
"agg." text,
"team #2" text,
"1st match" text,
"2nd match" text
) | SELECT "1st match" = "2nd match" FROM table_204_230 WHERE "team #1" = 'svendborg' AND "team #2" = 'goteborgs kvinnliga' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the score in the 1st match between svendborg and goteborgs kvinnliga the same as the score in the secon match ? ### Input: CREATE TABLE table_204_230 (
id number,
"team #1" text,
"agg." text,
"team #2" text,
"1st match" text,
"2nd match" text
) ### Response: SELECT "1st match" = "2nd match" FROM table_204_230 WHERE "team #1" = 'svendborg' AND "team #2" = 'goteborgs kvinnliga' |
list all the takeoffs and landings at MKE | CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type 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 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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant 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 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 time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
) | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE') | Below are sql tables 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 takeoffs and landings at MKE ### Input: CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type 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 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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant 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 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 time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
) ### Response: SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE') |
give me patient 027-135249's yearly minimum sao2 until 4 months ago. | 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 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 medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) | SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-135249')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(vitalperiodic.observationtime) <= DATETIME(CURRENT_TIME(), '-4 month') GROUP BY STRFTIME('%y', vitalperiodic.observationtime) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me patient 027-135249's yearly minimum sao2 until 4 months ago. ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE 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 medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) ### Response: SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-135249')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(vitalperiodic.observationtime) <= DATETIME(CURRENT_TIME(), '-4 month') GROUP BY STRFTIME('%y', vitalperiodic.observationtime) |
Which Authority has a Decile smaller than 6, and an Area of opoutere? | CREATE TABLE table_70466 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | SELECT "Authority" FROM table_70466 WHERE "Decile" < '6' AND "Area" = 'opoutere' | Below are sql tables 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 Authority has a Decile smaller than 6, and an Area of opoutere? ### Input: CREATE TABLE table_70466 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) ### Response: SELECT "Authority" FROM table_70466 WHERE "Decile" < '6' AND "Area" = 'opoutere' |
retrieve the patients ids who had been diagnosed with ischemic optic neuropthy in this year. | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ischemic optic neuropthy') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: retrieve the patients ids who had been diagnosed with ischemic optic neuropthy in this year. ### Input: CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) ### Response: SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ischemic optic neuropthy') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
Which Away team has a Score of 0 3? | CREATE TABLE table_36000 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | SELECT "Away team" FROM table_36000 WHERE "Score" = '0–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: Which Away team has a Score of 0 3? ### Input: CREATE TABLE table_36000 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) ### Response: SELECT "Away team" FROM table_36000 WHERE "Score" = '0–3' |
Which Year completed has a Dam type of earthfill embankment, and a Dam constructed of khancoban dam? | CREATE TABLE table_62076 (
"Dam constructed" text,
"Year completed" real,
"Impounded body of water" text,
"Reservoir capacity" text,
"Dam wall height" text,
"Dam type" text
) | SELECT MAX("Year completed") FROM table_62076 WHERE "Dam type" = 'earthfill embankment' AND "Dam constructed" = 'khancoban dam' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Year completed has a Dam type of earthfill embankment, and a Dam constructed of khancoban dam? ### Input: CREATE TABLE table_62076 (
"Dam constructed" text,
"Year completed" real,
"Impounded body of water" text,
"Reservoir capacity" text,
"Dam wall height" text,
"Dam type" text
) ### Response: SELECT MAX("Year completed") FROM table_62076 WHERE "Dam type" = 'earthfill embankment' AND "Dam constructed" = 'khancoban dam' |
Total downvotes on answers, per day. | CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate 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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
) | SELECT v.CreationDate, AnswerDownVotes = COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.PostTypeId = 2 AND v.VoteTypeId = 3 AND v.CreationDate BETWEEN @startDate AND @endDate GROUP BY v.CreationDate ORDER BY v.CreationDate | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Total downvotes on answers, per day. ### Input: CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate 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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
) ### Response: SELECT v.CreationDate, AnswerDownVotes = COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.PostTypeId = 2 AND v.VoteTypeId = 3 AND v.CreationDate BETWEEN @startDate AND @endDate GROUP BY v.CreationDate ORDER BY v.CreationDate |
When did Prime Minister Agathe Uwilingiyimana's mandate end? | CREATE TABLE table_60923 (
"Name a" text,
"Country" text,
"Office" text,
"Mandate start" text,
"Mandate end" text,
"Term length" text
) | SELECT "Mandate end" FROM table_60923 WHERE "Office" = 'prime minister' AND "Name a" = 'agathe uwilingiyimana' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did Prime Minister Agathe Uwilingiyimana's mandate end? ### Input: CREATE TABLE table_60923 (
"Name a" text,
"Country" text,
"Office" text,
"Mandate start" text,
"Mandate end" text,
"Term length" text
) ### Response: SELECT "Mandate end" FROM table_60923 WHERE "Office" = 'prime minister' AND "Name a" = 'agathe uwilingiyimana' |
look for the maximum age of patients whose ethnicity is white and hospital stay is 4 days. | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE 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 MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "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: look for the maximum age of patients whose ethnicity is white and hospital stay is 4 days. ### Input: 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE 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 MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "4" |
what is lab test abnormal status of subject id 6983? | 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 lab.flag FROM lab WHERE lab.subject_id = "6983" | Below are sql tables 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 lab test abnormal status of subject id 6983? ### 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 lab.flag FROM lab WHERE lab.subject_id = "6983" |
What was the average attendance when the record was 17-18? | CREATE TABLE table_68635 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT AVG("Attendance") FROM table_68635 WHERE "Record" = '17-18' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the average attendance when the record was 17-18? ### Input: CREATE TABLE table_68635 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) ### Response: SELECT AVG("Attendance") FROM table_68635 WHERE "Record" = '17-18' |
tell me the sex of patient 028-40370. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 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 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 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 DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '028-40370' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the sex of patient 028-40370. ### Input: CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 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 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 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 DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '028-40370' |
What was the dominant religion in 2002 of the settlement with the cyrillic and other name of (romanian: voivodin )? | CREATE TABLE table_27885 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT "Dominant religion (2002)" FROM table_27885 WHERE "Cyrillic Name Other Names" = 'Војводинци (Romanian: Voivodinţ)' | Below are sql tables 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 dominant religion in 2002 of the settlement with the cyrillic and other name of (romanian: voivodin )? ### Input: CREATE TABLE table_27885 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) ### Response: SELECT "Dominant religion (2002)" FROM table_27885 WHERE "Cyrillic Name Other Names" = 'Војводинци (Romanian: Voivodinţ)' |
What is the total Frequency MHz Port Charlotte, Florida, which has an ERP W larger than 10, has? | CREATE TABLE table_51198 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | SELECT COUNT("Frequency MHz") FROM table_51198 WHERE "City of license" = 'port charlotte, florida' AND "ERP W" > '10' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total Frequency MHz Port Charlotte, Florida, which has an ERP W larger than 10, has? ### Input: CREATE TABLE table_51198 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) ### Response: SELECT COUNT("Frequency MHz") FROM table_51198 WHERE "City of license" = 'port charlotte, florida' AND "ERP W" > '10' |
Which Name was in the Year 2001? | CREATE TABLE table_name_32 (
name VARCHAR,
year VARCHAR
) | SELECT name FROM table_name_32 WHERE year = "2001" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Name was in the Year 2001? ### Input: CREATE TABLE table_name_32 (
name VARCHAR,
year VARCHAR
) ### Response: SELECT name FROM table_name_32 WHERE year = "2001" |
how many patients whose marital status is single and diagnoses long title is late effects of cerebrovascular disease, hemiplegia affecting unspecified side? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose marital status is single and diagnoses long title is late effects of cerebrovascular disease, hemiplegia affecting unspecified side? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side" |
count the number of drugs that have been prescribed patient 002-77945 until 3 years ago. | 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-77945')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year') | Below are sql tables 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 drugs that have been prescribed patient 002-77945 until 3 years ago. ### 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 medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) ### Response: SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-77945')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year') |
What is the Attendance when Vida is the Away team? | CREATE TABLE table_8371 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | SELECT AVG("Attendance") FROM table_8371 WHERE "Away" = 'vida' | Below are sql tables 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 Attendance when Vida is the Away team? ### Input: CREATE TABLE table_8371 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) ### Response: SELECT AVG("Attendance") FROM table_8371 WHERE "Away" = 'vida' |
Who is the away team for the tome team Leeds United, at the League Cup Competition? | CREATE TABLE table_name_12 (
away_team VARCHAR,
home_team VARCHAR,
competition VARCHAR
) | SELECT away_team FROM table_name_12 WHERE home_team = "leeds united" AND competition = "league cup" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the away team for the tome team Leeds United, at the League Cup Competition? ### Input: CREATE TABLE table_name_12 (
away_team VARCHAR,
home_team VARCHAR,
competition VARCHAR
) ### Response: SELECT away_team FROM table_name_12 WHERE home_team = "leeds united" AND competition = "league cup" |
count the number of patients whose primary disease is aortic valve insuffiency\aortic valve replacement /sda and lab test fluid is blood? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND lab.fluid = "Blood" | Below are sql tables 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 primary disease is aortic valve insuffiency\aortic valve replacement /sda and lab test fluid is blood? ### 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND lab.fluid = "Blood" |
Top users from Saarbr cken, Germany. | CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE 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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 PostTypes (
Id number,
Name text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
) | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%saarbr%cken%' AND Reputation >= 1000 ORDER BY Reputation 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: Top users from Saarbr cken, Germany. ### Input: CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE 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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 PostTypes (
Id number,
Name text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
) ### Response: SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%saarbr%cken%' AND Reputation >= 1000 ORDER BY Reputation DESC |
Which years did raymond floyd win? | CREATE TABLE table_46262 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | SELECT "Year(s) won" FROM table_46262 WHERE "Player" = 'raymond floyd' | Below are sql tables 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 years did raymond floyd win? ### Input: CREATE TABLE table_46262 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) ### Response: SELECT "Year(s) won" FROM table_46262 WHERE "Player" = 'raymond floyd' |
What is the motive before 2007? | CREATE TABLE table_name_25 (
motive VARCHAR,
year INTEGER
) | SELECT motive FROM table_name_25 WHERE year < 2007 | Below are sql tables 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 motive before 2007? ### Input: CREATE TABLE table_name_25 (
motive VARCHAR,
year INTEGER
) ### Response: SELECT motive FROM table_name_25 WHERE year < 2007 |
Name the MDE classes . | CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
) | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_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: Name the MDE classes . ### Input: CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
What is the name of the host nations if the winner was Hong Kong 207/6 (47.1 overs)? | CREATE TABLE table_22577693_1 (
host_nation_s_ VARCHAR,
winner VARCHAR
) | SELECT host_nation_s_ FROM table_22577693_1 WHERE winner = "Hong Kong 207/6 (47.1 overs)" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the host nations if the winner was Hong Kong 207/6 (47.1 overs)? ### Input: CREATE TABLE table_22577693_1 (
host_nation_s_ VARCHAR,
winner VARCHAR
) ### Response: SELECT host_nation_s_ FROM table_22577693_1 WHERE winner = "Hong Kong 207/6 (47.1 overs)" |
Which Color has a Transcription of wan suk? | CREATE TABLE table_name_16 (
color VARCHAR,
transcription VARCHAR
) | SELECT color FROM table_name_16 WHERE transcription = "wan suk" | Below are sql tables 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 Color has a Transcription of wan suk? ### Input: CREATE TABLE table_name_16 (
color VARCHAR,
transcription VARCHAR
) ### Response: SELECT color FROM table_name_16 WHERE transcription = "wan suk" |
When was the incident in Pol-E Khomri? | CREATE TABLE table_71249 (
"Date" text,
"Location" text,
"Nature of incident" text,
"Circumstances" text,
"Casualties" text
) | SELECT "Date" FROM table_71249 WHERE "Location" = 'pol-e khomri' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the incident in Pol-E Khomri? ### Input: CREATE TABLE table_71249 (
"Date" text,
"Location" text,
"Nature of incident" text,
"Circumstances" text,
"Casualties" text
) ### Response: SELECT "Date" FROM table_71249 WHERE "Location" = 'pol-e khomri' |
since 6 years ago, when did patient 006-185446 last visit the hospital? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
) | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-185446' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY patient.hospitaladmittime 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: since 6 years ago, when did patient 006-185446 last visit the hospital? ### Input: CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
) ### Response: SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-185446' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending order. | CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Products (
product_id INTEGER,
color_code VARCHAR(15),
product_category_code VARCHAR(15),
product_name VARCHAR(80),
typical_buying_price VARCHAR(20),
typical_selling_price VARCHAR(20),
product_description VARCHAR(255),
other_product_details VARCHAR(255)
)
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Characteristics (
characteristic_id INTEGER,
characteristic_type_code VARCHAR(15),
characteristic_data_type VARCHAR(10),
characteristic_name VARCHAR(80),
other_characteristic_details VARCHAR(255)
) | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of the category descriptions of the products whose descriptions include letter 't', list names in ascending order. ### Input: CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Products (
product_id INTEGER,
color_code VARCHAR(15),
product_category_code VARCHAR(15),
product_name VARCHAR(80),
typical_buying_price VARCHAR(20),
typical_selling_price VARCHAR(20),
product_description VARCHAR(255),
other_product_details VARCHAR(255)
)
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Characteristics (
characteristic_id INTEGER,
characteristic_type_code VARCHAR(15),
characteristic_data_type VARCHAR(10),
characteristic_name VARCHAR(80),
other_characteristic_details VARCHAR(255)
) ### Response: SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description |
If the security issues is 99-025 and the distribution mechanism is the Microsoft website, what is the release date total number? | CREATE TABLE table_2263152_1 (
release_date VARCHAR,
security_issues VARCHAR,
distribution_mechanism VARCHAR
) | SELECT COUNT(release_date) FROM table_2263152_1 WHERE security_issues = "99-025" AND distribution_mechanism = "Microsoft website" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the security issues is 99-025 and the distribution mechanism is the Microsoft website, what is the release date total number? ### Input: CREATE TABLE table_2263152_1 (
release_date VARCHAR,
security_issues VARCHAR,
distribution_mechanism VARCHAR
) ### Response: SELECT COUNT(release_date) FROM table_2263152_1 WHERE security_issues = "99-025" AND distribution_mechanism = "Microsoft website" |
what is the highest runners when the jockey is frankie dettori and the placing is higher than 1? | CREATE TABLE table_name_68 (
runners INTEGER,
jockey VARCHAR,
placing VARCHAR
) | SELECT MAX(runners) FROM table_name_68 WHERE jockey = "frankie dettori" AND placing > 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 highest runners when the jockey is frankie dettori and the placing is higher than 1? ### Input: CREATE TABLE table_name_68 (
runners INTEGER,
jockey VARCHAR,
placing VARCHAR
) ### Response: SELECT MAX(runners) FROM table_name_68 WHERE jockey = "frankie dettori" AND placing > 1 |
how many patients whose ethnicity is asian and year of birth is less than 1850? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "1850" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose ethnicity is asian and year of birth is less than 1850? ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "1850" |
What is the launch date odds of winning 1 in 4.23 with a top prize of $15,000? | CREATE TABLE table_name_30 (
launch_date VARCHAR,
odds_of_winning VARCHAR,
top_prize VARCHAR
) | SELECT launch_date FROM table_name_30 WHERE odds_of_winning = "1 in 4.23" AND top_prize = "$15,000" | Below are sql tables 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 launch date odds of winning 1 in 4.23 with a top prize of $15,000? ### Input: CREATE TABLE table_name_30 (
launch_date VARCHAR,
odds_of_winning VARCHAR,
top_prize VARCHAR
) ### Response: SELECT launch_date FROM table_name_30 WHERE odds_of_winning = "1 in 4.23" AND top_prize = "$15,000" |
What is the average Entre R os Municipality with less than 9 Pojo Municipalities? | CREATE TABLE table_38600 (
"Language" text,
"Totora Municipality" real,
"Pojo Municipality" real,
"Pocona Municipality" real,
"Chimor\u00e9 Municipality" real,
"Puerto Villarroel Municipality" real,
"Entre R\u00edos Municipality" real
) | SELECT AVG("Entre R\u00edos Municipality") FROM table_38600 WHERE "Pojo Municipality" < '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: What is the average Entre R os Municipality with less than 9 Pojo Municipalities? ### Input: CREATE TABLE table_38600 (
"Language" text,
"Totora Municipality" real,
"Pojo Municipality" real,
"Pocona Municipality" real,
"Chimor\u00e9 Municipality" real,
"Puerto Villarroel Municipality" real,
"Entre R\u00edos Municipality" real
) ### Response: SELECT AVG("Entre R\u00edos Municipality") FROM table_38600 WHERE "Pojo Municipality" < '9' |
How many people directed 'a little death'? | CREATE TABLE table_30688 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) | SELECT COUNT("Directed by") FROM table_30688 WHERE "Title" = 'A Little Death' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people directed 'a little death'? ### Input: CREATE TABLE table_30688 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) ### Response: SELECT COUNT("Directed by") FROM table_30688 WHERE "Title" = 'A Little Death' |
what is the total urine output amount for patient 009-8833? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE 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 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-8833')) AND intakeoutput.celllabel = 'urine' AND intakeoutput.cellpath LIKE '%output%' | Below are sql tables 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 urine output amount for patient 009-8833? ### Input: CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE 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 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) ### Response: SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-8833')) AND intakeoutput.celllabel = 'urine' AND intakeoutput.cellpath LIKE '%output%' |
what is maximum age of patients whose death status is 0 and primary disease is mesenteric ischemia? | 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 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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | Below are sql tables 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 maximum age of patients whose death status is 0 and primary disease is mesenteric ischemia? ### 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 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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" |
Name the Nationality / Opponent of the Competition of welsh rugby union challenge trophy and a Result of 38-29? | CREATE TABLE table_name_63 (
nationality___opponent VARCHAR,
competition VARCHAR,
result VARCHAR
) | SELECT nationality___opponent FROM table_name_63 WHERE competition = "welsh rugby union challenge trophy" AND result = "38-29" | Below are sql tables 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 Nationality / Opponent of the Competition of welsh rugby union challenge trophy and a Result of 38-29? ### Input: CREATE TABLE table_name_63 (
nationality___opponent VARCHAR,
competition VARCHAR,
result VARCHAR
) ### Response: SELECT nationality___opponent FROM table_name_63 WHERE competition = "welsh rugby union challenge trophy" AND result = "38-29" |
Which Result has a Party of republican, and a First elected smaller than 1856? | CREATE TABLE table_name_26 (
result VARCHAR,
party VARCHAR,
first_elected VARCHAR
) | SELECT result FROM table_name_26 WHERE party = "republican" AND first_elected < 1856 | Below are sql tables 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 Result has a Party of republican, and a First elected smaller than 1856? ### Input: CREATE TABLE table_name_26 (
result VARCHAR,
party VARCHAR,
first_elected VARCHAR
) ### Response: SELECT result FROM table_name_26 WHERE party = "republican" AND first_elected < 1856 |
what is the crown entity listed before the takeovers panel ? | CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
) | SELECT "crown entities" FROM table_204_988 WHERE id = (SELECT id FROM table_204_988 WHERE "crown entities" = 'takeovers panel') - 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 crown entity listed before the takeovers panel ? ### Input: CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
) ### Response: SELECT "crown entities" FROM table_204_988 WHERE id = (SELECT id FROM table_204_988 WHERE "crown entities" = 'takeovers panel') - 1 |
what was the number of winners from spain ? | CREATE TABLE table_203_600 (
id number,
"rank" text,
"country" text,
"winners" number,
"runners-up" number,
"finals total" number
) | SELECT "winners" FROM table_203_600 WHERE "country" = 'spain' | Below are sql tables 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 number of winners from spain ? ### Input: CREATE TABLE table_203_600 (
id number,
"rank" text,
"country" text,
"winners" number,
"runners-up" number,
"finals total" number
) ### Response: SELECT "winners" FROM table_203_600 WHERE "country" = 'spain' |