Instruction: Find the total number of students for each department with a bar chart, and could you list y axis in descending order?

Input:
CREATE TABLE classroom (
    building varchar(15),
    room_number varchar(7),
    capacity numeric(4,0)
)

CREATE TABLE advisor (
    s_ID varchar(5),
    i_ID varchar(5)
)

CREATE TABLE instructor (
    ID varchar(5),
    name varchar(20),
    dept_name varchar(20),
    salary numeric(8,2)
)

CREATE TABLE prereq (
    course_id varchar(8),
    prereq_id varchar(8)
)

CREATE TABLE teaches (
    ID varchar(5),
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0)
)

CREATE TABLE section (
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0),
    building varchar(15),
    room_number varchar(7),
    time_slot_id varchar(4)
)

CREATE TABLE takes (
    ID varchar(5),
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0),
    grade varchar(2)
)

CREATE TABLE department (
    dept_name varchar(20),
    building varchar(15),
    budget numeric(12,2)
)

CREATE TABLE course (
    course_id varchar(8),
    title varchar(50),
    dept_name varchar(20),
    credits numeric(2,0)
)

CREATE TABLE student (
    ID varchar(5),
    name varchar(20),
    dept_name varchar(20),
    tot_cred numeric(3,0)
)

CREATE TABLE time_slot (
    time_slot_id varchar(4),
    day varchar(1),
    start_hr numeric(2),
    start_min numeric(2),
    end_hr numeric(2),
    end_min numeric(2)
)

Response: SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.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: Find the total number of students for each department with a bar chart, and could you list y axis in descending order? ### Input: CREATE TABLE classroom (
    building varchar(15),
    room_number varchar(7),
    capacity numeric(4,0)
)

CREATE TABLE advisor (
    s_ID varchar(5),
    i_ID varchar(5)
)

CREATE TABLE instructor (
    ID varchar(5),
    name varchar(20),
    dept_name varchar(20),
    salary numeric(8,2)
)

CREATE TABLE prereq (
    course_id varchar(8),
    prereq_id varchar(8)
)

CREATE TABLE teaches (
    ID varchar(5),
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0)
)

CREATE TABLE section (
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0),
    building varchar(15),
    room_number varchar(7),
    time_slot_id varchar(4)
)

CREATE TABLE takes (
    ID varchar(5),
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0),
    grade varchar(2)
)

CREATE TABLE department (
    dept_name varchar(20),
    building varchar(15),
    budget numeric(12,2)
)

CREATE TABLE course (
    course_id varchar(8),
    title varchar(50),
    dept_name varchar(20),
    credits numeric(2,0)
)

CREATE TABLE student (
    ID varchar(5),
    name varchar(20),
    dept_name varchar(20),
    tot_cred numeric(3,0)
)

CREATE TABLE time_slot (
    time_slot_id varchar(4),
    day varchar(1),
    start_hr numeric(2),
    start_min numeric(2),
    end_hr numeric(2),
    end_min numeric(2)
) ### Response: SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC


Instruction: does toronto 's population grow more or less than hamilton 's ?

Input:
CREATE TABLE table_204_113 (
    id number,
    "rank" number,
    "area" text,
    "state/\nprovince" text,
    "csa/cma\n2009 population" number,
    "projected\n2025 population" number,
    "projected increase\n2009-2025" number
)

Response: SELECT (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'toronto') > (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'hamilton')

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does toronto 's population grow more or less than hamilton 's ? ### Input: CREATE TABLE table_204_113 (
    id number,
    "rank" number,
    "area" text,
    "state/\nprovince" text,
    "csa/cma\n2009 population" number,
    "projected\n2025 population" number,
    "projected increase\n2009-2025" number
) ### Response: SELECT (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'toronto') > (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'hamilton')


Instruction: provide the number of patients whose marital status is married and admission year is less than 2108?

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

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

CREATE TABLE 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 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 WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2108"

Below are sql tables 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 marital status is married and admission year is less than 2108? ### Input: CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

CREATE TABLE 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 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 WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2108"


Instruction: What is the draw number that has 59 points?

Input:
CREATE TABLE table_54761 (
    "Draw" real,
    "Artist" text,
    "Song" text,
    "Points" real,
    "Place" text
)

Response: SELECT AVG("Draw") FROM table_54761 WHERE "Points" = '59'

Below are sql tables 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 draw number that has 59 points? ### Input: CREATE TABLE table_54761 (
    "Draw" real,
    "Artist" text,
    "Song" text,
    "Points" real,
    "Place" text
) ### Response: SELECT AVG("Draw") FROM table_54761 WHERE "Points" = '59'


Instruction: what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\cardiac cath?

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

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

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

Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\cardiac cath? ### 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 procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

CREATE TABLE 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
) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"


Instruction: what was patient 025-30850's weight the last time in 06/2105?

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

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

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

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

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

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

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

Response: SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 025-30850's weight the last time in 06/2105? ### Input: CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

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

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

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

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

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
) ### Response: SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT 1


Instruction: Visualize a pie chart about the proportion of Team_Name and ACC_Percent.

Input:
CREATE TABLE basketball_match (
    Team_ID int,
    School_ID int,
    Team_Name text,
    ACC_Regular_Season text,
    ACC_Percent text,
    ACC_Home text,
    ACC_Road text,
    All_Games text,
    All_Games_Percent int,
    All_Home text,
    All_Road text,
    All_Neutral text
)

CREATE TABLE university (
    School_ID int,
    School text,
    Location text,
    Founded real,
    Affiliation text,
    Enrollment real,
    Nickname text,
    Primary_conference text
)

Response: SELECT Team_Name, ACC_Percent FROM basketball_match

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a pie chart about the proportion of Team_Name and ACC_Percent. ### Input: CREATE TABLE basketball_match (
    Team_ID int,
    School_ID int,
    Team_Name text,
    ACC_Regular_Season text,
    ACC_Percent text,
    ACC_Home text,
    ACC_Road text,
    All_Games text,
    All_Games_Percent int,
    All_Home text,
    All_Road text,
    All_Neutral text
)

