Instruction: Which numerical entry corresponds to 'Episode 9'?

Input:
CREATE TABLE table_19808 (
    "#" real,
    "Episode" text,
    "Writer" text,
    "Director" text,
    "Original air date" text,
    "Viewing figure" text
)

Response: SELECT COUNT("#") FROM table_19808 WHERE "Episode" = 'Episode 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: Which numerical entry corresponds to 'Episode 9'? ### Input: CREATE TABLE table_19808 (
    "#" real,
    "Episode" text,
    "Writer" text,
    "Director" text,
    "Original air date" text,
    "Viewing figure" text
) ### Response: SELECT COUNT("#") FROM table_19808 WHERE "Episode" = 'Episode 9'


Instruction: Show the minister who took office after 1961 or before 1959.

Input:
CREATE TABLE party_events (
    event_id number,
    event_name text,
    party_id number,
    member_in_charge_id number
)

CREATE TABLE party (
    party_id number,
    minister text,
    took_office text,
    left_office text,
    region_id number,
    party_name text
)

CREATE TABLE region (
    region_id number,
    region_name text,
    date text,
    label text,
    format text,
    catalogue text
)

CREATE TABLE member (
    member_id number,
    member_name text,
    party_id text,
    in_office text
)

Response: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the minister who took office after 1961 or before 1959. ### Input: CREATE TABLE party_events (
    event_id number,
    event_name text,
    party_id number,
    member_in_charge_id number
)

CREATE TABLE party (
    party_id number,
    minister text,
    took_office text,
    left_office text,
    region_id number,
    party_name text
)

CREATE TABLE region (
    region_id number,
    region_name text,
    date text,
    label text,
    format text,
    catalogue text
)

CREATE TABLE member (
    member_id number,
    member_name text,
    party_id text,
    in_office text
) ### Response: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959


Instruction: how many teams did the comets win 2 matches against ?

Input:
CREATE TABLE table_204_334 (
    id number,
    "opposition" text,
    "matches" number,
    "won" number,
    "drawn" number,
    "lost" number,
    "for" number,
    "against" number,
    "win%" text
)

Response: SELECT COUNT("opposition") FROM table_204_334 WHERE "won" = 2

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many teams did the comets win 2 matches against ? ### Input: CREATE TABLE table_204_334 (
    id number,
    "opposition" text,
    "matches" number,
    "won" number,
    "drawn" number,
    "lost" number,
    "for" number,
    "against" number,
    "win%" text
) ### Response: SELECT COUNT("opposition") FROM table_204_334 WHERE "won" = 2


Instruction: In what City/State did the ATCC Round 4 series take place?

Input:
CREATE TABLE table_name_62 (
    city___state VARCHAR,
    series VARCHAR
)

Response: SELECT city___state FROM table_name_62 WHERE series = "atcc round 4"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what City/State did the ATCC Round 4 series take place? ### Input: CREATE TABLE table_name_62 (
    city___state VARCHAR,
    series VARCHAR
) ### Response: SELECT city___state FROM table_name_62 WHERE series = "atcc round 4"


Instruction: Show the product name and total order quantity for each product. Show bar chart.

Input:
CREATE TABLE Customer_Address_History (
    customer_id INTEGER,
    address_id INTEGER,
    date_from DATETIME,
    date_to DATETIME
)

CREATE TABLE Order_Items (
    order_item_id INTEGER,
    order_id INTEGER,
    product_id INTEGER,
    order_quantity VARCHAR(80)
)

CREATE TABLE Contacts (
    contact_id INTEGER,
    customer_id INTEGER,
    gender VARCHAR(1),
    first_name VARCHAR(80),
    last_name VARCHAR(50),
    contact_phone VARCHAR(80)
)

CREATE TABLE Addresses (
    address_id INTEGER,
    line_1_number_building VARCHAR(80),
    city VARCHAR(50),
    zip_postcode VARCHAR(20),
    state_province_county VARCHAR(50),
    country VARCHAR(50)
)

CREATE TABLE Customers (
    customer_id INTEGER,
    payment_method_code VARCHAR(15),
    customer_number VARCHAR(20),
    customer_name VARCHAR(80),
    customer_address VARCHAR(255),
    customer_phone VARCHAR(80),
    customer_email VARCHAR(80)
)

CREATE TABLE Customer_Orders (
    order_id INTEGER,
    customer_id INTEGER,
    order_date DATETIME,
    order_status_code VARCHAR(15)
)

CREATE TABLE Products (
    product_id INTEGER,
    product_type_code VARCHAR(15),
    product_name VARCHAR(80),
    product_price DOUBLE
)

Response: SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the product name and total order quantity for each product. Show bar chart. ### Input: CREATE TABLE Customer_Address_History (
    customer_id INTEGER,
    address_id INTEGER,
    date_from DATETIME,
    date_to DATETIME
)

CREATE TABLE Order_Items (
    order_item_id INTEGER,
    order_id INTEGER,
    product_id INTEGER,
    order_quantity VARCHAR(80)
)

CREATE TABLE Contacts (
    contact_id INTEGER,
    customer_id INTEGER,
    gender VARCHAR(1),
    first_name VARCHAR(80),
    last_name VARCHAR(50),
    contact_phone VARCHAR(80)
)

