Instruction: what is patient 031-22988's monthly maximum level of oxyhemoglobin?

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

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

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

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

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

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

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

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

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

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

Response: SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND lab.labname = 'oxyhemoglobin' GROUP BY STRFTIME('%y-%m', lab.labresulttime)

Below are sql tables 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 patient 031-22988's monthly maximum level of oxyhemoglobin? ### Input: CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

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

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

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

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

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

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

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

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

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
) ### Response: SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND lab.labname = 'oxyhemoglobin' GROUP BY STRFTIME('%y-%m', lab.labresulttime)


Instruction: I want the score for 23 july 1992

Input:
CREATE TABLE table_name_86 (
    score VARCHAR,
    date VARCHAR
)

Response: SELECT score FROM table_name_86 WHERE date = "23 july 1992"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want the score for 23 july 1992 ### Input: CREATE TABLE table_name_86 (
    score VARCHAR,
    date VARCHAR
) ### Response: SELECT score FROM table_name_86 WHERE date = "23 july 1992"


Instruction: What player's original team are the Oakland Raiders?

Input:
CREATE TABLE table_80251 (
    "Original NFL team" text,
    "Player" text,
    "Pos." text,
    "College" text,
    "Conf." text
)

Response: SELECT "Player" FROM table_80251 WHERE "Original NFL team" = 'oakland raiders'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player's original team are the Oakland Raiders? ### Input: CREATE TABLE table_80251 (
    "Original NFL team" text,
    "Player" text,
    "Pos." text,
    "College" text,
    "Conf." text
) ### Response: SELECT "Player" FROM table_80251 WHERE "Original NFL team" = 'oakland raiders'


Instruction: What is the number of patients diagnosed with rheumatic heart failure (congestive) who have a delta abnormal lab test?

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Rheumatic heart failure (congestive)" AND lab.flag = "delta"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of patients diagnosed with rheumatic heart failure (congestive) who have a delta abnormal lab test? ### Input: CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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

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

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Rheumatic heart failure (congestive)" AND lab.flag = "delta"


Instruction: so what's the average mch value of patient 006-157753 on their current hospital encounter?

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

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

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

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

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

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

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

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

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

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

Response: SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mch'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: so what's the average mch value of patient 006-157753 on their current hospital encounter? ### Input: CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

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

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

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

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

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

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
) ### Response: SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mch'


Instruction: Which Colliery has a Death toll of 7?

Input:
CREATE TABLE table_name_76 (
    colliery VARCHAR,
    death_toll VARCHAR
)

Response: SELECT colliery FROM table_name_76 WHERE death_toll = 7

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Colliery has a Death toll of 7? ### Input: CREATE TABLE table_name_76 (
    colliery VARCHAR,
    death_toll VARCHAR
) ### Response: SELECT colliery FROM table_name_76 WHERE death_toll = 7


Instruction: What is the status of vessel number K-223?

Input:
CREATE TABLE table_1634376_1 (
    status VARCHAR,
    _number VARCHAR
)

Response: SELECT status FROM table_1634376_1 WHERE _number = "K-223"

Below are sql tables 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 status of vessel number K-223? ### Input: CREATE TABLE table_1634376_1 (
    status VARCHAR,
    _number VARCHAR
) ### Response: SELECT status FROM table_1634376_1 WHERE _number = "K-223"


Instruction: Name the post poles for 4 podiums

Input:
CREATE TABLE table_29650 (
    "Season" real,
    "Series" text,
    "Team Name" text,
    "Races" real,
    "Poles" real,
    "Wins" real,
    "Podiums" real,
    "F/Laps" real,
    "Points" real,
    "Final Placing" text
)

Response: SELECT MAX("Poles") FROM table_29650 WHERE "Podiums" = '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: Name the post poles for 4 podiums ### Input: CREATE TABLE table_29650 (
    "Season" real,
    "Series" text,
    "Team Name" text,
    "Races" real,
    "Poles" real,
    "Wins" real,
    "Podiums" real,
    "F/Laps" real,
    "Points" real,
    "Final Placing" text
) ### Response: SELECT MAX("Poles") FROM table_29650 WHERE "Podiums" = '4'


Instruction: A line chart for what are the number of the distinct visit dates?