CREATE TABLE university (
    School_ID int,
    School text,
    Location text,
    Founded real,
    Affiliation text,
    Enrollment real,
    Nickname text,
    Primary_conference text
) ### Response: SELECT Team_Name, ACC_Percent FROM basketball_match


Instruction: please show me flights from PITTSBURGH to BOSTON on saturday morning after 800

Input:
CREATE TABLE ground_service (
    city_code text,
    airport_code text,
    transport_type text,
    ground_fare int
)

CREATE TABLE time_interval (
    period text,
    begin_time int,
    end_time int
)

CREATE TABLE restriction (
    restriction_code text,
    advance_purchase int,
    stopovers text,
    saturday_stay_required text,
    minimum_stay int,
    maximum_stay int,
    application text,
    no_discounts text
)

CREATE TABLE days (
    days_code varchar,
    day_name varchar
)

CREATE TABLE flight_fare (
    flight_id int,
    fare_id int
)

CREATE TABLE fare_basis (
    fare_basis_code text,
    booking_class text,
    class_type text,
    premium text,
    economy text,
    discounted text,
    night text,
    season text,
    basis_days text
)

CREATE TABLE flight_leg (
    flight_id int,
    leg_number int,
    leg_flight int
)

CREATE TABLE class_of_service (
    booking_class varchar,
    rank int,
    class_description text
)

CREATE TABLE code_description (
    code varchar,
    description text
)

CREATE TABLE compartment_class (
    compartment varchar,
    class_type varchar
)

CREATE TABLE time_zone (
    time_zone_code text,
    time_zone_name text,
    hours_from_gmt int
)

CREATE TABLE flight_stop (
    flight_id int,
    stop_number int,
    stop_days text,
    stop_airport text,
    arrival_time int,
    arrival_airline text,
    arrival_flight_number int,
    departure_time int,
    departure_airline text,
    departure_flight_number int,
    stop_time int
)

CREATE TABLE fare (
    fare_id int,
    from_airport varchar,
    to_airport varchar,
    fare_basis_code text,
    fare_airline text,
    restriction_code text,
    one_direction_cost int,
    round_trip_cost int,
    round_trip_required varchar
)

CREATE TABLE airline (
    airline_code varchar,
    airline_name text,
    note text
)

CREATE TABLE flight (
    aircraft_code_sequence text,
    airline_code varchar,
    airline_flight text,
    arrival_time int,
    connections int,
    departure_time int,
    dual_carrier text,
    flight_days text,
    flight_id int,
    flight_number int,
    from_airport varchar,
    meal_code text,
    stops int,
    time_elapsed int,
    to_airport varchar
)

CREATE TABLE date_day (
    month_number int,
    day_number int,
    year int,
    day_name varchar
)

CREATE TABLE state (
    state_code text,
    state_name text,
    country_name text
)

CREATE TABLE dual_carrier (
    main_airline varchar,
    low_flight_number int,
    high_flight_number int,
    dual_airline varchar,
    service_name text
)

CREATE TABLE airport_service (
    city_code varchar,
    airport_code varchar,
    miles_distant int,
    direction varchar,
    minutes_distant int
)

CREATE TABLE equipment_sequence (
    aircraft_code_sequence varchar,
    aircraft_code varchar
)

CREATE TABLE aircraft (
    aircraft_code varchar,
    aircraft_description varchar,
    manufacturer varchar,
    basic_type varchar,
    engines int,
    propulsion varchar,
    wide_body varchar,
    wing_span int,
    length int,
    weight int,
    capacity int,
    pay_load int,
    cruising_speed int,
    range_miles int,
    pressurized varchar
)

CREATE TABLE city (
    city_code varchar,
    city_name varchar,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar
)

CREATE TABLE food_service (
    meal_code text,
    meal_number int,
    compartment text,
    meal_description varchar
)

CREATE TABLE airport (
    airport_code varchar,
    airport_name text,
    airport_location text,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar,
    minimum_connect_time int
)

CREATE TABLE month (
    month_number int,
    month_name text
)

Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 800 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: please show me flights from PITTSBURGH to BOSTON on saturday morning after 800 ### Input: CREATE TABLE ground_service (
    city_code text,
    airport_code text,
    transport_type text,
    ground_fare int
)

CREATE TABLE time_interval (
    period text,
    begin_time int,
    end_time int
)

CREATE TABLE restriction (
    restriction_code text,
    advance_purchase int,
    stopovers text,
    saturday_stay_required text,
    minimum_stay int,
    maximum_stay int,
    application text,
    no_discounts text
)

CREATE TABLE days (
    days_code varchar,
    day_name varchar
)

CREATE TABLE flight_fare (
    flight_id int,
    fare_id int
)

CREATE TABLE fare_basis (
    fare_basis_code text,
    booking_class text,
    class_type text,
    premium text,
    economy text,
    discounted text,
    night text,
    season text,
    basis_days text
)

CREATE TABLE flight_leg (
    flight_id int,
    leg_number int,
    leg_flight int
)

CREATE TABLE class_of_service (
    booking_class varchar,
    rank int,
    class_description text
)

CREATE TABLE code_description (
    code varchar,
    description text
)

CREATE TABLE compartment_class (
    compartment varchar,
    class_type varchar
)

CREATE TABLE time_zone (
    time_zone_code text,
    time_zone_name text,
    hours_from_gmt int
)

CREATE TABLE flight_stop (
    flight_id int,
    stop_number int,
    stop_days text,
    stop_airport text,
    arrival_time int,
    arrival_airline text,
    arrival_flight_number int,
    departure_time int,
    departure_airline text,
    departure_flight_number int,
    stop_time int
)