CREATE TABLE Addresses (
    address_id INTEGER,
    line_1_number_building VARCHAR(80),
    city VARCHAR(50),
    zip_postcode VARCHAR(20),
    state_province_county VARCHAR(50),
    country VARCHAR(50)
)

CREATE TABLE Customers (
    customer_id INTEGER,
    payment_method_code VARCHAR(15),
    customer_number VARCHAR(20),
    customer_name VARCHAR(80),
    customer_address VARCHAR(255),
    customer_phone VARCHAR(80),
    customer_email VARCHAR(80)
)

CREATE TABLE Customer_Orders (
    order_id INTEGER,
    customer_id INTEGER,
    order_date DATETIME,
    order_status_code VARCHAR(15)
)

CREATE TABLE Products (
    product_id INTEGER,
    product_type_code VARCHAR(15),
    product_name VARCHAR(80),
    product_price DOUBLE
) ### Response: SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name


Instruction: How much Played has a Position of 7, and a Drawn smaller than 7?

Input:
CREATE TABLE table_60828 (
    "Position" real,
    "Team" text,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Goals For" real,
    "Goals Against" real,
    "Goal Difference" text,
    "Points 1" real
)

Response: SELECT SUM("Played") FROM table_60828 WHERE "Position" = '7' AND "Drawn" < '7'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much Played has a Position of 7, and a Drawn smaller than 7? ### Input: CREATE TABLE table_60828 (
    "Position" real,
    "Team" text,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Goals For" real,
    "Goals Against" real,
    "Goal Difference" text,
    "Points 1" real
) ### Response: SELECT SUM("Played") FROM table_60828 WHERE "Position" = '7' AND "Drawn" < '7'


Instruction: what are the ways to consume guaifenesin?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Response: SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin'

Below are sql tables 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 ways to consume guaifenesin? ### Input: CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
) ### Response: SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin'


Instruction: Which Gran Hamada has a Block A of tatsuhito takaiwa?

Input:
CREATE TABLE table_name_67 (
    gran_hamada VARCHAR,
    block_a VARCHAR
)

Response: SELECT gran_hamada FROM table_name_67 WHERE block_a = "tatsuhito takaiwa"

Below are sql tables 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 Gran Hamada has a Block A of tatsuhito takaiwa? ### Input: CREATE TABLE table_name_67 (
    gran_hamada VARCHAR,
    block_a VARCHAR
) ### Response: SELECT gran_hamada FROM table_name_67 WHERE block_a = "tatsuhito takaiwa"


Instruction: return me the number of papers in VLDB conference in ' University of Michigan ' .

Input:
CREATE TABLE domain_conference (
    cid int,
    did int
)

CREATE TABLE cite (
    cited int,
    citing int
)

CREATE TABLE domain_keyword (
    did int,
    kid int
)

CREATE TABLE domain_publication (
    did int,
    pid int
)

CREATE TABLE domain_author (
    aid int,
    did int
)

CREATE TABLE domain (
    did int,
    name varchar
)

CREATE TABLE author (
    aid int,
    homepage varchar,
    name varchar,
    oid int
)

CREATE TABLE organization (
    continent varchar,
    homepage varchar,
    name varchar,
    oid int
)

CREATE TABLE domain_journal (
    did int,
    jid int
)

CREATE TABLE publication (
    abstract varchar,
    cid int,
    citation_num int,
    jid int,
    pid int,
    reference_num int,
    title varchar,
    year int
)

CREATE TABLE writes (
    aid int,
    pid int
)

CREATE TABLE conference (
    cid int,
    homepage varchar,
    name varchar
)

CREATE TABLE publication_keyword (
    kid int,
    pid int
)

CREATE TABLE journal (
    homepage varchar,
    jid int,
    name varchar
)

CREATE TABLE keyword (
    keyword varchar,
    kid int
)

Response: SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: return me the number of papers in VLDB conference in ' University of Michigan ' . ### Input: CREATE TABLE domain_conference (
    cid int,
    did int
)

CREATE TABLE cite (
    cited int,
    citing int
)

CREATE TABLE domain_keyword (
    did int,
    kid int
)

CREATE TABLE domain_publication (
    did int,
    pid int
)

CREATE TABLE domain_author (
    aid int,
    did int
)

CREATE TABLE domain (
    did int,
    name varchar
)

CREATE TABLE author (
    aid int,
    homepage varchar,
    name varchar,
    oid int
)

CREATE TABLE organization (
    continent varchar,
    homepage varchar,
    name varchar,
    oid int
)

CREATE TABLE domain_journal (
    did int,
    jid int
)

CREATE TABLE publication (
    abstract varchar,
    cid int,
    citation_num int,
    jid int,
    pid int,
    reference_num int,
    title varchar,
    year int
)

CREATE TABLE writes (
    aid int,
    pid int
)

CREATE TABLE conference (
    cid int,
    homepage varchar,
    name varchar
)

CREATE TABLE publication_keyword (
    kid int,
    pid int
)