Input:
CREATE TABLE Photos (
    Photo_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Name VARCHAR(255),
    Description VARCHAR(255),
    Filename VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Theme_Parks (
    Theme_Park_ID INTEGER,
    Theme_Park_Details VARCHAR(255)
)

CREATE TABLE Hotels (
    hotel_id INTEGER,
    star_rating_code CHAR(15),
    pets_allowed_yn CHAR(1),
    price_range real,
    other_hotel_details VARCHAR(255)
)

CREATE TABLE Ref_Attraction_Types (
    Attraction_Type_Code CHAR(15),
    Attraction_Type_Description VARCHAR(255)
)

CREATE TABLE Visits (
    Visit_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Tourist_ID INTEGER,
    Visit_Date DATETIME,
    Visit_Details VARCHAR(40)
)

CREATE TABLE Street_Markets (
    Market_ID INTEGER,
    Market_Details VARCHAR(255)
)

CREATE TABLE Staff (
    Staff_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Name VARCHAR(40),
    Other_Details VARCHAR(255)
)

CREATE TABLE Visitors (
    Tourist_ID INTEGER,
    Tourist_Details VARCHAR(255)
)

CREATE TABLE Tourist_Attraction_Features (
    Tourist_Attraction_ID INTEGER,
    Feature_ID INTEGER
)

CREATE TABLE Features (
    Feature_ID INTEGER,
    Feature_Details VARCHAR(255)
)

CREATE TABLE Royal_Family (
    Royal_Family_ID INTEGER,
    Royal_Family_Details VARCHAR(255)
)

CREATE TABLE Ref_Hotel_Star_Ratings (
    star_rating_code CHAR(15),
    star_rating_description VARCHAR(80)
)

CREATE TABLE Shops (
    Shop_ID INTEGER,
    Shop_Details VARCHAR(255)
)

CREATE TABLE Locations (
    Location_ID INTEGER,
    Location_Name VARCHAR(255),
    Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Tourist_Attractions (
    Tourist_Attraction_ID INTEGER,
    Attraction_Type_Code CHAR(15),
    Location_ID INTEGER,
    How_to_Get_There VARCHAR(255),
    Name VARCHAR(255),
    Description VARCHAR(255),
    Opening_Hours VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Museums (
    Museum_ID INTEGER,
    Museum_Details VARCHAR(255)
)

Response: SELECT Visit_Date, COUNT(Visit_Date) FROM Visits

Below are sql tables 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 line chart for what are the number of the distinct visit dates? ### Input: CREATE TABLE Photos (
    Photo_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Name VARCHAR(255),
    Description VARCHAR(255),
    Filename VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Theme_Parks (
    Theme_Park_ID INTEGER,
    Theme_Park_Details VARCHAR(255)
)

CREATE TABLE Hotels (
    hotel_id INTEGER,
    star_rating_code CHAR(15),
    pets_allowed_yn CHAR(1),
    price_range real,
    other_hotel_details VARCHAR(255)
)

CREATE TABLE Ref_Attraction_Types (
    Attraction_Type_Code CHAR(15),
    Attraction_Type_Description VARCHAR(255)
)

CREATE TABLE Visits (
    Visit_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Tourist_ID INTEGER,
    Visit_Date DATETIME,
    Visit_Details VARCHAR(40)
)

CREATE TABLE Street_Markets (
    Market_ID INTEGER,
    Market_Details VARCHAR(255)
)

CREATE TABLE Staff (
    Staff_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Name VARCHAR(40),
    Other_Details VARCHAR(255)
)

CREATE TABLE Visitors (
    Tourist_ID INTEGER,
    Tourist_Details VARCHAR(255)
)

CREATE TABLE Tourist_Attraction_Features (
    Tourist_Attraction_ID INTEGER,
    Feature_ID INTEGER
)

CREATE TABLE Features (
    Feature_ID INTEGER,
    Feature_Details VARCHAR(255)
)

CREATE TABLE Royal_Family (
    Royal_Family_ID INTEGER,
    Royal_Family_Details VARCHAR(255)
)

CREATE TABLE Ref_Hotel_Star_Ratings (
    star_rating_code CHAR(15),
    star_rating_description VARCHAR(80)
)

CREATE TABLE Shops (
    Shop_ID INTEGER,
    Shop_Details VARCHAR(255)
)

CREATE TABLE Locations (
    Location_ID INTEGER,
    Location_Name VARCHAR(255),
    Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Tourist_Attractions (
    Tourist_Attraction_ID INTEGER,
    Attraction_Type_Code CHAR(15),
    Location_ID INTEGER,
    How_to_Get_There VARCHAR(255),
    Name VARCHAR(255),
    Description VARCHAR(255),
    Opening_Hours VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Museums (
    Museum_ID INTEGER,
    Museum_Details VARCHAR(255)
) ### Response: SELECT Visit_Date, COUNT(Visit_Date) FROM Visits


Instruction: How many faculty members does each building have? List the result with the name of the building with a bar chart, show from high to low by the x-axis.

Input:
CREATE TABLE Faculty (
    FacID INTEGER,
    Lname VARCHAR(15),
    Fname VARCHAR(15),
    Rank VARCHAR(15),
    Sex VARCHAR(1),
    Phone INTEGER,
    Room VARCHAR(5),
    Building VARCHAR(13)
)

CREATE TABLE Faculty_Participates_in (
    FacID INTEGER,
    actid INTEGER
)

CREATE TABLE Participates_in (
    stuid INTEGER,
    actid INTEGER
)

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

CREATE TABLE Activity (
    actid INTEGER,
    activity_name varchar(25)
)

Response: SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members does each building have? List the result with the name of the building with a bar chart, show from high to low by the x-axis. ### Input: CREATE TABLE Faculty (
    FacID INTEGER,
    Lname VARCHAR(15),
    Fname VARCHAR(15),
    Rank VARCHAR(15),
    Sex VARCHAR(1),
    Phone INTEGER,
    Room VARCHAR(5),
    Building VARCHAR(13)
)

CREATE TABLE Faculty_Participates_in (
    FacID INTEGER,
    actid INTEGER
)

CREATE TABLE Participates_in (
    stuid INTEGER,
    actid INTEGER
)

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

CREATE TABLE Activity (
    actid INTEGER,
    activity_name varchar(25)
) ### Response: SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC


Instruction: What was the result of the game in Stuttgart, West Germany and a goal number of less than 9?

Input:
CREATE TABLE table_name_12 (
    result VARCHAR,
    venue VARCHAR,
    goal VARCHAR
)

Response: SELECT result FROM table_name_12 WHERE venue = "stuttgart, west germany" AND goal < 9

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game in Stuttgart, West Germany and a goal number of less than 9? ### Input: CREATE TABLE table_name_12 (
    result VARCHAR,
    venue VARCHAR,
    goal VARCHAR
) ### Response: SELECT result FROM table_name_12 WHERE venue = "stuttgart, west germany" AND goal < 9


Instruction: Who had the high rebounds in the game with a final score of w 140-108?

Input:
CREATE TABLE table_1683 (
    "Game" real,
    "Date" text,
    "Team" text,
    "Score" text,
    "High points" text,
    "High rebounds" text,
    "High assists" text,
    "Location Attendance" text,
    "Record" text
)

Response: SELECT "High rebounds" FROM table_1683 WHERE "Score" = 'W 140-108'

Below are sql tables 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 high rebounds in the game with a final score of w 140-108? ### Input: CREATE TABLE table_1683 (
    "Game" real,
    "Date" text,
    "Team" text,
    "Score" text,
    "High points" text,
    "High rebounds" text,
    "High assists" text,
    "Location Attendance" text,
    "Record" text
) ### Response: SELECT "High rebounds" FROM table_1683 WHERE "Score" = 'W 140-108'


Instruction: What is the weight of the shortest person?

Input:
CREATE TABLE people (
    Weight VARCHAR,
    Height VARCHAR
)

Response: SELECT Weight FROM people ORDER BY Height LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the weight of the shortest person? ### Input: CREATE TABLE people (
    Weight VARCHAR,
    Height VARCHAR
) ### Response: SELECT Weight FROM people ORDER BY Height LIMIT 1


Instruction: What was the 110H that the 1500m was 692 and the final was more than 7906?

Input:
CREATE TABLE table_77037 (
    "Athlete" text,
    "Event" text,
    "100 m" real,
    "400 m" real,
    "110H" real,
    "1500 m" text,
    "Final" real
)

Response: SELECT COUNT("110H") FROM table_77037 WHERE "1500 m" = '692' AND "Final" > '7906'

Below are sql tables 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 110H that the 1500m was 692 and the final was more than 7906? ### Input: CREATE TABLE table_77037 (
    "Athlete" text,
    "Event" text,
    "100 m" real,
    "400 m" real,
    "110H" real,
    "1500 m" text,
    "Final" real
) ### Response: SELECT COUNT("110H") FROM table_77037 WHERE "1500 m" = '692' AND "Final" > '7906'