CREATE TABLE fare (
    fare_id int,
    from_airport varchar,
    to_airport varchar,
    fare_basis_code text,
    fare_airline text,
    restriction_code text,
    one_direction_cost int,
    round_trip_cost int,
    round_trip_required varchar
)

CREATE TABLE airline (
    airline_code varchar,
    airline_name text,
    note text
)

CREATE TABLE flight (
    aircraft_code_sequence text,
    airline_code varchar,
    airline_flight text,
    arrival_time int,
    connections int,
    departure_time int,
    dual_carrier text,
    flight_days text,
    flight_id int,
    flight_number int,
    from_airport varchar,
    meal_code text,
    stops int,
    time_elapsed int,
    to_airport varchar
)

CREATE TABLE date_day (
    month_number int,
    day_number int,
    year int,
    day_name varchar
)

CREATE TABLE state (
    state_code text,
    state_name text,
    country_name text
)

CREATE TABLE dual_carrier (
    main_airline varchar,
    low_flight_number int,
    high_flight_number int,
    dual_airline varchar,
    service_name text
)

CREATE TABLE airport_service (
    city_code varchar,
    airport_code varchar,
    miles_distant int,
    direction varchar,
    minutes_distant int
)

CREATE TABLE equipment_sequence (
    aircraft_code_sequence varchar,
    aircraft_code varchar
)

CREATE TABLE aircraft (
    aircraft_code varchar,
    aircraft_description varchar,
    manufacturer varchar,
    basic_type varchar,
    engines int,
    propulsion varchar,
    wide_body varchar,
    wing_span int,
    length int,
    weight int,
    capacity int,
    pay_load int,
    cruising_speed int,
    range_miles int,
    pressurized varchar
)

CREATE TABLE city (
    city_code varchar,
    city_name varchar,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar
)

CREATE TABLE food_service (
    meal_code text,
    meal_number int,
    compartment text,
    meal_description varchar
)

CREATE TABLE airport (
    airport_code varchar,
    airport_name text,
    airport_location text,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar,
    minimum_connect_time int
)

CREATE TABLE month (
    month_number int,
    month_name text
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 800 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200


Instruction: Who had a Qualifying 2 time over 58.669 for Team Australia?

Input:
CREATE TABLE table_38483 (
    "Name" text,
    "Team" text,
    "Qual 1" text,
    "Qual 2" real,
    "Best" real
)

Response: SELECT "Name" FROM table_38483 WHERE "Qual 2" > '58.669' AND "Team" = 'team australia'

Below are sql tables 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 had a Qualifying 2 time over 58.669 for Team Australia? ### Input: CREATE TABLE table_38483 (
    "Name" text,
    "Team" text,
    "Qual 1" text,
    "Qual 2" real,
    "Best" real
) ### Response: SELECT "Name" FROM table_38483 WHERE "Qual 2" > '58.669' AND "Team" = 'team australia'


Instruction: flights from WESTCHESTER COUNTY to ST. PAUL

Input:
CREATE TABLE city (
    city_code varchar,
    city_name varchar,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar
)

CREATE TABLE flight_fare (
    flight_id int,
    fare_id int
)

CREATE TABLE flight_stop (
    flight_id int,
    stop_number int,
    stop_days text,
    stop_airport text,
    arrival_time int,
    arrival_airline text,
    arrival_flight_number int,
    departure_time int,
    departure_airline text,
    departure_flight_number int,
    stop_time int
)

CREATE TABLE dual_carrier (
    main_airline varchar,
    low_flight_number int,
    high_flight_number int,
    dual_airline varchar,
    service_name text
)

CREATE TABLE ground_service (
    city_code text,
    airport_code text,
    transport_type text,
    ground_fare int
)

CREATE TABLE flight (
    aircraft_code_sequence text,
    airline_code varchar,
    airline_flight text,
    arrival_time int,
    connections int,
    departure_time int,
    dual_carrier text,
    flight_days text,
    flight_id int,
    flight_number int,
    from_airport varchar,
    meal_code text,
    stops int,
    time_elapsed int,
    to_airport varchar
)

CREATE TABLE fare_basis (
    fare_basis_code text,
    booking_class text,
    class_type text,
    premium text,
    economy text,
    discounted text,
    night text,
    season text,
    basis_days text
)

CREATE TABLE class_of_service (
    booking_class varchar,
    rank int,
    class_description text
)

CREATE TABLE state (
    state_code text,
    state_name text,
    country_name text
)

CREATE TABLE compartment_class (
    compartment varchar,
    class_type varchar
)

CREATE TABLE aircraft (
    aircraft_code varchar,
    aircraft_description varchar,
    manufacturer varchar,
    basic_type varchar,
    engines int,
    propulsion varchar,
    wide_body varchar,
    wing_span int,
    length int,
    weight int,
    capacity int,
    pay_load int,
    cruising_speed int,
    range_miles int,
    pressurized varchar
)

CREATE TABLE airline (
    airline_code varchar,
    airline_name text,
    note text
)

CREATE TABLE restriction (
    restriction_code text,
    advance_purchase int,
    stopovers text,
    saturday_stay_required text,
    minimum_stay int,
    maximum_stay int,
    application text,
    no_discounts text
)

CREATE TABLE airport_service (
    city_code varchar,
    airport_code varchar,
    miles_distant int,
    direction varchar,
    minutes_distant int
)

CREATE TABLE date_day (
    month_number int,
    day_number int,
    year int,
    day_name varchar
)

CREATE TABLE equipment_sequence (
    aircraft_code_sequence varchar,
    aircraft_code varchar
)

CREATE TABLE food_service (
    meal_code text,
    meal_number int,
    compartment text,
    meal_description varchar
)

CREATE TABLE code_description (
    code varchar,
    description text
)

CREATE TABLE flight_leg (
    flight_id int,
    leg_number int,
    leg_flight int
)

CREATE TABLE month (
    month_number int,
    month_name text
)

