Instruction: what is the mchc difference/difference of patient 032-17571 second measured on the last hospital visit compared to the first value measured on the last hospital visit?

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 intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime 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
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
)

Response: SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1 OFFSET 1) - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1)

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the mchc difference/difference of patient 032-17571 second measured on the last hospital visit compared to the first value measured on the last hospital visit? ### 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 intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime 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
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
) ### Response: SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1 OFFSET 1) - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' ORDER BY lab.labresulttime LIMIT 1)


Instruction: provide the number of patients whose diagnoses long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use and drug type is main?

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 diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use" AND prescriptions.drug_type = "MAIN"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose diagnoses long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use and drug type is main? ### 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 diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use" AND prescriptions.drug_type = "MAIN"


Instruction: What is Score, when Attendance is 2,444?

Input:
CREATE TABLE table_name_33 (
    score VARCHAR,
    attendance VARCHAR
)

Response: SELECT score FROM table_name_33 WHERE attendance = "2,444"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Score, when Attendance is 2,444? ### Input: CREATE TABLE table_name_33 (
    score VARCHAR,
    attendance VARCHAR
) ### Response: SELECT score FROM table_name_33 WHERE attendance = "2,444"


Instruction: Between which years were there 241 fokker 70 model cabins built?

Input:
CREATE TABLE table_name_43 (
    period VARCHAR,
    built VARCHAR,
    model VARCHAR
)

Response: SELECT period FROM table_name_43 WHERE built < 241 AND model = "fokker 70"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Between which years were there 241 fokker 70 model cabins built? ### Input: CREATE TABLE table_name_43 (
    period VARCHAR,
    built VARCHAR,
    model VARCHAR
) ### Response: SELECT period FROM table_name_43 WHERE built < 241 AND model = "fokker 70"


Instruction: Name the republican steve sauerberg for august 12, 2008

Input:
CREATE TABLE table_21037 (
    "Poll Source" text,
    "Dates administered" text,
    "Democrat: Dick Durbin" text,
    "Republican: Steve Sauerberg" text,
    "Lead Margin" real
)

Response: SELECT "Republican: Steve Sauerberg" FROM table_21037 WHERE "Dates administered" = 'August 12, 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: Name the republican steve sauerberg for august 12, 2008 ### Input: CREATE TABLE table_21037 (
    "Poll Source" text,
    "Dates administered" text,
    "Democrat: Dick Durbin" text,
    "Republican: Steve Sauerberg" text,
    "Lead Margin" real
) ### Response: SELECT "Republican: Steve Sauerberg" FROM table_21037 WHERE "Dates administered" = 'August 12, 2008'


Instruction: how long did bernard pilon serve in the canadian army ?

Input:
CREATE TABLE table_204_608 (
    id number,
    "name" text,
    "elected party" text,
    "constituency" text,
    "elected date" text,
    "military service" text
)

Response: SELECT "military service" - "military service" FROM table_204_608 WHERE "name" = 'bernard pilon'

Below are sql tables 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 long did bernard pilon serve in the canadian army ? ### Input: CREATE TABLE table_204_608 (
    id number,
    "name" text,
    "elected party" text,
    "constituency" text,
    "elected date" text,
    "military service" text
) ### Response: SELECT "military service" - "military service" FROM table_204_608 WHERE "name" = 'bernard pilon'


Instruction: What is the Money of the T4 Place Player with a Score of 71-66-74-67=278?

Input:
CREATE TABLE table_name_64 (
    money___ INTEGER,
    place VARCHAR,
    score VARCHAR
)

Response: SELECT AVG(money___) AS $__ FROM table_name_64 WHERE place = "t4" AND score = 71 - 66 - 74 - 67 = 278

Below are sql tables 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 Money of the T4 Place Player with a Score of 71-66-74-67=278? ### Input: CREATE TABLE table_name_64 (
    money___ INTEGER,
    place VARCHAR,
    score VARCHAR
) ### Response: SELECT AVG(money___) AS $__ FROM table_name_64 WHERE place = "t4" AND score = 71 - 66 - 74 - 67 = 278


Instruction: How many female patients have a prescription for aspirin ec?

Input:
CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Aspirin EC"

Below are sql tables 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 female patients have a prescription for aspirin ec? ### Input: CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Aspirin EC"


Instruction: what is the number of hours elapsed since the last time patient 033-22108 had a d5w intake on the current intensive care unit visit?

Input:
CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime 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 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 vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'd5w' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of hours elapsed since the last time patient 033-22108 had a d5w intake on the current intensive care unit visit? ### Input: CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime 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 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 vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'd5w' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1


Instruction: What was the date of the game when Atlanta was the home team?

Input:
CREATE TABLE table_51441 (
    "Date" text,
    "Visitor" text,
    "Score" text,
    "Home" text,
    "Decision" text,
    "Attendance" real,
    "Record" text
)

Response: SELECT "Date" FROM table_51441 WHERE "Home" = 'atlanta'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date of the game when Atlanta was the home team? ### Input: CREATE TABLE table_51441 (
    "Date" text,
    "Visitor" text,
    "Score" text,
    "Home" text,
    "Decision" text,
    "Attendance" real,
    "Record" text
) ### Response: SELECT "Date" FROM table_51441 WHERE "Home" = 'atlanta'


Instruction: Who is the Trainer with the Year of 2013?

Input:
CREATE TABLE table_name_33 (
    trainer VARCHAR,
    year VARCHAR
)

Response: SELECT trainer FROM table_name_33 WHERE year = "2013"

Below are sql tables 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 Trainer with the Year of 2013? ### Input: CREATE TABLE table_name_33 (
    trainer VARCHAR,
    year VARCHAR
) ### Response: SELECT trainer FROM table_name_33 WHERE year = "2013"