Instruction: What is the mean pick when the play is Marc Lewis (lhp) and the round is less than 20?

Input:
CREATE TABLE table_name_76 (
    pick INTEGER,
    player VARCHAR,
    round VARCHAR
)

Response: SELECT AVG(pick) FROM table_name_76 WHERE player = "marc lewis (lhp)" AND round < 20

Below are sql tables 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 mean pick when the play is Marc Lewis (lhp) and the round is less than 20? ### Input: CREATE TABLE table_name_76 (
    pick INTEGER,
    player VARCHAR,
    round VARCHAR
) ### Response: SELECT AVG(pick) FROM table_name_76 WHERE player = "marc lewis (lhp)" AND round < 20


Instruction: Which Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tournament of honolulu?

Input:
CREATE TABLE table_name_51 (
    opponent VARCHAR,
    tournament VARCHAR,
    surface VARCHAR,
    outcome VARCHAR
)

Response: SELECT opponent FROM table_name_51 WHERE surface = "hardcourt" AND outcome = "runner-up" AND tournament = "honolulu"

Below are sql tables 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 Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tournament of honolulu? ### Input: CREATE TABLE table_name_51 (
    opponent VARCHAR,
    tournament VARCHAR,
    surface VARCHAR,
    outcome VARCHAR
) ### Response: SELECT opponent FROM table_name_51 WHERE surface = "hardcourt" AND outcome = "runner-up" AND tournament = "honolulu"


Instruction: dysphagia nec what does it stand for?

Input:
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 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 d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

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

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

Response: SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dysphagia nec'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: dysphagia nec what does it stand for? ### Input: 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 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 d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

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

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

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

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

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

CREATE TABLE labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom text
) ### Response: SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dysphagia nec'


Instruction: For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and list y axis in asc order please.

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

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

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

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

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

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

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

Response: SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and list y axis in asc order please. ### Input: CREATE TABLE locations (
    LOCATION_ID decimal(4,0),
    STREET_ADDRESS varchar(40),
    POSTAL_CODE varchar(12),
    CITY varchar(30),
    STATE_PROVINCE varchar(25),
    COUNTRY_ID varchar(2)
)

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

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

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

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

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

CREATE TABLE employees (
    EMPLOYEE_ID decimal(6,0),
    FIRST_NAME varchar(20),
    LAST_NAME varchar(25),
    EMAIL varchar(25),
    PHONE_NUMBER varchar(20),
    HIRE_DATE date,
    JOB_ID varchar(10),
    SALARY decimal(8,2),
    COMMISSION_PCT decimal(2,2),
    MANAGER_ID decimal(6,0),
    DEPARTMENT_ID decimal(4,0)
) ### Response: SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)