CREATE TABLE journal (
    homepage varchar,
    jid int,
    name varchar
)

CREATE TABLE keyword (
    keyword varchar,
    kid int
) ### Response: SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid


Instruction: A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order?

Input:
CREATE TABLE route (
    train_id int,
    station_id int
)

CREATE TABLE train (
    id int,
    train_number int,
    name text,
    origin text,
    destination text,
    time text,
    interval text
)

CREATE TABLE weekly_weather (
    station_id int,
    day_of_week text,
    high_temperature int,
    low_temperature int,
    precipitation real,
    wind_speed_mph int
)

CREATE TABLE station (
    id int,
    network_name text,
    services text,
    local_authority text
)

Response: SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority 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: A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order? ### Input: CREATE TABLE route (
    train_id int,
    station_id int
)

CREATE TABLE train (
    id int,
    train_number int,
    name text,
    origin text,
    destination text,
    time text,
    interval text
)

CREATE TABLE weekly_weather (
    station_id int,
    day_of_week text,
    high_temperature int,
    low_temperature int,
    precipitation real,
    wind_speed_mph int
)

CREATE TABLE station (
    id int,
    network_name text,
    services text,
    local_authority text
) ### Response: SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC


Instruction: Where did the player who won in 1991 finish?

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

Response: SELECT "Finish" FROM table_61462 WHERE "Year(s) won" = '1991'

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


Instruction: How much does number 26 weigh?

Input:
CREATE TABLE table_name_31 (
    weight VARCHAR,
    number VARCHAR
)

Response: SELECT weight FROM table_name_31 WHERE number = "26"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How much does number 26 weigh? ### Input: CREATE TABLE table_name_31 (
    weight VARCHAR,
    number VARCHAR
) ### Response: SELECT weight FROM table_name_31 WHERE number = "26"


Instruction: Which team has 10 losses?

Input:
CREATE TABLE table_41853 (
    "Team" text,
    "Match" real,
    "Points" real,
    "Draw" real,
    "Lost" real
)

Response: SELECT "Team" FROM table_41853 WHERE "Lost" = '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: Which team has 10 losses? ### Input: CREATE TABLE table_41853 (
    "Team" text,
    "Match" real,
    "Points" real,
    "Draw" real,
    "Lost" real
) ### Response: SELECT "Team" FROM table_41853 WHERE "Lost" = '10'


Instruction: What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets?

Input:
CREATE TABLE table_48303 (
    "Rank" real,
    "Company" text,
    "Headquarters" text,
    "Industry" text,
    "Sales (billion $)" real,
    "Profits (billion $)" real,
    "Assets (billion $)" real,
    "Market Value (billion $)" real
)

Response: SELECT MAX("Market Value (billion $)") FROM table_48303 WHERE "Profits (billion $)" = '20.96' AND "Assets (billion $)" > '166.99'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets? ### Input: CREATE TABLE table_48303 (
    "Rank" real,
    "Company" text,
    "Headquarters" text,
    "Industry" text,
    "Sales (billion $)" real,
    "Profits (billion $)" real,
    "Assets (billion $)" real,
    "Market Value (billion $)" real
) ### Response: SELECT MAX("Market Value (billion $)") FROM table_48303 WHERE "Profits (billion $)" = '20.96' AND "Assets (billion $)" > '166.99'


Instruction: when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit.

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

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

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

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

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

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

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

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

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

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

Response: SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.systemicdiastolic IS NULL ORDER BY vitalperiodic.systemicdiastolic, vitalperiodic.observationtime 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: when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit. ### Input: CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

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

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

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

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

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

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

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

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

CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
) ### Response: SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.systemicdiastolic IS NULL ORDER BY vitalperiodic.systemicdiastolic, vitalperiodic.observationtime DESC LIMIT 1


Instruction: What is the LOA of Brindabella?

Input:
CREATE TABLE table_25595209_1 (
    loa__metres_ VARCHAR,
    yacht VARCHAR
)

Response: SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = "Brindabella"

Below are sql tables 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 LOA of Brindabella? ### Input: CREATE TABLE table_25595209_1 (
    loa__metres_ VARCHAR,
    yacht VARCHAR
) ### Response: SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = "Brindabella"