CREATE TABLE fare (
    fare_id int,
    from_airport varchar,
    to_airport varchar,
    fare_basis_code text,
    fare_airline text,
    restriction_code text,
    one_direction_cost int,
    round_trip_cost int,
    round_trip_required varchar
)

CREATE TABLE days (
    days_code varchar,
    day_name varchar
)

CREATE TABLE time_zone (
    time_zone_code text,
    time_zone_name text,
    hours_from_gmt int
)

CREATE TABLE airport (
    airport_code varchar,
    airport_name text,
    airport_location text,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar,
    minimum_connect_time int
)

CREATE TABLE time_interval (
    period text,
    begin_time int,
    end_time int
)

Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from WESTCHESTER COUNTY to ST. PAUL ### Input: CREATE TABLE city (
    city_code varchar,
    city_name varchar,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar
)

CREATE TABLE flight_fare (
    flight_id int,
    fare_id int
)

CREATE TABLE flight_stop (
    flight_id int,
    stop_number int,
    stop_days text,
    stop_airport text,
    arrival_time int,
    arrival_airline text,
    arrival_flight_number int,
    departure_time int,
    departure_airline text,
    departure_flight_number int,
    stop_time int
)

CREATE TABLE dual_carrier (
    main_airline varchar,
    low_flight_number int,
    high_flight_number int,
    dual_airline varchar,
    service_name text
)

CREATE TABLE ground_service (
    city_code text,
    airport_code text,
    transport_type text,
    ground_fare int
)

CREATE TABLE flight (
    aircraft_code_sequence text,
    airline_code varchar,
    airline_flight text,
    arrival_time int,
    connections int,
    departure_time int,
    dual_carrier text,
    flight_days text,
    flight_id int,
    flight_number int,
    from_airport varchar,
    meal_code text,
    stops int,
    time_elapsed int,
    to_airport varchar
)

CREATE TABLE fare_basis (
    fare_basis_code text,
    booking_class text,
    class_type text,
    premium text,
    economy text,
    discounted text,
    night text,
    season text,
    basis_days text
)

CREATE TABLE class_of_service (
    booking_class varchar,
    rank int,
    class_description text
)

CREATE TABLE state (
    state_code text,
    state_name text,
    country_name text
)

CREATE TABLE compartment_class (
    compartment varchar,
    class_type varchar
)

CREATE TABLE aircraft (
    aircraft_code varchar,
    aircraft_description varchar,
    manufacturer varchar,
    basic_type varchar,
    engines int,
    propulsion varchar,
    wide_body varchar,
    wing_span int,
    length int,
    weight int,
    capacity int,
    pay_load int,
    cruising_speed int,
    range_miles int,
    pressurized varchar
)

CREATE TABLE airline (
    airline_code varchar,
    airline_name text,
    note text
)

CREATE TABLE restriction (
    restriction_code text,
    advance_purchase int,
    stopovers text,
    saturday_stay_required text,
    minimum_stay int,
    maximum_stay int,
    application text,
    no_discounts text
)

CREATE TABLE airport_service (
    city_code varchar,
    airport_code varchar,
    miles_distant int,
    direction varchar,
    minutes_distant int
)

CREATE TABLE date_day (
    month_number int,
    day_number int,
    year int,
    day_name varchar
)

CREATE TABLE equipment_sequence (
    aircraft_code_sequence varchar,
    aircraft_code varchar
)

CREATE TABLE food_service (
    meal_code text,
    meal_number int,
    compartment text,
    meal_description varchar
)

CREATE TABLE code_description (
    code varchar,
    description text
)

CREATE TABLE flight_leg (
    flight_id int,
    leg_number int,
    leg_flight int
)

CREATE TABLE month (
    month_number int,
    month_name text
)

CREATE TABLE fare (
    fare_id int,
    from_airport varchar,
    to_airport varchar,
    fare_basis_code text,
    fare_airline text,
    restriction_code text,
    one_direction_cost int,
    round_trip_cost int,
    round_trip_required varchar
)

CREATE TABLE days (
    days_code varchar,
    day_name varchar
)

CREATE TABLE time_zone (
    time_zone_code text,
    time_zone_name text,
    hours_from_gmt int
)

CREATE TABLE airport (
    airport_code varchar,
    airport_name text,
    airport_location text,
    state_code varchar,
    country_name varchar,
    time_zone_code varchar,
    minimum_connect_time int
)

CREATE TABLE time_interval (
    period text,
    begin_time int,
    end_time int
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code


Instruction: How many songs have a shared vocal?

Input:
CREATE TABLE vocals (
    songid VARCHAR
)

CREATE TABLE songs (
    songid VARCHAR
)

Response: SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "shared"

Below are sql tables 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 songs have a shared vocal? ### Input: CREATE TABLE vocals (
    songid VARCHAR
)

CREATE TABLE songs (
    songid VARCHAR
) ### Response: SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "shared"


Instruction: Tell me the lowest kazakhstan for kyrghizstan of 4.62 and belarus less than 2.46

Input:
CREATE TABLE table_74485 (
    "Year" real,
    "Azerbaijan" real,
    "Armenia" real,
    "Belarus" real,
    "Georgia" real,
    "Kazakhstan" real,
    "Kyrghizstan" real,
    "Latvia" real,
    "Lithuania" real,
    "Moldova" real,
    "Russia" real,
    "Tajikistan" real,
    "Turkmenikstan" real,
    "Uzbekistan" real,
    "Ukraine" real,
    "Estonia" real
)

Response: SELECT MIN("Kazakhstan") FROM table_74485 WHERE "Kyrghizstan" = '4.62' AND "Belarus" < '2.46'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the lowest kazakhstan for kyrghizstan of 4.62 and belarus less than 2.46 ### Input: CREATE TABLE table_74485 (
    "Year" real,
    "Azerbaijan" real,
    "Armenia" real,
    "Belarus" real,
    "Georgia" real,
    "Kazakhstan" real,
    "Kyrghizstan" real,
    "Latvia" real,
    "Lithuania" real,
    "Moldova" real,
    "Russia" real,
    "Tajikistan" real,
    "Turkmenikstan" real,
    "Uzbekistan" real,
    "Ukraine" real,
    "Estonia" real
) ### Response: SELECT MIN("Kazakhstan") FROM table_74485 WHERE "Kyrghizstan" = '4.62' AND "Belarus" < '2.46'