Instruction: What Points for has a Try bonus of 140?

Input:
CREATE TABLE table_name_26 (
    points_for VARCHAR,
    try_bonus VARCHAR
)

Response: SELECT points_for FROM table_name_26 WHERE try_bonus = "140"

Below are sql tables 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 Points for has a Try bonus of 140? ### Input: CREATE TABLE table_name_26 (
    points_for VARCHAR,
    try_bonus VARCHAR
) ### Response: SELECT points_for FROM table_name_26 WHERE try_bonus = "140"


Instruction: Name the langauge for switzerland

Input:
CREATE TABLE table_71432 (
    "Country" text,
    "Film title used in nomination" text,
    "Language" text,
    "Original title" text,
    "Director" text
)

Response: SELECT "Language" FROM table_71432 WHERE "Country" = 'switzerland'

Below are sql tables 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 langauge for switzerland ### Input: CREATE TABLE table_71432 (
    "Country" text,
    "Film title used in nomination" text,
    "Language" text,
    "Original title" text,
    "Director" text
) ### Response: SELECT "Language" FROM table_71432 WHERE "Country" = 'switzerland'


Instruction: Name the total number of bids of the sun belt conference

Input:
CREATE TABLE table_10722506_6 (
    _number_of_bids VARCHAR,
    conference VARCHAR
)

Response: SELECT COUNT(_number_of_bids) FROM table_10722506_6 WHERE conference = "Sun Belt"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of bids of the sun belt conference ### Input: CREATE TABLE table_10722506_6 (
    _number_of_bids VARCHAR,
    conference VARCHAR
) ### Response: SELECT COUNT(_number_of_bids) FROM table_10722506_6 WHERE conference = "Sun Belt"


Instruction: Count the number of cinemas.

Input:
CREATE TABLE cinema (
    cinema_id number,
    name text,
    openning_year number,
    capacity number,
    location text
)

CREATE TABLE film (
    film_id number,
    rank_in_series number,
    number_in_season number,
    title text,
    directed_by text,
    original_air_date text,
    production_code text
)

CREATE TABLE schedule (
    cinema_id number,
    film_id number,
    date text,
    show_times_per_day number,
    price number
)

Response: SELECT COUNT(*) FROM cinema

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of cinemas. ### Input: CREATE TABLE cinema (
    cinema_id number,
    name text,
    openning_year number,
    capacity number,
    location text
)

CREATE TABLE film (
    film_id number,
    rank_in_series number,
    number_in_season number,
    title text,
    directed_by text,
    original_air_date text,
    production_code text
)

CREATE TABLE schedule (
    cinema_id number,
    film_id number,
    date text,
    show_times_per_day number,
    price number
) ### Response: SELECT COUNT(*) FROM cinema


Instruction: What is the lowest Rank with more than 0 bronze, 8 silver, and a total of 19, with less than 9 gold?

Input:
CREATE TABLE table_name_23 (
    rank INTEGER,
    gold VARCHAR,
    total VARCHAR,
    bronze VARCHAR,
    silver VARCHAR
)

Response: SELECT MIN(rank) FROM table_name_23 WHERE bronze > 0 AND silver = 8 AND total = 19 AND gold < 9

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest Rank with more than 0 bronze, 8 silver, and a total of 19, with less than 9 gold? ### Input: CREATE TABLE table_name_23 (
    rank INTEGER,
    gold VARCHAR,
    total VARCHAR,
    bronze VARCHAR,
    silver VARCHAR
) ### Response: SELECT MIN(rank) FROM table_name_23 WHERE bronze > 0 AND silver = 8 AND total = 19 AND gold < 9


Instruction: What is the number of patients with private health insurance who had a urea nitrogen urine lab test?

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Urea Nitrogen, Urine"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of patients with private health insurance who had a urea nitrogen urine lab test? ### Input: CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Urea Nitrogen, Urine"


Instruction: Name the 2006 when the 2010 is 27

Input:
CREATE TABLE table_15796 (
    "Tournament" text,
    "2006" text,
    "2007" text,
    "2008" text,
    "2009" text,
    "2010" text,
    "2011" text,
    "2012" text
)

Response: SELECT "2006" FROM table_15796 WHERE "2010" = '27'

Below are sql tables 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 2006 when the 2010 is 27 ### Input: CREATE TABLE table_15796 (
    "Tournament" text,
    "2006" text,
    "2007" text,
    "2008" text,
    "2009" text,
    "2010" text,
    "2011" text,
    "2012" text
) ### Response: SELECT "2006" FROM table_15796 WHERE "2010" = '27'


Instruction: What was the score of the game when the Indians ended up with a record of 55-51?

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

Response: SELECT score FROM table_name_33 WHERE record = "55-51"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the game when the Indians ended up with a record of 55-51? ### Input: CREATE TABLE table_name_33 (
    score VARCHAR,
    record VARCHAR
) ### Response: SELECT score FROM table_name_33 WHERE record = "55-51"


Instruction: Who won the mens singles when sayaka sato won the womens singles?