Instruction: what are the top three most common specimen tests performed since 2 years ago?

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

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

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

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

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

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

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

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 cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime 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 d_icd_procedures (
    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 chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

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

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

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

Response: SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top three most common specimen tests performed since 2 years ago? ### Input: CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

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

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

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

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

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

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

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 cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

CREATE TABLE diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime 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 d_icd_procedures (
    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 chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

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

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

CREATE TABLE prescriptions (
    row_id number,
    subject_id number,
    hadm_id number,
    startdate time,
    enddate time,
    drug text,
    dose_val_rx text,
    dose_unit_rx text,
    route text
) ### Response: SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3


Instruction: had patient 3273 excreted urine out ureteral stent #1 when they came to the hospital last time?

Input:
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 procedures_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 chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

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

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

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

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

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

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

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

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

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

Response: SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out ureteral stent #1' AND d_items.linksto = 'outputevents')

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 3273 excreted urine out ureteral stent #1 when they came to the hospital last time? ### Input: 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 procedures_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 chartevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
)

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

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

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

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

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

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

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

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

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label 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 diagnoses_icd (
    row_id number,
    subject_id number,
    hadm_id number,
    icd9_code text,
    charttime time
) ### Response: SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out ureteral stent #1' AND d_items.linksto = 'outputevents')


Instruction: In what season was the conference record for the Pandas 15-1-1?

Input:
CREATE TABLE table_29292 (
    "Season" text,
    "Coach" text,
    "Conf. Record" text,
    "Overall" text,
    "Standings" text,
    "Postseason" text
)

Response: SELECT "Season" FROM table_29292 WHERE "Conf. Record" = '15-1-1'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what season was the conference record for the Pandas 15-1-1? ### Input: CREATE TABLE table_29292 (
    "Season" text,
    "Coach" text,
    "Conf. Record" text,
    "Overall" text,
    "Standings" text,
    "Postseason" text
) ### Response: SELECT "Season" FROM table_29292 WHERE "Conf. Record" = '15-1-1'


Instruction: What district has abhayapuri south as the name?

Input:
CREATE TABLE table_60842 (
    "Constituency number" real,
    "Name" text,
    "Reserved for ( SC / ST /None)" text,
    "District" text,
    "Electorates (2011)" real
)

Response: SELECT "District" FROM table_60842 WHERE "Name" = 'abhayapuri south'

Below are sql tables 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 district has abhayapuri south as the name? ### Input: CREATE TABLE table_60842 (
    "Constituency number" real,
    "Name" text,
    "Reserved for ( SC / ST /None)" text,
    "District" text,
    "Electorates (2011)" real
) ### Response: SELECT "District" FROM table_60842 WHERE "Name" = 'abhayapuri south'


Instruction: What was Tom Kite's to par?

Input:
CREATE TABLE table_7771 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text
)

Response: SELECT "To par" FROM table_7771 WHERE "Player" = 'tom kite'

Below are sql tables 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 Tom Kite's to par? ### Input: CREATE TABLE table_7771 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text
) ### Response: SELECT "To par" FROM table_7771 WHERE "Player" = 'tom kite'


Instruction: Which Rank is the Country of soviet union with a Total smaller than 19?

Input:
CREATE TABLE table_name_94 (
    rank INTEGER,
    country VARCHAR,
    total VARCHAR
)

Response: SELECT MIN(rank) FROM table_name_94 WHERE country = "soviet union" AND total < 19

Below are sql tables 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 Rank is the Country of soviet union with a Total smaller than 19? ### Input: CREATE TABLE table_name_94 (
    rank INTEGER,
    country VARCHAR,
    total VARCHAR
) ### Response: SELECT MIN(rank) FROM table_name_94 WHERE country = "soviet union" AND total < 19


Instruction: How many people directed episode 3 in the season?

Input:
CREATE TABLE table_25277262_2 (
    directed_by VARCHAR,
    no_in_season VARCHAR
)

Response: SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people directed episode 3 in the season? ### Input: CREATE TABLE table_25277262_2 (
    directed_by VARCHAR,
    no_in_season VARCHAR
) ### Response: SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3


Instruction: baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 / l ) , neutropenia ( < 1500 / l ) , or thrombocytopenia ( platelets < 100000 / l ) .

Input:
CREATE TABLE table_dev_20 (
    "id" int,
    "anemia" bool,
    "gender" string,
    "systolic_blood_pressure_sbp" int,
    "hemoglobin_a1c_hba1c" float,
    "platelets" int,
    "dyslipidemia" bool,
    "renal_disease" bool,
    "creatinine_clearance_cl" float,
    "neutropenia" int,
    "estimated_glomerular_filtration_rate_egfr" int,
    "thrombocytopenia" float,
    "diastolic_blood_pressure_dbp" int,
    "lymphopenia" int,
    "ldl" int,
    "serum_creatinine" float,
    "kidney_disease" bool,
    "triglyceride_tg" float,
    "uncontrolled_blood_pressure" bool,
    "NOUSE" float
)

Response: SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 / l ) , neutropenia ( < 1500 / l ) , or thrombocytopenia ( platelets < 100000 / l ) . ### Input: CREATE TABLE table_dev_20 (
    "id" int,
    "anemia" bool,
    "gender" string,
    "systolic_blood_pressure_sbp" int,
    "hemoglobin_a1c_hba1c" float,
    "platelets" int,
    "dyslipidemia" bool,
    "renal_disease" bool,
    "creatinine_clearance_cl" float,
    "neutropenia" int,
    "estimated_glomerular_filtration_rate_egfr" int,
    "thrombocytopenia" float,
    "diastolic_blood_pressure_dbp" int,
    "lymphopenia" int,
    "ldl" int,
    "serum_creatinine" float,
    "kidney_disease" bool,
    "triglyceride_tg" float,
    "uncontrolled_blood_pressure" bool,
    "NOUSE" float
) ### Response: SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000


Instruction: who was the winning driver after nigel mansell ?