Instruction: what is the dose of sodium bicarbonate that is first prescribed to patient 10811 since 05/2103?

Input:
CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
)

CREATE TABLE 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 procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

CREATE TABLE 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 diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE 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 microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

Response: SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811) AND prescriptions.drug = 'sodium bicarbonate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-05' ORDER BY prescriptions.startdate LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the dose of sodium bicarbonate that is first prescribed to patient 10811 since 05/2103? ### Input: CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
)

CREATE TABLE 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 procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

CREATE TABLE 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 diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE 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 microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
) ### Response: SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811) AND prescriptions.drug = 'sodium bicarbonate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-05' ORDER BY prescriptions.startdate LIMIT 1


Instruction: In what Round was Pick 138?

Input:
CREATE TABLE table_39413 (
    "Round" real,
    "Pick" real,
    "Player" text,
    "Nationality" text,
    "College" text
)

Response: SELECT SUM("Round") FROM table_39413 WHERE "Pick" = '138'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what Round was Pick 138? ### Input: CREATE TABLE table_39413 (
    "Round" real,
    "Pick" real,
    "Player" text,
    "Nationality" text,
    "College" text
) ### Response: SELECT SUM("Round") FROM table_39413 WHERE "Pick" = '138'


Instruction: What years did the player with a t71 finish win?

Input:
CREATE TABLE table_60790 (
    "Player" text,
    "Country" text,
    "Year(s) won" text,
    "Total" real,
    "To par" text,
    "Finish" text
)

Response: SELECT "Year(s) won" FROM table_60790 WHERE "Finish" = 't71'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What years did the player with a t71 finish win? ### Input: CREATE TABLE table_60790 (
    "Player" text,
    "Country" text,
    "Year(s) won" text,
    "Total" real,
    "To par" text,
    "Finish" text
) ### Response: SELECT "Year(s) won" FROM table_60790 WHERE "Finish" = 't71'


Instruction: What is the defective year for the regular year of 29 days and month sequence of 2?

Input:
CREATE TABLE table_30897 (
    "Month Sequence" real,
    "Numbered Month" text,
    "Month Name" text,
    "Regular Year" text,
    "Defective Year" real,
    "Excessive Year" real
)

Response: SELECT MAX("Defective Year") FROM table_30897 WHERE "Regular Year" = '29 days' AND "Month Sequence" = '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 defective year for the regular year of 29 days and month sequence of 2? ### Input: CREATE TABLE table_30897 (
    "Month Sequence" real,
    "Numbered Month" text,
    "Month Name" text,
    "Regular Year" text,
    "Defective Year" real,
    "Excessive Year" real
) ### Response: SELECT MAX("Defective Year") FROM table_30897 WHERE "Regular Year" = '29 days' AND "Month Sequence" = '2'


Instruction: What is the name of the technician whose team is not 'NYY', and count them by a bar chart

Input:
CREATE TABLE repair (
    repair_ID int,
    name text,
    Launch_Date text,
    Notes text
)

CREATE TABLE machine (
    Machine_ID int,
    Making_Year int,
    Class text,
    Team text,
    Machine_series text,
    value_points real,
    quality_rank int
)

CREATE TABLE technician (
    technician_id real,
    Name text,
    Team text,
    Starting_Year real,
    Age int
)

CREATE TABLE repair_assignment (
    technician_id int,
    repair_ID int,
    Machine_ID int
)

Response: SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name

Below are sql tables 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 technician whose team is not 'NYY', and count them by a bar chart ### Input: CREATE TABLE repair (
    repair_ID int,
    name text,
    Launch_Date text,
    Notes text
)

CREATE TABLE machine (
    Machine_ID int,
    Making_Year int,
    Class text,
    Team text,
    Machine_series text,
    value_points real,
    quality_rank int
)

CREATE TABLE technician (
    technician_id real,
    Name text,
    Team text,
    Starting_Year real,
    Age int
)

CREATE TABLE repair_assignment (
    technician_id int,
    repair_ID int,
    Machine_ID int
) ### Response: SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name


Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart, and sort in desc by the y-axis.

Input:
CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
)

CREATE TABLE employees (
    EMPLOYEE_ID decimal(6,0),
    FIRST_NAME varchar(20),
    LAST_NAME varchar(25),
    EMAIL varchar(25),
    PHONE_NUMBER varchar(20),
    HIRE_DATE date,
    JOB_ID varchar(10),
    SALARY decimal(8,2),
    COMMISSION_PCT decimal(2,2),
    MANAGER_ID decimal(6,0),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE locations (
    LOCATION_ID decimal(4,0),
    STREET_ADDRESS varchar(40),
    POSTAL_CODE varchar(12),
    CITY varchar(30),
    STATE_PROVINCE varchar(25),
    COUNTRY_ID varchar(2)
)

CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

CREATE TABLE regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

CREATE TABLE job_history (
    EMPLOYEE_ID decimal(6,0),
    START_DATE date,
    END_DATE date,
    JOB_ID varchar(10),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
)

Response: SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_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: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart, and sort in desc by the y-axis. ### Input: CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
)

CREATE TABLE employees (
    EMPLOYEE_ID decimal(6,0),
    FIRST_NAME varchar(20),
    LAST_NAME varchar(25),
    EMAIL varchar(25),
    PHONE_NUMBER varchar(20),
    HIRE_DATE date,
    JOB_ID varchar(10),
    SALARY decimal(8,2),
    COMMISSION_PCT decimal(2,2),
    MANAGER_ID decimal(6,0),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE locations (
    LOCATION_ID decimal(4,0),
    STREET_ADDRESS varchar(40),
    POSTAL_CODE varchar(12),
    CITY varchar(30),
    STATE_PROVINCE varchar(25),
    COUNTRY_ID varchar(2)
)

CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

CREATE TABLE regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

CREATE TABLE job_history (
    EMPLOYEE_ID decimal(6,0),
    START_DATE date,
    END_DATE date,
    JOB_ID varchar(10),
    DEPARTMENT_ID decimal(4,0)
)

CREATE TABLE departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
) ### Response: SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC


Instruction: Who was the finalist when the MVP was Romain Sato?

Input:
CREATE TABLE table_2095 (
    "Season" text,
    "Final Venue" text,
    "Champion" text,
    "Result" text,
    "Finalist" text,
    "MVP" text
)

Response: SELECT "Finalist" FROM table_2095 WHERE "MVP" = 'Romain Sato'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the finalist when the MVP was Romain Sato? ### Input: CREATE TABLE table_2095 (
    "Season" text,
    "Final Venue" text,
    "Champion" text,
    "Result" text,
    "Finalist" text,
    "MVP" text
) ### Response: SELECT "Finalist" FROM table_2095 WHERE "MVP" = 'Romain Sato'


Instruction: Which clubs have one or more members whose advisor is '1121'?

Input:
CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)

CREATE TABLE member_of_club (
    stuid number,
    clubid number,
    position text
)

CREATE TABLE club (
    clubid number,
    clubname text,
    clubdesc text,
    clublocation text
)

Response: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121

Below are sql tables 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 clubs have one or more members whose advisor is '1121'? ### Input: CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)

CREATE TABLE member_of_club (
    stuid number,
    clubid number,
    position text
)

CREATE TABLE club (
    clubid number,
    clubname text,
    clubdesc text,
    clublocation text
) ### Response: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121


Instruction: what is the drug that patient 19352 was prescribed for within 2 days after the diagnosis of hx traumatic fracture until 22 months ago?

Input:
CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom 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_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE 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 procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

CREATE TABLE 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
)

Response: SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx traumatic fracture') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')

Below are sql tables 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 drug that patient 19352 was prescribed for within 2 days after the diagnosis of hx traumatic fracture until 22 months ago? ### Input: CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom 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_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE transfers (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    eventtype text,
    careunit text,
    wardid number,
    intime time,
    outtime time
)

CREATE TABLE cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

CREATE TABLE inputevents_cv (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    amount number
)

CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

CREATE TABLE 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 procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
)

CREATE TABLE microbiologyevents (
    row_id number,
    subject_id number,
    hadm_id number,
    charttime time,
    spec_type_desc text,
    org_name text
)

CREATE TABLE patients (
    row_id number,
    subject_id number,
    gender text,
    dob time,
    dod time
)

CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

CREATE TABLE 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
) ### Response: SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx traumatic fracture') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-22 month')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')


Instruction: Visualize the general trend of sum share count over the date of transaction, sort in descending by the X-axis.

Input:
CREATE TABLE Investors (
    investor_id INTEGER,
    Investor_details VARCHAR(255)
)

CREATE TABLE Ref_Transaction_Types (
    transaction_type_code VARCHAR(10),
    transaction_type_description VARCHAR(80)
)

CREATE TABLE Sales (
    sales_transaction_id INTEGER,
    sales_details VARCHAR(255)
)

CREATE TABLE Transactions_Lots (
    transaction_id INTEGER,
    lot_id INTEGER
)

CREATE TABLE Lots (
    lot_id INTEGER,
    investor_id INTEGER,
    lot_details VARCHAR(255)
)

CREATE TABLE Transactions (
    transaction_id INTEGER,
    investor_id INTEGER,
    transaction_type_code VARCHAR(10),
    date_of_transaction DATETIME,
    amount_of_transaction DECIMAL(19,4),
    share_count VARCHAR(40),
    other_details VARCHAR(255)
)

CREATE TABLE Purchases (
    purchase_transaction_id INTEGER,
    purchase_details VARCHAR(255)
)

Response: SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the general trend of sum share count over the date of transaction, sort in descending by the X-axis. ### Input: CREATE TABLE Investors (
    investor_id INTEGER,
    Investor_details VARCHAR(255)
)

CREATE TABLE Ref_Transaction_Types (
    transaction_type_code VARCHAR(10),
    transaction_type_description VARCHAR(80)
)

CREATE TABLE Sales (
    sales_transaction_id INTEGER,
    sales_details VARCHAR(255)
)

CREATE TABLE Transactions_Lots (
    transaction_id INTEGER,
    lot_id INTEGER
)

CREATE TABLE Lots (
    lot_id INTEGER,
    investor_id INTEGER,
    lot_details VARCHAR(255)
)

CREATE TABLE Transactions (
    transaction_id INTEGER,
    investor_id INTEGER,
    transaction_type_code VARCHAR(10),
    date_of_transaction DATETIME,
    amount_of_transaction DECIMAL(19,4),
    share_count VARCHAR(40),
    other_details VARCHAR(255)
)

CREATE TABLE Purchases (
    purchase_transaction_id INTEGER,
    purchase_details VARCHAR(255)
) ### Response: SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC


Instruction: What is the Late Middle English equivalent of the Anglian g, g?

Input:
CREATE TABLE table_28177800_5 (
    late_middle_english VARCHAR,
    late_old_english__anglian_ VARCHAR
)

Response: SELECT late_middle_english FROM table_28177800_5 WHERE late_old_english__anglian_ = "æg, ǣg"

Below are sql tables 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 Late Middle English equivalent of the Anglian g, g? ### Input: CREATE TABLE table_28177800_5 (
    late_middle_english VARCHAR,
    late_old_english__anglian_ VARCHAR
) ### Response: SELECT late_middle_english FROM table_28177800_5 WHERE late_old_english__anglian_ = "æg, ǣg"