Input:
CREATE TABLE table_12275551_1 (
    mens_singles VARCHAR,
    womens_singles VARCHAR
)

Response: SELECT mens_singles FROM table_12275551_1 WHERE womens_singles = "Sayaka Sato"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who won the mens singles when sayaka sato won the womens singles? ### Input: CREATE TABLE table_12275551_1 (
    mens_singles VARCHAR,
    womens_singles VARCHAR
) ### Response: SELECT mens_singles FROM table_12275551_1 WHERE womens_singles = "Sayaka Sato"


Instruction: What is the name of the Original artist when the week # is top 16 (8 men)?

Input:
CREATE TABLE table_name_15 (
    original_artist VARCHAR,
    week__number VARCHAR
)

Response: SELECT original_artist FROM table_name_15 WHERE week__number = "top 16 (8 men)"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the Original artist when the week # is top 16 (8 men)? ### Input: CREATE TABLE table_name_15 (
    original_artist VARCHAR,
    week__number VARCHAR
) ### Response: SELECT original_artist FROM table_name_15 WHERE week__number = "top 16 (8 men)"


Instruction: With an original artist names Bette Midler, what is the order number?

Input:
CREATE TABLE table_21501565_1 (
    order__number VARCHAR,
    original_artist VARCHAR
)

Response: SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = "Bette Midler"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With an original artist names Bette Midler, what is the order number? ### Input: CREATE TABLE table_21501565_1 (
    order__number VARCHAR,
    original_artist VARCHAR
) ### Response: SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = "Bette Midler"


Instruction: Posts that were edited by other users.

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

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

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment 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 PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

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

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

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

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

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

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

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

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

CREATE TABLE 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 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 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 Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

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

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

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

CREATE TABLE 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 ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)

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

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE PostTypes (
    Id number,
    Name text
)

Response: SELECT Id AS "post_link", LastEditorUserId AS "user_link", LastEditDate FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != '##UserId##' ORDER BY LastEditDate 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: Posts that were edited by other users. ### Input: CREATE TABLE PostLinks (
    Id number,
    CreationDate time,
    PostId number,
    RelatedPostId number,
    LinkTypeId number
)

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

CREATE TABLE PostHistoryTypes (
    Id number,
    Name text
)

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

CREATE TABLE VoteTypes (
    Id number,
    Name text
)

CREATE TABLE ReviewTaskResults (
    Id number,
    ReviewTaskId number,
    ReviewTaskResultTypeId number,
    CreationDate time,
    RejectionReasonId number,
    Comment 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 PostFeedback (
    Id number,
    PostId number,
    IsAnonymous boolean,
    VoteTypeId number,
    CreationDate time
)

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

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

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

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

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

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

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

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

CREATE TABLE 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 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 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 Tags (
    Id number,
    TagName text,
    Count number,
    ExcerptPostId number,
    WikiPostId number
)

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

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

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

CREATE TABLE 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 ReviewTaskResultTypes (
    Id number,
    Name text,
    Description text
)

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

CREATE TABLE PostTags (
    PostId number,
    TagId number
)

CREATE TABLE PostTypes (
    Id number,
    Name text
) ### Response: SELECT Id AS "post_link", LastEditorUserId AS "user_link", LastEditDate FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != '##UserId##' ORDER BY LastEditDate DESC


Instruction: How many appointment dates were recorded when J rgen Kohler was the replaced by?

Input:
CREATE TABLE table_21275 (
    "Team" text,
    "Outgoing manager" text,
    "Manner of departure" text,
    "Date of vacancy" text,
    "Replaced by" text,
    "Date of appointment" text
)

Response: SELECT COUNT("Date of appointment") FROM table_21275 WHERE "Replaced by" = 'Jürgen Kohler'

Below are sql tables 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 appointment dates were recorded when J rgen Kohler was the replaced by? ### Input: CREATE TABLE table_21275 (
    "Team" text,
    "Outgoing manager" text,
    "Manner of departure" text,
    "Date of vacancy" text,
    "Replaced by" text,
    "Date of appointment" text
) ### Response: SELECT COUNT("Date of appointment") FROM table_21275 WHERE "Replaced by" = 'Jürgen Kohler'


Instruction: What is the average year with an average start smaller than 6.3 and fewer than 0 wins?

Input:
CREATE TABLE table_36915 (
    "Year" real,
    "Starts" real,
    "Wins" real,
    "Top 5" real,
    "Top 10" real,
    "Poles" real,
    "Avg. Start" real,
    "Avg. Finish" real,
    "Winnings" text,
    "Position" text
)

Response: SELECT AVG("Year") FROM table_36915 WHERE "Avg. Start" < '6.3' AND "Wins" < '0'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average year with an average start smaller than 6.3 and fewer than 0 wins? ### Input: CREATE TABLE table_36915 (
    "Year" real,
    "Starts" real,
    "Wins" real,
    "Top 5" real,
    "Top 10" real,
    "Poles" real,
    "Avg. Start" real,
    "Avg. Finish" real,
    "Winnings" text,
    "Position" text
) ### Response: SELECT AVG("Year") FROM table_36915 WHERE "Avg. Start" < '6.3' AND "Wins" < '0'


Instruction: japan earned only 1 bronze metal in boxing during the 1960 olympics . how many other countries earned the exact same metal count as japan ?