Input:
CREATE TABLE table_203_408 (
    id number,
    "rd." number,
    "grand prix" text,
    "date" text,
    "location" text,
    "pole position" text,
    "fastest lap" text,
    "winning driver" text,
    "constructor" text,
    "report" text
)

Response: SELECT "winning driver" FROM table_203_408 WHERE "rd." > (SELECT "rd." FROM table_203_408 WHERE "winning driver" = 'nigel mansell') ORDER BY "rd." 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: who was the winning driver after nigel mansell ? ### Input: CREATE TABLE table_203_408 (
    id number,
    "rd." number,
    "grand prix" text,
    "date" text,
    "location" text,
    "pole position" text,
    "fastest lap" text,
    "winning driver" text,
    "constructor" text,
    "report" text
) ### Response: SELECT "winning driver" FROM table_203_408 WHERE "rd." > (SELECT "rd." FROM table_203_408 WHERE "winning driver" = 'nigel mansell') ORDER BY "rd." LIMIT 1


Instruction: What type of car has the model 6cm?

Input:
CREATE TABLE table_name_11 (
    type VARCHAR,
    model VARCHAR
)

Response: SELECT type FROM table_name_11 WHERE model = "6cm"

Below are sql tables 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 type of car has the model 6cm? ### Input: CREATE TABLE table_name_11 (
    type VARCHAR,
    model VARCHAR
) ### Response: SELECT type FROM table_name_11 WHERE model = "6cm"


Instruction: what was the last ward identification for patient 49036 since 4 years ago?

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

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

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

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

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

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

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

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

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

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

Response: SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime 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 the last ward identification for patient 49036 since 4 years ago? ### Input: CREATE TABLE d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

CREATE TABLE 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
) ### Response: SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1


Instruction: What is the player from England's score?

Input:
CREATE TABLE table_name_98 (
    score VARCHAR,
    country VARCHAR
)

Response: SELECT score FROM table_name_98 WHERE country = "england"

Below are sql tables 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 player from England's score? ### Input: CREATE TABLE table_name_98 (
    score VARCHAR,
    country VARCHAR
) ### Response: SELECT score FROM table_name_98 WHERE country = "england"


Instruction: Which Maximum episode premiered March 8, 2008?

Input:
CREATE TABLE table_2140071_8 (
    episode INTEGER,
    premier_date VARCHAR
)

Response: SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = "March 8, 2008"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Maximum episode premiered March 8, 2008? ### Input: CREATE TABLE table_2140071_8 (
    episode INTEGER,
    premier_date VARCHAR
) ### Response: SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = "March 8, 2008"


Instruction: How many patients are born before 2197 and with procedure icd9 code 309?

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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients are born before 2197 and with procedure icd9 code 309? ### 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309"


Instruction: What is the acceleration 1-100km/h when the name is 1.5 dci?

Input:
CREATE TABLE table_name_32 (
    acceleration_0_100km_h VARCHAR,
    name VARCHAR
)

Response: SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = "1.5 dci"

Below are sql tables 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 acceleration 1-100km/h when the name is 1.5 dci? ### Input: CREATE TABLE table_name_32 (
    acceleration_0_100km_h VARCHAR,
    name VARCHAR
) ### Response: SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = "1.5 dci"


Instruction: give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4?

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

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

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

CREATE TABLE 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 WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.days_stay > "4"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4? ### Input: CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

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

CREATE TABLE 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 WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.days_stay > "4"


Instruction: Which away game was played on 2008-07-18?

Input:
CREATE TABLE table_name_5 (
    away VARCHAR,
    date VARCHAR
)

Response: SELECT away FROM table_name_5 WHERE date = "2008-07-18"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which away game was played on 2008-07-18? ### Input: CREATE TABLE table_name_5 (
    away VARCHAR,
    date VARCHAR
) ### Response: SELECT away FROM table_name_5 WHERE date = "2008-07-18"


Instruction: What is the team whose driver Jeff Simmons?

Input:
CREATE TABLE table_17319931_1 (
    team VARCHAR,
    driver VARCHAR
)

Response: SELECT team FROM table_17319931_1 WHERE driver = "Jeff Simmons"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the team whose driver Jeff Simmons? ### Input: CREATE TABLE table_17319931_1 (
    team VARCHAR,
    driver VARCHAR
) ### Response: SELECT team FROM table_17319931_1 WHERE driver = "Jeff Simmons"


Instruction: What was the final score when tracy austin was runner up?

Input:
CREATE TABLE table_20986710_1 (
    score_in_final VARCHAR,
    runner_up VARCHAR
)

Response: SELECT score_in_final FROM table_20986710_1 WHERE runner_up = "Tracy Austin"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the final score when tracy austin was runner up? ### Input: CREATE TABLE table_20986710_1 (
    score_in_final VARCHAR,
    runner_up VARCHAR
) ### Response: SELECT score_in_final FROM table_20986710_1 WHERE runner_up = "Tracy Austin"


Instruction: Which NBA Draft had Labradford Smith?

Input:
CREATE TABLE table_name_61 (
    nba_draft VARCHAR,
    player VARCHAR
)

Response: SELECT nba_draft FROM table_name_61 WHERE player = "labradford smith"