Instruction: how many hours has it been since the first time patient 19428 stayed in careunit ccu in their current hospital visit.

Input:
CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

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

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

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

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

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

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

CREATE TABLE 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 d_labitems (
    row_id number,
    itemid number,
    label text
)

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

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

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

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

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

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

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

Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime 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 hours has it been since the first time patient 19428 stayed in careunit ccu in their current hospital visit. ### Input: CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

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

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

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

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

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

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

CREATE TABLE 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 d_labitems (
    row_id number,
    itemid number,
    label text
)

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

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

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

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

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

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

CREATE TABLE procedures_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime LIMIT 1


Instruction: how many games were played in total ?

Input:
CREATE TABLE table_204_418 (
    id number,
    "date" text,
    "opponent" text,
    "score" text,
    "overall record" text,
    "scba record" text
)

Response: SELECT COUNT(*) FROM table_204_418

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many games were played in total ? ### Input: CREATE TABLE table_204_418 (
    id number,
    "date" text,
    "opponent" text,
    "score" text,
    "overall record" text,
    "scba record" text
) ### Response: SELECT COUNT(*) FROM table_204_418


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, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart.

Input:
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 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 departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
)

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

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

Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40

Below are sql tables 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, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. ### Input: 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 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 departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
)

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

CREATE TABLE jobs (
    JOB_ID varchar(10),
    JOB_TITLE varchar(35),
    MIN_SALARY decimal(6,0),
    MAX_SALARY decimal(6,0)
) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40


Instruction: which institution has the highest amount of enrollment ?

Input:
CREATE TABLE table_204_442 (
    id number,
    "institution" text,
    "location" text,
    "enrollment" number,
    "nickname" text,
    "varsity\nsports" number,
    "rugby\nsince" text,
    "head coach" text
)

Response: SELECT "institution" FROM table_204_442 ORDER BY "enrollment" 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: which institution has the highest amount of enrollment ? ### Input: CREATE TABLE table_204_442 (
    id number,
    "institution" text,
    "location" text,
    "enrollment" number,
    "nickname" text,
    "varsity\nsports" number,
    "rugby\nsince" text,
    "head coach" text
) ### Response: SELECT "institution" FROM table_204_442 ORDER BY "enrollment" DESC LIMIT 1


Instruction: What League/Division has a Location of n/a?

Input:
CREATE TABLE table_name_29 (
    league_division VARCHAR,
    location VARCHAR
)

Response: SELECT league_division FROM table_name_29 WHERE location = "n/a"

Below are sql tables 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 League/Division has a Location of n/a? ### Input: CREATE TABLE table_name_29 (
    league_division VARCHAR,
    location VARCHAR
) ### Response: SELECT league_division FROM table_name_29 WHERE location = "n/a"


Instruction: What is the conference record for the year of 1971?

Input:
CREATE TABLE table_75478 (
    "Year" text,
    "Overall Record" text,
    "Conference Record" text,
    "Coach" text,
    "Conference" text
)

Response: SELECT "Conference Record" FROM table_75478 WHERE "Year" = '1971'

Below are sql tables 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 conference record for the year of 1971? ### Input: CREATE TABLE table_75478 (
    "Year" text,
    "Overall Record" text,
    "Conference Record" text,
    "Coach" text,
    "Conference" text
) ### Response: SELECT "Conference Record" FROM table_75478 WHERE "Year" = '1971'


Instruction: what is the drug type and route prescribed for the drug code posa200l?

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

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

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

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

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

Response: SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "POSA200L"

Below are sql tables 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 type and route prescribed for the drug code posa200l? ### Input: CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

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

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

CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
) ### Response: SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "POSA200L"


Instruction: What years were from Connecticut?

Input:
CREATE TABLE table_47224 (
    "Player" text,
    "Nationality" text,
    "Jersey Number(s)" text,
    "Position" text,
    "Years" text,
    "From" text
)

Response: SELECT "Years" FROM table_47224 WHERE "From" = 'connecticut'

Below are sql tables 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 were from Connecticut? ### Input: CREATE TABLE table_47224 (
    "Player" text,
    "Nationality" text,
    "Jersey Number(s)" text,
    "Position" text,
    "Years" text,
    "From" text
) ### Response: SELECT "Years" FROM table_47224 WHERE "From" = 'connecticut'


Instruction: What message has hd 186408 as a designation HD?

Input:
CREATE TABLE table_name_75 (
    message VARCHAR,
    designation_hd VARCHAR
)

Response: SELECT message FROM table_name_75 WHERE designation_hd = "hd 186408"

Below are sql tables 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 message has hd 186408 as a designation HD? ### Input: CREATE TABLE table_name_75 (
    message VARCHAR,
    designation_hd VARCHAR
) ### Response: SELECT message FROM table_name_75 WHERE designation_hd = "hd 186408"


Instruction: What are the number of the facility codes of the apartments with more than four bedrooms?, and list by the y axis from high to low.

Input:
CREATE TABLE Apartment_Buildings (
    building_id INTEGER,
    building_short_name CHAR(15),
    building_full_name VARCHAR(80),
    building_description VARCHAR(255),
    building_address VARCHAR(255),
    building_manager VARCHAR(50),
    building_phone VARCHAR(80)
)

CREATE TABLE Apartment_Bookings (
    apt_booking_id INTEGER,
    apt_id INTEGER,
    guest_id INTEGER,
    booking_status_code CHAR(15),
    booking_start_date DATETIME,
    booking_end_date DATETIME
)

CREATE TABLE Apartment_Facilities (
    apt_id INTEGER,
    facility_code CHAR(15)
)