Input:
CREATE TABLE table_203_496 (
    id number,
    "pos" number,
    "country" text,
    "gold" number,
    "silver" number,
    "bronze" number,
    "total" number
)

Response: SELECT COUNT("country") FROM table_203_496 WHERE "country" <> 'japan' AND "bronze" = 1 AND "total" = 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: japan earned only 1 bronze metal in boxing during the 1960 olympics . how many other countries earned the exact same metal count as japan ? ### Input: CREATE TABLE table_203_496 (
    id number,
    "pos" number,
    "country" text,
    "gold" number,
    "silver" number,
    "bronze" number,
    "total" number
) ### Response: SELECT COUNT("country") FROM table_203_496 WHERE "country" <> 'japan' AND "bronze" = 1 AND "total" = 1


Instruction: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to display Name in asc order.

Input:
CREATE TABLE Products (
    Code INTEGER,
    Name VARCHAR(255),
    Price DECIMAL,
    Manufacturer INTEGER
)

CREATE TABLE Manufacturers (
    Code INTEGER,
    Name VARCHAR(255),
    Headquarter VARCHAR(255),
    Founder VARCHAR(255),
    Revenue REAL
)

Response: SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.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: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to display Name in asc order. ### Input: CREATE TABLE Products (
    Code INTEGER,
    Name VARCHAR(255),
    Price DECIMAL,
    Manufacturer INTEGER
)

CREATE TABLE Manufacturers (
    Code INTEGER,
    Name VARCHAR(255),
    Headquarter VARCHAR(255),
    Founder VARCHAR(255),
    Revenue REAL
) ### Response: SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name


Instruction: Which Wins have Losses smaller than 6, and a Position of 4, and Played larger than 9?

Input:
CREATE TABLE table_name_98 (
    wins INTEGER,
    played VARCHAR,
    losses VARCHAR,
    position VARCHAR
)

Response: SELECT MIN(wins) FROM table_name_98 WHERE losses < 6 AND position = 4 AND played > 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 Wins have Losses smaller than 6, and a Position of 4, and Played larger than 9? ### Input: CREATE TABLE table_name_98 (
    wins INTEGER,
    played VARCHAR,
    losses VARCHAR,
    position VARCHAR
) ### Response: SELECT MIN(wins) FROM table_name_98 WHERE losses < 6 AND position = 4 AND played > 9


Instruction: What date did the epiode that had 1.37 million as the rating originally air?

Input:
CREATE TABLE table_27218002_2 (
    originalairdate VARCHAR,
    ratings VARCHAR
)

Response: SELECT originalairdate FROM table_27218002_2 WHERE ratings = "1.37 Million"

Below are sql tables 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 date did the epiode that had 1.37 million as the rating originally air? ### Input: CREATE TABLE table_27218002_2 (
    originalairdate VARCHAR,
    ratings VARCHAR
) ### Response: SELECT originalairdate FROM table_27218002_2 WHERE ratings = "1.37 Million"


Instruction: When divisional semifinals are the playoffs what is the year?

Input:
CREATE TABLE table_23374 (
    "Year" text,
    "Division" text,
    "League" text,
    "Regular Season" text,
    "Playoffs" text,
    "Open Cup" text
)

Response: SELECT "Year" FROM table_23374 WHERE "Playoffs" = 'Divisional Semifinals'

Below are sql tables 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 divisional semifinals are the playoffs what is the year? ### Input: CREATE TABLE table_23374 (
    "Year" text,
    "Division" text,
    "League" text,
    "Regular Season" text,
    "Playoffs" text,
    "Open Cup" text
) ### Response: SELECT "Year" FROM table_23374 WHERE "Playoffs" = 'Divisional Semifinals'


Instruction: Which label released the catalog Magik Muzik CD 07 on 28 March 2007?

Input:
CREATE TABLE table_name_86 (
    label VARCHAR,
    date VARCHAR,
    catalog VARCHAR
)

Response: SELECT label FROM table_name_86 WHERE date = "28 march 2007" AND catalog = "magik muzik cd 07"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which label released the catalog Magik Muzik CD 07 on 28 March 2007? ### Input: CREATE TABLE table_name_86 (
    label VARCHAR,
    date VARCHAR,
    catalog VARCHAR
) ### Response: SELECT label FROM table_name_86 WHERE date = "28 march 2007" AND catalog = "magik muzik cd 07"


Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart, and sort in ascending by the Y-axis.

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

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

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

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

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

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

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

Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart, and sort in ascending by the Y-axis. ### Input: CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,0)
)

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

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

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

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

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

CREATE TABLE departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
) ### Response: SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)


Instruction: when did patient 029-16431 come this year for the last time to the hospital?

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

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

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

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

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

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

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

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

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

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

Response: SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-16431' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 029-16431 come this year for the last time to the hospital? ### Input: CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

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

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

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

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

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

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

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

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

CREATE TABLE patient (
    uniquepid text,
    patienthealthsystemstayid number,
    patientunitstayid number,
    gender text,
    age text,
    ethnicity text,
    hospitalid number,
    wardid number,
    admissionheight number,
    admissionweight number,
    dischargeweight number,
    hospitaladmittime time,
    hospitaladmitsource text,
    unitadmittime time,
    unitdischargetime time,
    hospitaldischargetime time,
    hospitaldischargestatus text
) ### Response: SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-16431' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1