Instruction: What was the episode number for 'Going Bodmin'?

Input:
CREATE TABLE table_24058 (
    "Episode No." real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Viewers (millions)" text,
    "Original airdate" text
)

Response: SELECT MAX("Episode No.") FROM table_24058 WHERE "Title" = 'Going Bodmin'

Below are sql tables 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 episode number for 'Going Bodmin'? ### Input: CREATE TABLE table_24058 (
    "Episode No." real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Viewers (millions)" text,
    "Original airdate" text
) ### Response: SELECT MAX("Episode No.") FROM table_24058 WHERE "Title" = 'Going Bodmin'


Instruction: How many touchdowns were scored by William Cole?

Input:
CREATE TABLE table_39585 (
    "Player" text,
    "Touchdowns" real,
    "Extra points" real,
    "Field goals" real,
    "Points" real
)

Response: SELECT "Touchdowns" FROM table_39585 WHERE "Player" = 'william cole'

Below are sql tables 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 touchdowns were scored by William Cole? ### Input: CREATE TABLE table_39585 (
    "Player" text,
    "Touchdowns" real,
    "Extra points" real,
    "Field goals" real,
    "Points" real
) ### Response: SELECT "Touchdowns" FROM table_39585 WHERE "Player" = 'william cole'


Instruction: Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and sort in descending by the bars.

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, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season 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: Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and sort in descending by the bars. ### 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, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC


Instruction: What rounds did RML Racing Silverline and James Nash compete?

Input:
CREATE TABLE table_65927 (
    "Team" text,
    "Car Spec." text,
    "Drivers" text,
    "Class" text,
    "Rounds" text
)

Response: SELECT "Rounds" FROM table_65927 WHERE "Team" = 'rml racing silverline' AND "Drivers" = 'james nash'

Below are sql tables 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 rounds did RML Racing Silverline and James Nash compete? ### Input: CREATE TABLE table_65927 (
    "Team" text,
    "Car Spec." text,
    "Drivers" text,
    "Class" text,
    "Rounds" text
) ### Response: SELECT "Rounds" FROM table_65927 WHERE "Team" = 'rml racing silverline' AND "Drivers" = 'james nash'


Instruction: Name the score for pacers visitor on 14 april 2008

Input:
CREATE TABLE table_11226 (
    "Date" text,
    "Visitor" text,
    "Score" text,
    "Home" text,
    "Leading scorer" text,
    "Attendance" real,
    "Record" text
)

Response: SELECT "Score" FROM table_11226 WHERE "Visitor" = 'pacers' AND "Date" = '14 april 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: Name the score for pacers visitor on 14 april 2008 ### Input: CREATE TABLE table_11226 (
    "Date" text,
    "Visitor" text,
    "Score" text,
    "Home" text,
    "Leading scorer" text,
    "Attendance" real,
    "Record" text
) ### Response: SELECT "Score" FROM table_11226 WHERE "Visitor" = 'pacers' AND "Date" = '14 april 2008'


Instruction: Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, display X-axis in asc order.

Input:
CREATE TABLE PROFESSOR (
    EMP_NUM int,
    DEPT_CODE varchar(10),
    PROF_OFFICE varchar(50),
    PROF_EXTENSION varchar(4),
    PROF_HIGH_DEGREE varchar(5)
)

CREATE TABLE COURSE (
    CRS_CODE varchar(10),
    DEPT_CODE varchar(10),
    CRS_DESCRIPTION varchar(35),
    CRS_CREDIT float(8)
)

CREATE TABLE ENROLL (
    CLASS_CODE varchar(5),
    STU_NUM int,
    ENROLL_GRADE varchar(50)
)

CREATE TABLE DEPARTMENT (
    DEPT_CODE varchar(10),
    DEPT_NAME varchar(30),
    SCHOOL_CODE varchar(8),
    EMP_NUM int,
    DEPT_ADDRESS varchar(20),
    DEPT_EXTENSION varchar(4)
)

CREATE TABLE CLASS (
    CLASS_CODE varchar(5),
    CRS_CODE varchar(10),
    CLASS_SECTION varchar(2),
    CLASS_TIME varchar(20),
    CLASS_ROOM varchar(8),
    PROF_NUM int
)

CREATE TABLE STUDENT (
    STU_NUM int,
    STU_LNAME varchar(15),
    STU_FNAME varchar(15),
    STU_INIT varchar(1),
    STU_DOB datetime,
    STU_HRS int,
    STU_CLASS varchar(2),
    STU_GPA float(8),
    STU_TRANSFER numeric,
    DEPT_CODE varchar(18),
    STU_PHONE varchar(4),
    PROF_NUM int
)

CREATE TABLE EMPLOYEE (
    EMP_NUM int,
    EMP_LNAME varchar(15),
    EMP_FNAME varchar(12),
    EMP_INITIAL varchar(1),
    EMP_JOBCODE varchar(5),
    EMP_HIREDATE datetime,
    EMP_DOB datetime
)

Response: SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" ORDER BY EMP_DOB

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, display X-axis in asc order. ### Input: CREATE TABLE PROFESSOR (
    EMP_NUM int,
    DEPT_CODE varchar(10),
    PROF_OFFICE varchar(50),
    PROF_EXTENSION varchar(4),
    PROF_HIGH_DEGREE varchar(5)
)

CREATE TABLE COURSE (
    CRS_CODE varchar(10),
    DEPT_CODE varchar(10),
    CRS_DESCRIPTION varchar(35),
    CRS_CREDIT float(8)
)

CREATE TABLE ENROLL (
    CLASS_CODE varchar(5),
    STU_NUM int,
    ENROLL_GRADE varchar(50)
)