Below are sql tables 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 NBA Draft had Labradford Smith? ### Input: CREATE TABLE table_name_61 (
    nba_draft VARCHAR,
    player VARCHAR
) ### Response: SELECT nba_draft FROM table_name_61 WHERE player = "labradford smith"


Instruction: Which player has a 92.58 3-dart average?

Input:
CREATE TABLE table_24015 (
    "Player" text,
    "Played" real,
    "Legs Won" real,
    "Legs Lost" real,
    "LWAT" real,
    "100+" real,
    "140+" real,
    "180s" real,
    "High Checkout" real,
    "3-dart Average" text
)

Response: SELECT "Player" FROM table_24015 WHERE "3-dart Average" = '92.58'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player has a 92.58 3-dart average? ### Input: CREATE TABLE table_24015 (
    "Player" text,
    "Played" real,
    "Legs Won" real,
    "Legs Lost" real,
    "LWAT" real,
    "100+" real,
    "140+" real,
    "180s" real,
    "High Checkout" real,
    "3-dart Average" text
) ### Response: SELECT "Player" FROM table_24015 WHERE "3-dart Average" = '92.58'


Instruction: Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers?

Input:
CREATE TABLE table_name_95 (
    conference_joined VARCHAR,
    previous_conference VARCHAR,
    mascot VARCHAR
)

Response: SELECT conference_joined FROM table_name_95 WHERE previous_conference = "northwestern" AND mascot = "oilers"

Below are sql tables 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 Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers? ### Input: CREATE TABLE table_name_95 (
    conference_joined VARCHAR,
    previous_conference VARCHAR,
    mascot VARCHAR
) ### Response: SELECT conference_joined FROM table_name_95 WHERE previous_conference = "northwestern" AND mascot = "oilers"


Instruction: If sample 6480 is imported, which country is it originally from?

Input:
CREATE TABLE resultsdata15 (
    sample_pk number,
    commod text,
    commtype text,
    lab text,
    pestcode text,
    testclass text,
    concen number,
    lod number,
    conunit text,
    confmethod text,
    confmethod2 text,
    annotate text,
    quantitate text,
    mean text,
    extract text,
    determin text
)

CREATE TABLE sampledata15 (
    sample_pk number,
    state text,
    year text,
    month text,
    day text,
    site text,
    commod text,
    source_id text,
    variety text,
    origin text,
    country text,
    disttype text,
    commtype text,
    claim text,
    quantity number,
    growst text,
    packst text,
    distst text
)

Response: SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If sample 6480 is imported, which country is it originally from? ### Input: CREATE TABLE resultsdata15 (
    sample_pk number,
    commod text,
    commtype text,
    lab text,
    pestcode text,
    testclass text,
    concen number,
    lod number,
    conunit text,
    confmethod text,
    confmethod2 text,
    annotate text,
    quantitate text,
    mean text,
    extract text,
    determin text
)

CREATE TABLE sampledata15 (
    sample_pk number,
    state text,
    year text,
    month text,
    day text,
    site text,
    commod text,
    source_id text,
    variety text,
    origin text,
    country text,
    disttype text,
    commtype text,
    claim text,
    quantity number,
    growst text,
    packst text,
    distst text
) ### Response: SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2


Instruction: Give me the title and highest price for each film Show bar chart, list from low to high by the Y.

Input:
CREATE TABLE schedule (
    Cinema_ID int,
    Film_ID int,
    Date text,
    Show_times_per_day int,
    Price float
)

CREATE TABLE cinema (
    Cinema_ID int,
    Name text,
    Openning_year int,
    Capacity int,
    Location text
)

CREATE TABLE film (
    Film_ID int,
    Rank_in_series int,
    Number_in_season int,
    Title text,
    Directed_by text,
    Original_air_date text,
    Production_code text
)

Response: SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the title and highest price for each film Show bar chart, list from low to high by the Y. ### Input: CREATE TABLE schedule (
    Cinema_ID int,
    Film_ID int,
    Date text,
    Show_times_per_day int,
    Price float
)

CREATE TABLE cinema (
    Cinema_ID int,
    Name text,
    Openning_year int,
    Capacity int,
    Location text
)

CREATE TABLE film (
    Film_ID int,
    Rank_in_series int,
    Number_in_season int,
    Title text,
    Directed_by text,
    Original_air_date text,
    Production_code text
) ### Response: SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)


Instruction: What club team did JArrod Maidens play for?

Input:
CREATE TABLE table_17204 (
    "Round" real,
    "Overall" text,
    "Player" text,
    "Position" text,
    "Nationality" text,
    "Club team" text
)

Response: SELECT "Club team" FROM table_17204 WHERE "Player" = 'Jarrod Maidens'

Below are sql tables 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 club team did JArrod Maidens play for? ### Input: CREATE TABLE table_17204 (
    "Round" real,
    "Overall" text,
    "Player" text,
    "Position" text,
    "Nationality" text,
    "Club team" text
) ### Response: SELECT "Club team" FROM table_17204 WHERE "Player" = 'Jarrod Maidens'


Instruction: Name the least matches for year 2008

Input:
CREATE TABLE table_15829930_5 (
    matches INTEGER,
    year VARCHAR
)