Instruction: what is the number of patients whose diagnoses long title is sinoatrial node dysfunction?

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sinoatrial node dysfunction"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose diagnoses long title is sinoatrial node dysfunction? ### Input: CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

CREATE TABLE prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sinoatrial node dysfunction"


Instruction: Show me how many destination by destination in a histogram, display by the bars in ascending.

Input:
CREATE TABLE certificate (
    eid number(9,0),
    aid number(9,0)
)

CREATE TABLE employee (
    eid number(9,0),
    name varchar2(30),
    salary number(10,2)
)

CREATE TABLE flight (
    flno number(4,0),
    origin varchar2(20),
    destination varchar2(20),
    distance number(6,0),
    departure_date date,
    arrival_date date,
    price number(7,2),
    aid number(9,0)
)

CREATE TABLE aircraft (
    aid number(9,0),
    name varchar2(30),
    distance number(6,0)
)

Response: SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination

Below are sql tables 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 how many destination by destination in a histogram, display by the bars in ascending. ### Input: CREATE TABLE certificate (
    eid number(9,0),
    aid number(9,0)
)

CREATE TABLE employee (
    eid number(9,0),
    name varchar2(30),
    salary number(10,2)
)

CREATE TABLE flight (
    flno number(4,0),
    origin varchar2(20),
    destination varchar2(20),
    distance number(6,0),
    departure_date date,
    arrival_date date,
    price number(7,2),
    aid number(9,0)
)

CREATE TABLE aircraft (
    aid number(9,0),
    name varchar2(30),
    distance number(6,0)
) ### Response: SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination


Instruction: Which player plays for the college of manitoba?

Input:
CREATE TABLE table_52523 (
    "Pick #" real,
    "CFL Team" text,
    "Player" text,
    "Position" text,
    "College" text
)

Response: SELECT "Player" FROM table_52523 WHERE "College" = 'manitoba'

Below are sql tables 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 plays for the college of manitoba? ### Input: CREATE TABLE table_52523 (
    "Pick #" real,
    "CFL Team" text,
    "Player" text,
    "Position" text,
    "College" text
) ### Response: SELECT "Player" FROM table_52523 WHERE "College" = 'manitoba'


Instruction: what is diagnoses short title of subject id 17519?

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

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

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

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

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

Response: SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "17519"

Below are sql tables 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 diagnoses short title of subject id 17519? ### Input: CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

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

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

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

CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "17519"


Instruction: What was the Engine, when the Chassis was Bugatti T51, and when the Entrant was a Private Entry?

Input:
CREATE TABLE table_7679 (
    "Driver" text,
    "Entrant" text,
    "Constructor" text,
    "Chassis" text,
    "Engine" text
)

Response: SELECT "Engine" FROM table_7679 WHERE "Chassis" = 'bugatti t51' AND "Entrant" = 'private entry'

Below are sql tables 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 Engine, when the Chassis was Bugatti T51, and when the Entrant was a Private Entry? ### Input: CREATE TABLE table_7679 (
    "Driver" text,
    "Entrant" text,
    "Constructor" text,
    "Chassis" text,
    "Engine" text
) ### Response: SELECT "Engine" FROM table_7679 WHERE "Chassis" = 'bugatti t51' AND "Entrant" = 'private entry'


Instruction: find the number of patients whose admission type is elective and lab test name is potassium, urine.

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

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

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

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

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

Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Potassium, Urine"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients whose admission type is elective and lab test name is potassium, urine. ### Input: CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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

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

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Potassium, Urine"


Instruction: Name the city for los angeles stadium

Input:
CREATE TABLE table_30442 (
    "Stadium" text,
    "Capacity" real,
    "City" text,
    "Country" text,
    "Tenant" text,
    "Opening" text
)

Response: SELECT "City" FROM table_30442 WHERE "Stadium" = 'Los Angeles Stadium'

Below are sql tables 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 city for los angeles stadium ### Input: CREATE TABLE table_30442 (
    "Stadium" text,
    "Capacity" real,
    "City" text,
    "Country" text,
    "Tenant" text,
    "Opening" text
) ### Response: SELECT "City" FROM table_30442 WHERE "Stadium" = 'Los Angeles Stadium'


Instruction: What is the Film/Show, when the Year is 2010?

Input:
CREATE TABLE table_68099 (
    "Year" real,
    "Group" text,
    "Award" text,
    "Film/Show" text,
    "Result" text
)

Response: SELECT "Film/Show" FROM table_68099 WHERE "Year" = '2010'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Film/Show, when the Year is 2010? ### Input: CREATE TABLE table_68099 (
    "Year" real,
    "Group" text,
    "Award" text,
    "Film/Show" text,
    "Result" text
) ### Response: SELECT "Film/Show" FROM table_68099 WHERE "Year" = '2010'


Instruction: Name the score for opponents of nathan healey igor kunitsyn

Input:
CREATE TABLE table_38244 (
    "Outcome" text,
    "Date" text,
    "Tournament" text,
    "Surface" text,
    "Partnering" text,
    "Opponents in the final" text,
    "Score" text
)