CREATE TABLE DEPARTMENT (
    DEPT_CODE varchar(10),
    DEPT_NAME varchar(30),
    SCHOOL_CODE varchar(8),
    EMP_NUM int,
    DEPT_ADDRESS varchar(20),
    DEPT_EXTENSION varchar(4)
)

CREATE TABLE CLASS (
    CLASS_CODE varchar(5),
    CRS_CODE varchar(10),
    CLASS_SECTION varchar(2),
    CLASS_TIME varchar(20),
    CLASS_ROOM varchar(8),
    PROF_NUM int
)

CREATE TABLE STUDENT (
    STU_NUM int,
    STU_LNAME varchar(15),
    STU_FNAME varchar(15),
    STU_INIT varchar(1),
    STU_DOB datetime,
    STU_HRS int,
    STU_CLASS varchar(2),
    STU_GPA float(8),
    STU_TRANSFER numeric,
    DEPT_CODE varchar(18),
    STU_PHONE varchar(4),
    PROF_NUM int
)

CREATE TABLE EMPLOYEE (
    EMP_NUM int,
    EMP_LNAME varchar(15),
    EMP_FNAME varchar(12),
    EMP_INITIAL varchar(1),
    EMP_JOBCODE varchar(5),
    EMP_HIREDATE datetime,
    EMP_DOB datetime
) ### Response: SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" ORDER BY EMP_DOB


Instruction: Which City has a Result of w, and a Competition of international friendly (unofficial match), and a Score of 1-0?

Input:
CREATE TABLE table_37478 (
    "Date" text,
    "City" text,
    "Result" text,
    "Score" text,
    "Competition" text
)

Response: SELECT "City" FROM table_37478 WHERE "Result" = 'w' AND "Competition" = 'international friendly (unofficial match)' AND "Score" = '1-0'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which City has a Result of w, and a Competition of international friendly (unofficial match), and a Score of 1-0? ### Input: CREATE TABLE table_37478 (
    "Date" text,
    "City" text,
    "Result" text,
    "Score" text,
    "Competition" text
) ### Response: SELECT "City" FROM table_37478 WHERE "Result" = 'w' AND "Competition" = 'international friendly (unofficial match)' AND "Score" = '1-0'


Instruction: What is the 1995 value with of the 1993 ATP Masters Series?

Input:
CREATE TABLE table_34222 (
    "Tournament" text,
    "1990" text,
    "1991" text,
    "1992" text,
    "1993" text,
    "1994" text,
    "1995" text,
    "1996" text,
    "1997" text,
    "1998" text,
    "Career SR" text,
    "Career Win-Loss" text
)

Response: SELECT "1995" FROM table_34222 WHERE "1993" = 'atp masters series'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 1995 value with of the 1993 ATP Masters Series? ### Input: CREATE TABLE table_34222 (
    "Tournament" text,
    "1990" text,
    "1991" text,
    "1992" text,
    "1993" text,
    "1994" text,
    "1995" text,
    "1996" text,
    "1997" text,
    "1998" text,
    "Career SR" text,
    "Career Win-Loss" text
) ### Response: SELECT "1995" FROM table_34222 WHERE "1993" = 'atp masters series'


Instruction: What was the Pick Number when the position was wide receiver, the college was Southern Miss with an overall less than 186?

Input:
CREATE TABLE table_6626 (
    "Round" real,
    "Pick #" real,
    "Overall" real,
    "Name" text,
    "Position" text,
    "College" text
)

Response: SELECT AVG("Pick #") FROM table_6626 WHERE "Position" = 'wide receiver' AND "College" = 'southern miss' AND "Overall" < '186'

Below are sql tables 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 Pick Number when the position was wide receiver, the college was Southern Miss with an overall less than 186? ### Input: CREATE TABLE table_6626 (
    "Round" real,
    "Pick #" real,
    "Overall" real,
    "Name" text,
    "Position" text,
    "College" text
) ### Response: SELECT AVG("Pick #") FROM table_6626 WHERE "Position" = 'wide receiver' AND "College" = 'southern miss' AND "Overall" < '186'


Instruction: When was the first beatification in Korea that was canonised before 1984?

Input:
CREATE TABLE table_32112 (
    "Name" text,
    "Martyred" real,
    "Place" text,
    "Beatified" real,
    "Canonised" real
)

Response: SELECT MIN("Beatified") FROM table_32112 WHERE "Place" = 'korea' AND "Canonised" < '1984'

Below are sql tables 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 first beatification in Korea that was canonised before 1984? ### Input: CREATE TABLE table_32112 (
    "Name" text,
    "Martyred" real,
    "Place" text,
    "Beatified" real,
    "Canonised" real
) ### Response: SELECT MIN("Beatified") FROM table_32112 WHERE "Place" = 'korea' AND "Canonised" < '1984'


Instruction: What horse does todd pletcher ride with odds of 14.20-1?

Input:
CREATE TABLE table_55341 (
    "Finish Position" text,
    "Lengths Behind" text,
    "Post Position" real,
    "Horse name" text,
    "Trainer" text,
    "Jockey" text,
    "Owner" text,
    "Post Time Odds" text
)

Response: SELECT "Horse name" FROM table_55341 WHERE "Jockey" = 'todd pletcher' AND "Post Time Odds" = '14.20-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 horse does todd pletcher ride with odds of 14.20-1? ### Input: CREATE TABLE table_55341 (
    "Finish Position" text,
    "Lengths Behind" text,
    "Post Position" real,
    "Horse name" text,
    "Trainer" text,
    "Jockey" text,
    "Owner" text,
    "Post Time Odds" text
) ### Response: SELECT "Horse name" FROM table_55341 WHERE "Jockey" = 'todd pletcher' AND "Post Time Odds" = '14.20-1'