CREATE TABLE View_Unit_Status (
    apt_id INTEGER,
    apt_booking_id INTEGER,
    status_date DATETIME,
    available_yn BIT
)

CREATE TABLE Guests (
    guest_id INTEGER,
    gender_code CHAR(1),
    guest_first_name VARCHAR(80),
    guest_last_name VARCHAR(80),
    date_of_birth DATETIME
)

CREATE TABLE Apartments (
    apt_id INTEGER,
    building_id INTEGER,
    apt_type_code CHAR(15),
    apt_number CHAR(10),
    bathroom_count INTEGER,
    bedroom_count INTEGER,
    room_count CHAR(5)
)

Response: SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of the facility codes of the apartments with more than four bedrooms?, and list by the y axis from high to low. ### Input: CREATE TABLE Apartment_Buildings (
    building_id INTEGER,
    building_short_name CHAR(15),
    building_full_name VARCHAR(80),
    building_description VARCHAR(255),
    building_address VARCHAR(255),
    building_manager VARCHAR(50),
    building_phone VARCHAR(80)
)

CREATE TABLE Apartment_Bookings (
    apt_booking_id INTEGER,
    apt_id INTEGER,
    guest_id INTEGER,
    booking_status_code CHAR(15),
    booking_start_date DATETIME,
    booking_end_date DATETIME
)

CREATE TABLE Apartment_Facilities (
    apt_id INTEGER,
    facility_code CHAR(15)
)

CREATE TABLE View_Unit_Status (
    apt_id INTEGER,
    apt_booking_id INTEGER,
    status_date DATETIME,
    available_yn BIT
)

CREATE TABLE Guests (
    guest_id INTEGER,
    gender_code CHAR(1),
    guest_first_name VARCHAR(80),
    guest_last_name VARCHAR(80),
    date_of_birth DATETIME
)

CREATE TABLE Apartments (
    apt_id INTEGER,
    building_id INTEGER,
    apt_type_code CHAR(15),
    apt_number CHAR(10),
    bathroom_count INTEGER,
    bedroom_count INTEGER,
    room_count CHAR(5)
) ### Response: SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC


Instruction: among patients diagnosed with hemochromatosis due to repeated red blood cell transfusions, how many of them were unmarried?

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Hemochromatosis due to repeated red blood cell transfusions"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients diagnosed with hemochromatosis due to repeated red blood cell transfusions, how many of them were unmarried? ### Input: CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

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

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

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Hemochromatosis due to repeated red blood cell transfusions"


Instruction: Name the total number of value for revenue more than 193 and rank less than 12 for manchester united

Input:
CREATE TABLE table_name_21 (
    value__ VARCHAR,
    team VARCHAR,
    revenue__$m_ VARCHAR,
    rank VARCHAR
)

Response: SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = "manchester united"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of value for revenue more than 193 and rank less than 12 for manchester united ### Input: CREATE TABLE table_name_21 (
    value__ VARCHAR,
    team VARCHAR,
    revenue__$m_ VARCHAR,
    rank VARCHAR
) ### Response: SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = "manchester united"


Instruction: Which home team had a score of 85-101?

Input:
CREATE TABLE table_49867 (
    "Date" text,
    "Home team" text,
    "Score" text,
    "Away team" text,
    "Venue" text,
    "Box Score" text,
    "Report" text
)

Response: SELECT "Home team" FROM table_49867 WHERE "Score" = '85-101'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which home team had a score of 85-101? ### Input: CREATE TABLE table_49867 (
    "Date" text,
    "Home team" text,
    "Score" text,
    "Away team" text,
    "Venue" text,
    "Box Score" text,
    "Report" text
) ### Response: SELECT "Home team" FROM table_49867 WHERE "Score" = '85-101'


Instruction: Find out who answered first.. Answered in the same second as someone else? No problem, check out the number of milliseconds it differs.

Input:
CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEditVotes (
    Id number,
    SuggestedEditId number,
    UserId number,
    VoteTypeId number,
    CreationDate time,
    TargetUserId number,
    TargetRepChange number
)

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE CloseAsOffTopicReasonTypes (
    Id number,
    IsUniversal boolean,
    InputTitle text,
    MarkdownInputGuidance text,
    MarkdownPostOwnerGuidance text,
    MarkdownPrivilegedUserGuidance text,
    MarkdownConcensusDescription text,
    CreationDate time,
    CreationModeratorId number,
    ApprovalDate time,
    ApprovalModeratorId number,
    DeactivationDate time,
    DeactivationModeratorId number
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

CREATE TABLE ReviewTaskStates (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId number
)

CREATE TABLE ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
)

CREATE TABLE PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

CREATE TABLE PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE Badges (
    Id number,
    UserId number,
    Name text,
    Date time,
    Class number,
    TagBased boolean
)

CREATE TABLE ReviewTaskTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE Posts (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
)

Response: SELECT p.OwnerUserId, u.DisplayName, DATE(p.CreationDate) AS "Date", CAST(p.CreationDate AS TIMESTAMP) AS "Time", p.ParentId FROM Posts AS p, Users AS u WHERE p.PostTypeId = 2 AND p.ParentId = @Question AND u.Id = OwnerUserId ORDER BY p.CreationDate

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find out who answered first.. Answered in the same second as someone else? No problem, check out the number of milliseconds it differs. ### Input: CREATE TABLE CloseReasonTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEditVotes (
    Id number,
    SuggestedEditId number,
    UserId number,
    VoteTypeId number,
    CreationDate time,
    TargetUserId number,
    TargetRepChange number
)

CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