Response: SELECT "Score" FROM table_38244 WHERE "Opponents in the final" = 'nathan healey igor kunitsyn'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the score for opponents of nathan healey igor kunitsyn ### Input: CREATE TABLE table_38244 (
    "Outcome" text,
    "Date" text,
    "Tournament" text,
    "Surface" text,
    "Partnering" text,
    "Opponents in the final" text,
    "Score" text
) ### Response: SELECT "Score" FROM table_38244 WHERE "Opponents in the final" = 'nathan healey igor kunitsyn'


Instruction: What is the average Season, when F/Laps is 1, and when Poles is less than 0?

Input:
CREATE TABLE table_42825 (
    "Season" real,
    "Series" text,
    "Races" real,
    "Wins" real,
    "Poles" real,
    "F/Laps" real,
    "Podiums" real,
    "Points" text,
    "Position" text
)

Response: SELECT AVG("Season") FROM table_42825 WHERE "F/Laps" = '1' AND "Poles" < '0'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average Season, when F/Laps is 1, and when Poles is less than 0? ### Input: CREATE TABLE table_42825 (
    "Season" real,
    "Series" text,
    "Races" real,
    "Wins" real,
    "Poles" real,
    "F/Laps" real,
    "Podiums" real,
    "Points" text,
    "Position" text
) ### Response: SELECT AVG("Season") FROM table_42825 WHERE "F/Laps" = '1' AND "Poles" < '0'


Instruction: let me know the birth date and death date of patient caren obrien.

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

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

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

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

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

Response: SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = "Caren Obrien"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: let me know the birth date and death date of patient caren obrien. ### Input: CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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

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

CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
) ### Response: SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = "Caren Obrien"


Instruction: Show party names and the number of events for each party. Visualize by pie chart.

Input:
CREATE TABLE party (
    Party_ID int,
    Minister text,
    Took_office text,
    Left_office text,
    Region_ID int,
    Party_name text
)

CREATE TABLE member (
    Member_ID int,
    Member_Name text,
    Party_ID text,
    In_office text
)

CREATE TABLE party_events (
    Event_ID int,
    Event_Name text,
    Party_ID int,
    Member_in_charge_ID int
)

CREATE TABLE region (
    Region_ID int,
    Region_name text,
    Date text,
    Label text,
    Format text,
    Catalogue text
)

Response: SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_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 party names and the number of events for each party. Visualize by pie chart. ### Input: CREATE TABLE party (
    Party_ID int,
    Minister text,
    Took_office text,
    Left_office text,
    Region_ID int,
    Party_name text
)

CREATE TABLE member (
    Member_ID int,
    Member_Name text,
    Party_ID text,
    In_office text
)

CREATE TABLE party_events (
    Event_ID int,
    Event_Name text,
    Party_ID int,
    Member_in_charge_ID int
)

CREATE TABLE region (
    Region_ID int,
    Region_name text,
    Date text,
    Label text,
    Format text,
    Catalogue text
) ### Response: SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID


Instruction: List all results from the 3-3 scoring game.

Input:
CREATE TABLE table_26930 (
    "Game" real,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Wildcats points" real,
    "Opponents" real,
    "Record" text
)

Response: SELECT "Result" FROM table_26930 WHERE "Record" = '3-3'

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all results from the 3-3 scoring game. ### Input: CREATE TABLE table_26930 (
    "Game" real,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Wildcats points" real,
    "Opponents" real,
    "Record" text
) ### Response: SELECT "Result" FROM table_26930 WHERE "Record" = '3-3'


Instruction: How many laps did BRM have with a grid of 11?

Input:
CREATE TABLE table_name_33 (
    laps VARCHAR,
    constructor VARCHAR,
    grid VARCHAR
)

Response: SELECT COUNT(laps) FROM table_name_33 WHERE constructor = "brm" AND grid = 11

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many laps did BRM have with a grid of 11? ### Input: CREATE TABLE table_name_33 (
    laps VARCHAR,
    constructor VARCHAR,
    grid VARCHAR
) ### Response: SELECT COUNT(laps) FROM table_name_33 WHERE constructor = "brm" AND grid = 11


Instruction: What is the total number of draws for songs performed by Miranda with fewer than 48 points?

Input:
CREATE TABLE table_name_64 (
    draw VARCHAR,
    performer VARCHAR,
    points VARCHAR
)

Response: SELECT COUNT(draw) FROM table_name_64 WHERE performer = "miranda" AND points < 48

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of draws for songs performed by Miranda with fewer than 48 points? ### Input: CREATE TABLE table_name_64 (
    draw VARCHAR,
    performer VARCHAR,
    points VARCHAR
) ### Response: SELECT COUNT(draw) FROM table_name_64 WHERE performer = "miranda" AND points < 48


Instruction: On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70?

Input:
CREATE TABLE table_name_49 (
    date VARCHAR,
    games VARCHAR,
    time VARCHAR
)

Response: SELECT date FROM table_name_49 WHERE games = "2002 salt lake city" AND time = "3:57.70"

Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70? ### Input: CREATE TABLE table_name_49 (
    date VARCHAR,
    games VARCHAR,
    time VARCHAR
) ### Response: SELECT date FROM table_name_49 WHERE games = "2002 salt lake city" AND time = "3:57.70"