Instruction: how many episodes in the serie were title 'the key

Input:
CREATE TABLE table_74425 (
    "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("No. in series") FROM table_74425 WHERE "Title" = 'The Key'

Below are sql tables 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 episodes in the serie were title 'the key ### Input: CREATE TABLE table_74425 (
    "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("No. in series") FROM table_74425 WHERE "Title" = 'The Key'


Instruction: get the number of patients with diagnoses icd9 code 99662 who had ascitic fluid lab test done.

Input:
CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "99662" AND lab.fluid = "Ascites"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get the number of patients with diagnoses icd9 code 99662 who had ascitic fluid lab test done. ### Input: CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "99662" AND lab.fluid = "Ascites"


Instruction: What school is in Ligonier?

Input:
CREATE TABLE table_name_11 (
    school VARCHAR,
    location VARCHAR
)

Response: SELECT school FROM table_name_11 WHERE location = "ligonier"

Below are sql tables 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 school is in Ligonier? ### Input: CREATE TABLE table_name_11 (
    school VARCHAR,
    location VARCHAR
) ### Response: SELECT school FROM table_name_11 WHERE location = "ligonier"


Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id , and rank total number in descending order please.

Input:
CREATE TABLE departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
)

CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

CREATE TABLE 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 jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
)

CREATE TABLE locations (
    LOCATION_ID decimal(4,0),
    STREET_ADDRESS varchar(40),
    POSTAL_CODE varchar(12),
    CITY varchar(30),
    STATE_PROVINCE varchar(25),
    COUNTRY_ID varchar(2)
)

CREATE TABLE regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

CREATE TABLE job_history (
    EMPLOYEE_ID decimal(6,0),
    START_DATE date,
    END_DATE date,
    JOB_ID varchar(10),
    DEPARTMENT_ID decimal(4,0)
)

Response: SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_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: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id , and rank total number in descending order please. ### Input: CREATE TABLE departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
)

CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

CREATE TABLE 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 jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
)

CREATE TABLE locations (
    LOCATION_ID decimal(4,0),
    STREET_ADDRESS varchar(40),
    POSTAL_CODE varchar(12),
    CITY varchar(30),
    STATE_PROVINCE varchar(25),
    COUNTRY_ID varchar(2)
)

CREATE TABLE regions (
    REGION_ID decimal(5,0),
    REGION_NAME varchar(25)
)

CREATE TABLE job_history (
    EMPLOYEE_ID decimal(6,0),
    START_DATE date,
    END_DATE date,
    JOB_ID varchar(10),
    DEPARTMENT_ID decimal(4,0)
) ### Response: SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC


Instruction: How many schools did Derrick Green attend?

Input:
CREATE TABLE table_17075 (
    "Player" text,
    "Position" text,
    "School" text,
    "Hometown" text,
    "College" text
)

Response: SELECT COUNT("School") FROM table_17075 WHERE "Player" = 'Derrick Green'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many schools did Derrick Green attend? ### Input: CREATE TABLE table_17075 (
    "Player" text,
    "Position" text,
    "School" text,
    "Hometown" text,
    "College" text
) ### Response: SELECT COUNT("School") FROM table_17075 WHERE "Player" = 'Derrick Green'


Instruction: what is admission type and procedure long title of subject id 2560?

Input:
CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

Response: SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"

Below are sql tables 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 admission type and procedure long title of subject id 2560? ### Input: CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"


Instruction: What rank is Germany?

Input:
CREATE TABLE table_name_74 (
    rank VARCHAR,
    country VARCHAR
)

Response: SELECT rank FROM table_name_74 WHERE country = "germany"

Below are sql tables 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 is Germany? ### Input: CREATE TABLE table_name_74 (
    rank VARCHAR,
    country VARCHAR
) ### Response: SELECT rank FROM table_name_74 WHERE country = "germany"


Instruction: When the Away team is south melbourne, what's the Home team score?

Input:
CREATE TABLE table_77872 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
)

Response: SELECT "Home team score" FROM table_77872 WHERE "Away team" = 'south melbourne'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Away team is south melbourne, what's the Home team score? ### Input: CREATE TABLE table_77872 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
) ### Response: SELECT "Home team score" FROM table_77872 WHERE "Away team" = 'south melbourne'


Instruction: Where did the cable-stayed Badong Bridge open in 2005?

Input:
CREATE TABLE table_name_18 (
    location VARCHAR,
    name VARCHAR,
    type VARCHAR,
    opened VARCHAR
)

Response: SELECT location FROM table_name_18 WHERE type = "cable-stayed" AND opened = 2005 AND name = "badong bridge"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did the cable-stayed Badong Bridge open in 2005? ### Input: CREATE TABLE table_name_18 (
    location VARCHAR,
    name VARCHAR,
    type VARCHAR,
    opened VARCHAR
) ### Response: SELECT location FROM table_name_18 WHERE type = "cable-stayed" AND opened = 2005 AND name = "badong bridge"


Instruction: Draw a bar chart of dept code versus the total number, order y axis in descending order.

Input:
CREATE TABLE COURSE (
    CRS_CODE varchar(10),
    DEPT_CODE varchar(10),
    CRS_DESCRIPTION varchar(35),
    CRS_CREDIT float(8)
)

CREATE TABLE ENROLL (
    CLASS_CODE varchar(5),
    STU_NUM int,
    ENROLL_GRADE varchar(50)
)

CREATE TABLE DEPARTMENT (
    DEPT_CODE varchar(10),
    DEPT_NAME varchar(30),
    SCHOOL_CODE varchar(8),
    EMP_NUM int,
    DEPT_ADDRESS varchar(20),
    DEPT_EXTENSION varchar(4)
)