Response: SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least matches for year 2008 ### Input: CREATE TABLE table_15829930_5 (
    matches INTEGER,
    year VARCHAR
) ### Response: SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008


Instruction: Show me about the distribution of All_Road and Team_ID in a bar chart, display by the y-axis in ascending.

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

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

Response: SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Road and Team_ID in a bar chart, display by the y-axis in ascending. ### Input: CREATE TABLE basketball_match (
    Team_ID int,
    School_ID int,
    Team_Name text,
    ACC_Regular_Season text,
    ACC_Percent text,
    ACC_Home text,
    ACC_Road text,
    All_Games text,
    All_Games_Percent int,
    All_Home text,
    All_Road text,
    All_Neutral text
)

CREATE TABLE university (
    School_ID int,
    School text,
    Location text,
    Founded real,
    Affiliation text,
    Enrollment real,
    Nickname text,
    Primary_conference text
) ### Response: SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID


Instruction: What is the Placement when the Candidate is Jean-Patrick Berthiaume?

Input:
CREATE TABLE table_15441 (
    "Riding" text,
    "Province" text,
    "Candidate" text,
    "Votes" real,
    "Placement" text
)

Response: SELECT "Placement" FROM table_15441 WHERE "Candidate" = 'jean-patrick berthiaume'

Below are sql tables 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 Placement when the Candidate is Jean-Patrick Berthiaume? ### Input: CREATE TABLE table_15441 (
    "Riding" text,
    "Province" text,
    "Candidate" text,
    "Votes" real,
    "Placement" text
) ### Response: SELECT "Placement" FROM table_15441 WHERE "Candidate" = 'jean-patrick berthiaume'


Instruction: Questions I have answered where asker has accepted another answer. Lists all questions I have proposed an answer to, and, sadly, the original asker accepted a different answer.

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

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

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

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

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

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

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

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

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

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

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

CREATE TABLE PostTypes (
    Id number,
    Name text
)

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

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

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

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

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

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

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

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

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

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

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

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

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

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

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

Response: SELECT p.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.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: Questions I have answered where asker has accepted another answer. Lists all questions I have proposed an answer to, and, sadly, the original asker accepted a different answer. ### Input: CREATE TABLE ReviewTasks (
    Id number,
    ReviewTaskTypeId number,
    CreationDate time,
    DeletionDate time,
    ReviewTaskStateId number,
    PostId number,
    SuggestedEditId number,
    CompletedByReviewTaskId number
)

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

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

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

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

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

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

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

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

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

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

CREATE TABLE PostTypes (
    Id number,
    Name text
)

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

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

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

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

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

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

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

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

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

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

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

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

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

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

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE FlagTypes (
    Id number,
    Name text,
    Description text
) ### Response: SELECT p.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.CreationDate


Instruction: How many winners were there in the race of 1922

Input:
CREATE TABLE table_777 (
    "District" text,
    "Incumbent" text,
    "Party" text,
    "First elected" real,
    "Result" text,
    "Candidates" text
)

Response: SELECT COUNT("Incumbent") FROM table_777 WHERE "First elected" = '1922'

Below are sql tables 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 winners were there in the race of 1922 ### Input: CREATE TABLE table_777 (
    "District" text,
    "Incumbent" text,
    "Party" text,
    "First elected" real,
    "Result" text,
    "Candidates" text
) ### Response: SELECT COUNT("Incumbent") FROM table_777 WHERE "First elected" = '1922'


Instruction: What is the title for episode number 7 in the season?

Input:
CREATE TABLE table_15431251_1 (
    title VARCHAR,
    no_in_season VARCHAR
)

Response: SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title for episode number 7 in the season? ### Input: CREATE TABLE table_15431251_1 (
    title VARCHAR,
    no_in_season VARCHAR
) ### Response: SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7


Instruction: What was the score when the opponent was Dominika Cibulkov ?

Input:
CREATE TABLE table_72981 (
    "Outcome" text,
    "Edition" real,
    "Round" text,
    "Opponent Team" text,
    "Surface" text,
    "Opponent" text,
    "Score" text
)

Response: SELECT "Score" FROM table_72981 WHERE "Opponent" = 'Dominika Cibulková'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score when the opponent was Dominika Cibulkov ? ### Input: CREATE TABLE table_72981 (
    "Outcome" text,
    "Edition" real,
    "Round" text,
    "Opponent Team" text,
    "Surface" text,
    "Opponent" text,
    "Score" text
) ### Response: SELECT "Score" FROM table_72981 WHERE "Opponent" = 'Dominika Cibulková'


Instruction: How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1?

Input:
CREATE TABLE table_4876 (
    "Place" real,
    "Team" text,
    "Points" real,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Goals For" real,
    "Goals Against" real
)

Response: SELECT COUNT("Goals Against") FROM table_4876 WHERE "Lost" > '7' AND "Goals For" < '27' AND "Drawn" > '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 goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1? ### Input: CREATE TABLE table_4876 (
    "Place" real,
    "Team" text,
    "Points" real,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Goals For" real,
    "Goals Against" real
) ### Response: SELECT COUNT("Goals Against") FROM table_4876 WHERE "Lost" > '7' AND "Goals For" < '27' AND "Drawn" > '1'