CREATE TABLE CloseAsOffTopicReasonTypes (
    Id number,
    IsUniversal boolean,
    InputTitle text,
    MarkdownInputGuidance text,
    MarkdownPostOwnerGuidance text,
    MarkdownPrivilegedUserGuidance text,
    MarkdownConcensusDescription text,
    CreationDate time,
    CreationModeratorId number,
    ApprovalDate time,
    ApprovalModeratorId number,
    DeactivationDate time,
    DeactivationModeratorId number
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

CREATE TABLE PostNotices (
    Id number,
    PostId number,
    PostNoticeTypeId number,
    CreationDate time,
    DeletionDate time,
    ExpiryDate time,
    Body text,
    OwnerUserId number,
    DeletionUserId number
)

CREATE TABLE Comments (
    Id number,
    PostId number,
    Score number,
    Text text,
    CreationDate time,
    UserDisplayName text,
    UserId number,
    ContentLicense text
)

CREATE TABLE ReviewTaskStates (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PostNoticeTypes (
    Id number,
    ClassId number,
    Name text,
    Body text,
    IsHidden boolean,
    Predefined boolean,
    PostNoticeDurationId number
)

CREATE TABLE ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE SuggestedEdits (
    Id number,
    PostId number,
    CreationDate time,
    ApprovalDate time,
    RejectionDate time,
    OwnerUserId number,
    Comment text,
    Text text,
    Title text,
    Tags text,
    RevisionGUID other
)

CREATE TABLE PostHistory (
    Id number,
    PostHistoryTypeId number,
    PostId number,
    RevisionGUID other,
    CreationDate time,
    UserId number,
    UserDisplayName text,
    Comment text,
    Text text,
    ContentLicense text
)

CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment text
)

CREATE TABLE PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE Users (
    Id number,
    Reputation number,
    CreationDate time,
    DisplayName text,
    LastAccessDate time,
    WebsiteUrl text,
    Location text,
    AboutMe text,
    Views number,
    UpVotes number,
    DownVotes number,
    ProfileImageUrl text,
    EmailHash text,
    AccountId number
)

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

CREATE TABLE Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

CREATE TABLE ReviewRejectionReasons (
    Id number,
    Name text,
    Description text,
    PostTypeId number
)

CREATE TABLE Badges (
    Id number,
    UserId number,
    Name text,
    Date time,
    Class number,
    TagBased boolean
)

CREATE TABLE ReviewTaskTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE PendingFlags (
    Id number,
    FlagTypeId number,
    PostId number,
    CreationDate time,
    CloseReasonTypeId number,
    CloseAsOffTopicReasonTypeId number,
    DuplicateOfQuestionId number,
    BelongsOnBaseHostAddress text
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
)

CREATE TABLE Posts (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE TagSynonyms (
    Id number,
    SourceTagName text,
    TargetTagName text,
    CreationDate time,
    OwnerUserId number,
    AutoRenameCount number,
    LastAutoRename time,
    Score number,
    ApprovedByUserId number,
    ApprovalDate time
)

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE PostsWithDeleted (
    Id number,
    PostTypeId number,
    AcceptedAnswerId number,
    ParentId number,
    CreationDate time,
    DeletionDate time,
    Score number,
    ViewCount number,
    Body text,
    OwnerUserId number,
    OwnerDisplayName text,
    LastEditorUserId number,
    LastEditorDisplayName text,
    LastEditDate time,
    LastActivityDate time,
    Title text,
    Tags text,
    AnswerCount number,
    CommentCount number,
    FavoriteCount number,
    ClosedDate time,
    CommunityOwnedDate time,
    ContentLicense text
)

CREATE TABLE Votes (
    Id number,
    PostId number,
    VoteTypeId number,
    UserId number,
    CreationDate time,
    BountyAmount number
) ### Response: SELECT p.OwnerUserId, u.DisplayName, DATE(p.CreationDate) AS "Date", CAST(p.CreationDate AS TIMESTAMP) AS "Time", p.ParentId FROM Posts AS p, Users AS u WHERE p.PostTypeId = 2 AND p.ParentId = @Question AND u.Id = OwnerUserId ORDER BY p.CreationDate


Instruction: What is the number of each allergie that the student with first name Lisa has? Draw a bar chart.

Input:
CREATE TABLE Student (
    StuID INTEGER,
    LName VARCHAR(12),
    Fname VARCHAR(12),
    Age INTEGER,
    Sex VARCHAR(1),
    Major INTEGER,
    Advisor INTEGER,
    city_code VARCHAR(3)
)

CREATE TABLE Allergy_Type (
    Allergy VARCHAR(20),
    AllergyType VARCHAR(20)
)

CREATE TABLE Has_Allergy (
    StuID INTEGER,
    Allergy VARCHAR(20)
)

Response: SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY T1.Allergy

Below are sql tables 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 each allergie that the student with first name Lisa has? Draw a bar chart. ### Input: CREATE TABLE Student (
    StuID INTEGER,
    LName VARCHAR(12),
    Fname VARCHAR(12),
    Age INTEGER,
    Sex VARCHAR(1),
    Major INTEGER,
    Advisor INTEGER,
    city_code VARCHAR(3)
)

CREATE TABLE Allergy_Type (
    Allergy VARCHAR(20),
    AllergyType VARCHAR(20)
)

CREATE TABLE Has_Allergy (
    StuID INTEGER,
    Allergy VARCHAR(20)
) ### Response: SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY T1.Allergy


Instruction: Name the opponent for 3 6, 4 6, 6 1, 6 7 (7 9)

Input:
CREATE TABLE table_25437 (
    "Edition" text,
    "Round" text,
    "Date" text,
    "Against" text,
    "Surface" text,
    "Opponent" text,
    "W\u2013L" text,
    "Result" text
)

Response: SELECT "Opponent" FROM table_25437 WHERE "Result" = '3–6, 4–6, 6–1, 6–7 (7–9)'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the opponent for 3 6, 4 6, 6 1, 6 7 (7 9) ### Input: CREATE TABLE table_25437 (
    "Edition" text,
    "Round" text,
    "Date" text,
    "Against" text,
    "Surface" text,
    "Opponent" text,
    "W\u2013L" text,
    "Result" text
) ### Response: SELECT "Opponent" FROM table_25437 WHERE "Result" = '3–6, 4–6, 6–1, 6–7 (7–9)'