CREATE TABLE STUDENT (
    STU_NUM int,
    STU_LNAME varchar(15),
    STU_FNAME varchar(15),
    STU_INIT varchar(1),
    STU_DOB datetime,
    STU_HRS int,
    STU_CLASS varchar(2),
    STU_GPA float(8),
    STU_TRANSFER numeric,
    DEPT_CODE varchar(18),
    STU_PHONE varchar(4),
    PROF_NUM int
)

CREATE TABLE CLASS (
    CLASS_CODE varchar(5),
    CRS_CODE varchar(10),
    CLASS_SECTION varchar(2),
    CLASS_TIME varchar(20),
    CLASS_ROOM varchar(8),
    PROF_NUM int
)

CREATE TABLE PROFESSOR (
    EMP_NUM int,
    DEPT_CODE varchar(10),
    PROF_OFFICE varchar(50),
    PROF_EXTENSION varchar(4),
    PROF_HIGH_DEGREE varchar(5)
)

CREATE TABLE EMPLOYEE (
    EMP_NUM int,
    EMP_LNAME varchar(15),
    EMP_FNAME varchar(12),
    EMP_INITIAL varchar(1),
    EMP_JOBCODE varchar(5),
    EMP_HIREDATE datetime,
    EMP_DOB datetime
)

Response: SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of dept code versus the total number, order y axis in descending order. ### Input: CREATE TABLE COURSE (
    CRS_CODE varchar(10),
    DEPT_CODE varchar(10),
    CRS_DESCRIPTION varchar(35),
    CRS_CREDIT float(8)
)

CREATE TABLE ENROLL (
    CLASS_CODE varchar(5),
    STU_NUM int,
    ENROLL_GRADE varchar(50)
)

CREATE TABLE DEPARTMENT (
    DEPT_CODE varchar(10),
    DEPT_NAME varchar(30),
    SCHOOL_CODE varchar(8),
    EMP_NUM int,
    DEPT_ADDRESS varchar(20),
    DEPT_EXTENSION varchar(4)
)

CREATE TABLE STUDENT (
    STU_NUM int,
    STU_LNAME varchar(15),
    STU_FNAME varchar(15),
    STU_INIT varchar(1),
    STU_DOB datetime,
    STU_HRS int,
    STU_CLASS varchar(2),
    STU_GPA float(8),
    STU_TRANSFER numeric,
    DEPT_CODE varchar(18),
    STU_PHONE varchar(4),
    PROF_NUM int
)

CREATE TABLE CLASS (
    CLASS_CODE varchar(5),
    CRS_CODE varchar(10),
    CLASS_SECTION varchar(2),
    CLASS_TIME varchar(20),
    CLASS_ROOM varchar(8),
    PROF_NUM int
)

CREATE TABLE PROFESSOR (
    EMP_NUM int,
    DEPT_CODE varchar(10),
    PROF_OFFICE varchar(50),
    PROF_EXTENSION varchar(4),
    PROF_HIGH_DEGREE varchar(5)
)

CREATE TABLE EMPLOYEE (
    EMP_NUM int,
    EMP_LNAME varchar(15),
    EMP_FNAME varchar(12),
    EMP_INITIAL varchar(1),
    EMP_JOBCODE varchar(5),
    EMP_HIREDATE datetime,
    EMP_DOB datetime
) ### Response: SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC


Instruction: What is the second leg for Team 1 Servette?

Input:
CREATE TABLE table_60354 (
    "Team 1" text,
    "Agg." text,
    "Team 2" text,
    "1st leg" text,
    "2nd leg" text
)

Response: SELECT "2nd leg" FROM table_60354 WHERE "Team 1" = 'servette'

Below are sql tables 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 second leg for Team 1 Servette? ### Input: CREATE TABLE table_60354 (
    "Team 1" text,
    "Agg." text,
    "Team 2" text,
    "1st leg" text,
    "2nd leg" text
) ### Response: SELECT "2nd leg" FROM table_60354 WHERE "Team 1" = 'servette'


Instruction: how many days has passed since patient 005-4471 received his first diagnosis of post spinal surgery - cervical on their current hospital encounter?

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 treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime 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 allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
)

CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

Response: SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'post spinal surgery - cervical' ORDER BY diagnosis.diagnosistime LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days has passed since patient 005-4471 received his first diagnosis of post spinal surgery - cervical on their current hospital encounter? ### 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 treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime 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 allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime time
)

CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime time
)

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
) ### Response: SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'post spinal surgery - cervical' ORDER BY diagnosis.diagnosistime LIMIT 1


Instruction: Whcih was the Class AAA in school year 2006-07?

Input:
CREATE TABLE table_name_85 (
    class_aAA VARCHAR,
    school_year VARCHAR
)

Response: SELECT class_aAA FROM table_name_85 WHERE school_year = "2006-07"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Whcih was the Class AAA in school year 2006-07? ### Input: CREATE TABLE table_name_85 (
    class_aAA VARCHAR,
    school_year VARCHAR
) ### Response: SELECT class_aAA FROM table_name_85 WHERE school_year = "2006-07"


Instruction: What Russian has an Avoirdupois value of 0.686 gr?

Input:
CREATE TABLE table_name_16 (
    russian VARCHAR,
    avoirdupois_value VARCHAR
)

Response: SELECT russian FROM table_name_16 WHERE avoirdupois_value = "0.686 gr"

Below are sql tables 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 Russian has an Avoirdupois value of 0.686 gr? ### Input: CREATE TABLE table_name_16 (
    russian VARCHAR,
    avoirdupois_value VARCHAR
) ### Response: SELECT russian FROM table_name_16 WHERE avoirdupois_value = "0.686 gr"