Instruction: What is the score for Billy Andrade?

Input:
CREATE TABLE table_8435 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text
)

Response: SELECT "Score" FROM table_8435 WHERE "Player" = 'billy andrade'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for Billy Andrade? ### Input: CREATE TABLE table_8435 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text
) ### Response: SELECT "Score" FROM table_8435 WHERE "Player" = 'billy andrade'


Instruction: What is the average 2002 value for Sunflower, which had a 2010 value less than 5587 and a 2007 value greater than 546?

Input:
CREATE TABLE table_70544 (
    "Production year" text,
    "2001" real,
    "2002" real,
    "2003" real,
    "2004" real,
    "2005" real,
    "2006" real,
    "2007" real,
    "2008" real,
    "2009" real,
    "2010" real,
    "2011" real
)

Response: SELECT AVG("2002") FROM table_70544 WHERE "2010" < '5587' AND "Production year" = 'sunflower' AND "2007" > '546'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average 2002 value for Sunflower, which had a 2010 value less than 5587 and a 2007 value greater than 546? ### Input: CREATE TABLE table_70544 (
    "Production year" text,
    "2001" real,
    "2002" real,
    "2003" real,
    "2004" real,
    "2005" real,
    "2006" real,
    "2007" real,
    "2008" real,
    "2009" real,
    "2010" real,
    "2011" real
) ### Response: SELECT AVG("2002") FROM table_70544 WHERE "2010" < '5587' AND "Production year" = 'sunflower' AND "2007" > '546'


Instruction: Who had the most points and how many did they have on April 22?

Input:
CREATE TABLE table_27700530_15 (
    high_points VARCHAR,
    date VARCHAR
)

Response: SELECT high_points FROM table_27700530_15 WHERE date = "April 22"

Below are sql tables 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 the most points and how many did they have on April 22? ### Input: CREATE TABLE table_27700530_15 (
    high_points VARCHAR,
    date VARCHAR
) ### Response: SELECT high_points FROM table_27700530_15 WHERE date = "April 22"


Instruction: which building held the record before the current holder ?

Input:
CREATE TABLE table_203_777 (
    id number,
    "years" text,
    "building" text,
    "city" text,
    "height (ctbuh)" text,
    "floors" number
)

Response: SELECT "building" FROM table_203_777 WHERE "years" < present_ref ORDER BY "years" 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 building held the record before the current holder ? ### Input: CREATE TABLE table_203_777 (
    id number,
    "years" text,
    "building" text,
    "city" text,
    "height (ctbuh)" text,
    "floors" number
) ### Response: SELECT "building" FROM table_203_777 WHERE "years" < present_ref ORDER BY "years" DESC LIMIT 1


Instruction: What is the attendance of the game on July 26?

Input:
CREATE TABLE table_name_1 (
    attendance INTEGER,
    date VARCHAR
)

Response: SELECT SUM(attendance) FROM table_name_1 WHERE date = "july 26"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the attendance of the game on July 26? ### Input: CREATE TABLE table_name_1 (
    attendance INTEGER,
    date VARCHAR
) ### Response: SELECT SUM(attendance) FROM table_name_1 WHERE date = "july 26"


Instruction: Name the site for game of game 2

Input:
CREATE TABLE table_name_26 (
    site VARCHAR,
    game VARCHAR
)

Response: SELECT site FROM table_name_26 WHERE game = "game 2"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the site for game of game 2 ### Input: CREATE TABLE table_name_26 (
    site VARCHAR,
    game VARCHAR
) ### Response: SELECT site FROM table_name_26 WHERE game = "game 2"


Instruction: microalbuminuria up to 300 mg / 24 hours is acceptable if serum creatinine is < 1.4 for female , < 1.5 for male and estimated gfr ( egfr ) is > 60 )

Input:
CREATE TABLE table_dev_42 (
    "id" int,
    "gender" string,
    "depression" bool,
    "familial_hypercholesterolemia" bool,
    "microalbuminuria" int,
    "renal_disease" bool,
    "diabetic" string,
    "estimated_glomerular_filtration_rate_egfr" int,
    "serum_creatinine" float,
    "fbg" int,
    "body_mass_index_bmi" float,
    "triglyceride_tg" float,
    "a1c" float,
    "age" float,
    "NOUSE" float
)

Response: SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: microalbuminuria up to 300 mg / 24 hours is acceptable if serum creatinine is < 1.4 for female , < 1.5 for male and estimated gfr ( egfr ) is > 60 ) ### Input: CREATE TABLE table_dev_42 (
    "id" int,
    "gender" string,
    "depression" bool,
    "familial_hypercholesterolemia" bool,
    "microalbuminuria" int,
    "renal_disease" bool,
    "diabetic" string,
    "estimated_glomerular_filtration_rate_egfr" int,
    "serum_creatinine" float,
    "fbg" int,
    "body_mass_index_bmi" float,
    "triglyceride_tg" float,
    "a1c" float,
    "age" float,
    "NOUSE" float
) ### Response: SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60