Instruction: what is the minimum yearly number of patients that are suffering from allergic rhinitis nos until 2104?

Input:
CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value 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 cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

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

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

Response: SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'allergic rhinitis nos') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1

Below are sql tables 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 minimum yearly number of patients that are suffering from allergic rhinitis nos until 2104? ### Input: CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value 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 cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

CREATE TABLE admissions (
    row_id number,
    subject_id number,
    hadm_id number,
    admittime time,
    dischtime time,
    admission_type text,
    admission_location text,
    discharge_location text,
    insurance text,
    language text,
    marital_status text,
    ethnicity text,
    age number
)

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

CREATE TABLE 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
) ### Response: SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'allergic rhinitis nos') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1


Instruction: What is High Rebounds, when High Assists is 'Delonte West (10)'?

Input:
CREATE TABLE table_name_86 (
    high_rebounds VARCHAR,
    high_assists VARCHAR
)

Response: SELECT high_rebounds FROM table_name_86 WHERE high_assists = "delonte west (10)"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is High Rebounds, when High Assists is 'Delonte West (10)'? ### Input: CREATE TABLE table_name_86 (
    high_rebounds VARCHAR,
    high_assists VARCHAR
) ### Response: SELECT high_rebounds FROM table_name_86 WHERE high_assists = "delonte west (10)"


Instruction: Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.

Input:
CREATE TABLE Movie (
    mID VARCHAR,
    year VARCHAR
)

CREATE TABLE Rating (
    mID VARCHAR,
    stars VARCHAR
)

Response: SELECT DISTINCT year FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year. ### Input: CREATE TABLE Movie (
    mID VARCHAR,
    year VARCHAR
)

CREATE TABLE Rating (
    mID VARCHAR,
    stars VARCHAR
) ### Response: SELECT DISTINCT year FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year


Instruction: what is the number of patients whose ethnicity is hispanic/latino - puerto rican and drug name is influenza virus vaccine?

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Influenza Virus Vaccine"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose ethnicity is hispanic/latino - puerto rican and drug name is influenza virus vaccine? ### Input: CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

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

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

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Influenza Virus Vaccine"


Instruction: What first class team does sanath jayasuriya play for?

Input:
CREATE TABLE table_77939 (
    "Player" text,
    "Date of Birth" text,
    "Batting Style" text,
    "Bowling Style" text,
    "First Class Team" text
)

Response: SELECT "First Class Team" FROM table_77939 WHERE "Player" = 'sanath jayasuriya'

Below are sql tables 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 first class team does sanath jayasuriya play for? ### Input: CREATE TABLE table_77939 (
    "Player" text,
    "Date of Birth" text,
    "Batting Style" text,
    "Bowling Style" text,
    "First Class Team" text
) ### Response: SELECT "First Class Team" FROM table_77939 WHERE "Player" = 'sanath jayasuriya'


Instruction: how many verbs have the yo form as sienta?

Input:
CREATE TABLE table_23315 (
    "Verbs" text,
    "Yo" text,
    "T\u00fa" text,
    "Vos (*)" text,
    "\u00c9l / Ella / Usted" text,
    "Nosotros / Nosotras" text,
    "Vosotros / Vosotras" text,
    "Ellos / Ellas / Ustedes" text
)

Response: SELECT COUNT("Verbs") FROM table_23315 WHERE "Yo" = 'sienta'

Below are sql tables 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 verbs have the yo form as sienta? ### Input: CREATE TABLE table_23315 (
    "Verbs" text,
    "Yo" text,
    "T\u00fa" text,
    "Vos (*)" text,
    "\u00c9l / Ella / Usted" text,
    "Nosotros / Nosotras" text,
    "Vosotros / Vosotras" text,
    "Ellos / Ellas / Ustedes" text
) ### Response: SELECT COUNT("Verbs") FROM table_23315 WHERE "Yo" = 'sienta'


Instruction: what is the difference in 2012 gdp between albania and algeria ?

Input:
CREATE TABLE table_203_530 (
    id number,
    "country" text,
    "gdp (usd bln, 2012)" number,
    "gdp (usd bln, 2017)" number,
    "gdp (usd ppp bln, 2012)" number,
    "gdp (usd ppp bln, 2017)" number,
    "per capita (usd, 2012)" number,
    "per capita (usd, 2017)" number,
    "per capita (usd ppp, 2012)" number,
    "per capita (usd ppp, 2017)" number
)

Response: SELECT ABS((SELECT "gdp (usd bln, 2012)" FROM table_203_530 WHERE "country" = 'albania') - (SELECT "gdp (usd bln, 2012)" FROM table_203_530 WHERE "country" = 'algeria'))

Below are sql tables 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 difference in 2012 gdp between albania and algeria ? ### Input: CREATE TABLE table_203_530 (
    id number,
    "country" text,
    "gdp (usd bln, 2012)" number,
    "gdp (usd bln, 2017)" number,
    "gdp (usd ppp bln, 2012)" number,
    "gdp (usd ppp bln, 2017)" number,
    "per capita (usd, 2012)" number,
    "per capita (usd, 2017)" number,
    "per capita (usd ppp, 2012)" number,
    "per capita (usd ppp, 2017)" number
) ### Response: SELECT ABS((SELECT "gdp (usd bln, 2012)" FROM table_203_530 WHERE "country" = 'albania') - (SELECT "gdp (usd bln, 2012)" FROM table_203_530 WHERE "country" = 'algeria'))


Instruction: how much different is patient 016-8658's weight last measured on the first hospital visit compared to the value first measured on the first hospital visit?

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

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

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

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

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

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

Response: SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime 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 much different is patient 016-8658's weight last measured on the first hospital visit compared to the value first measured on the first hospital visit? ### Input: CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
)

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

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

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

CREATE TABLE 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
) ### Response: SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1)