Instruction: List the positions of players whose average number of points scored by that position is larger than 20, compare the number of positions, and order total number in descending order.

Input:
CREATE TABLE club (
    Club_ID int,
    name text,
    Region text,
    Start_year text
)

CREATE TABLE competition_result (
    Competition_ID int,
    Club_ID_1 int,
    Club_ID_2 int,
    Score text
)

CREATE TABLE player (
    Player_ID int,
    name text,
    Position text,
    Club_ID int,
    Apps real,
    Tries real,
    Goals text,
    Points real
)

CREATE TABLE competition (
    Competition_ID int,
    Year real,
    Competition_type text,
    Country text
)

CREATE TABLE club_rank (
    Rank real,
    Club_ID int,
    Gold real,
    Silver real,
    Bronze real,
    Total real
)

Response: SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) 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: List the positions of players whose average number of points scored by that position is larger than 20, compare the number of positions, and order total number in descending order. ### Input: CREATE TABLE club (
    Club_ID int,
    name text,
    Region text,
    Start_year text
)

CREATE TABLE competition_result (
    Competition_ID int,
    Club_ID_1 int,
    Club_ID_2 int,
    Score text
)

CREATE TABLE player (
    Player_ID int,
    name text,
    Position text,
    Club_ID int,
    Apps real,
    Tries real,
    Goals text,
    Points real
)

CREATE TABLE competition (
    Competition_ID int,
    Year real,
    Competition_type text,
    Country text
)

CREATE TABLE club_rank (
    Rank real,
    Club_ID int,
    Gold real,
    Silver real,
    Bronze real,
    Total real
) ### Response: SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC


Instruction: What player has The United States as the country, with t2 as the place?

Input:
CREATE TABLE table_name_9 (
    player VARCHAR,
    country VARCHAR,
    place VARCHAR
)

Response: SELECT player FROM table_name_9 WHERE country = "united states" AND place = "t2"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player has The United States as the country, with t2 as the place? ### Input: CREATE TABLE table_name_9 (
    player VARCHAR,
    country VARCHAR,
    place VARCHAR
) ### Response: SELECT player FROM table_name_9 WHERE country = "united states" AND place = "t2"


Instruction: What is Apogee, when Inclination is 65 , and when Launch Date/Time is ( GMT ) is 15 February 1973, 01:11?

Input:
CREATE TABLE table_12858 (
    "Designation" text,
    "Launch date/time ( GMT )" text,
    "Mass" text,
    "Apogee" text,
    "Inclination" text
)

Response: SELECT "Apogee" FROM table_12858 WHERE "Inclination" = '65°' AND "Launch date/time ( GMT )" = '15 february 1973, 01:11'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Apogee, when Inclination is 65 , and when Launch Date/Time is ( GMT ) is 15 February 1973, 01:11? ### Input: CREATE TABLE table_12858 (
    "Designation" text,
    "Launch date/time ( GMT )" text,
    "Mass" text,
    "Apogee" text,
    "Inclination" text
) ### Response: SELECT "Apogee" FROM table_12858 WHERE "Inclination" = '65°' AND "Launch date/time ( GMT )" = '15 february 1973, 01:11'


Instruction: get me the number of government health insurance patients who had closed [needle] biopsy of tongue.

Input:
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
)

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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Closed [needle] biopsy of tongue"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the number of government health insurance patients who had closed [needle] biopsy of tongue. ### Input: 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
)

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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Closed [needle] biopsy of tongue"


Instruction: Who is the opponent in game 5?

Input:
CREATE TABLE table_20745706_1 (
    opponent VARCHAR,
    _number VARCHAR
)

Response: SELECT opponent FROM table_20745706_1 WHERE _number = "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: Who is the opponent in game 5? ### Input: CREATE TABLE table_20745706_1 (
    opponent VARCHAR,
    _number VARCHAR
) ### Response: SELECT opponent FROM table_20745706_1 WHERE _number = "5"


Instruction: What is the round for the qualifying phase with a draw date on 16 July 2010?

Input:
CREATE TABLE table_62144 (
    "Phase" text,
    "Round" text,
    "Draw date" text,
    "First leg" text,
    "Second leg" text
)

Response: SELECT "Round" FROM table_62144 WHERE "Phase" = 'qualifying' AND "Draw date" = '16 july 2010'

Below are sql tables 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 round for the qualifying phase with a draw date on 16 July 2010? ### Input: CREATE TABLE table_62144 (
    "Phase" text,
    "Round" text,
    "Draw date" text,
    "First leg" text,
    "Second leg" text
) ### Response: SELECT "Round" FROM table_62144 WHERE "Phase" = 'qualifying' AND "Draw date" = '16 july 2010'


Instruction: Show all locations and the total number of platforms for all train stations in each location in a bar chart, sort by the Location in ascending.

Input:
CREATE TABLE train (
    Train_ID int,
    Name text,
    Time text,
    Service text
)

CREATE TABLE train_station (
    Train_ID int,
    Station_ID int
)

CREATE TABLE station (
    Station_ID int,
    Name text,
    Annual_entry_exit real,
    Annual_interchanges real,
    Total_Passengers real,
    Location text,
    Main_Services text,
    Number_of_Platforms int
)

Response: SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all locations and the total number of platforms for all train stations in each location in a bar chart, sort by the Location in ascending. ### Input: CREATE TABLE train (
    Train_ID int,
    Name text,
    Time text,
    Service text
)

CREATE TABLE train_station (
    Train_ID int,
    Station_ID int
)

CREATE TABLE station (
    Station_ID int,
    Name text,
    Annual_entry_exit real,
    Annual_interchanges real,
    Total_Passengers real,
    Location text,
    Main_Services text,
    Number_of_Platforms int
) ### Response: SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location