VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

Question: what is the number of patients whose lab test fluid is urine?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Urine"

Question: how many patients whose diagnoses long title is perforation of intestine and lab test category is blood gas?

SQL:
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 = "Perforation of intestine" AND lab."CATEGORY" = "Blood Gas"
Schema:
CREATE TABLE table_name_21 (
    type VARCHAR,
    name VARCHAR
)

Question: What is the type when McCormack is the name?

SQL:
SELECT type FROM table_name_21 WHERE name = "mccormack"
Schema:
CREATE TABLE table_28033 (
    "Player" text,
    "Position" text,
    "Starter" text,
    "Touchdowns" real,
    "Extra points" real,
    "Field goals" real,
    "Points" real
)

Question: How many numbers were recorded on the fields goals of the Left End player?

SQL:
SELECT COUNT("Field goals") FROM table_28033 WHERE "Position" = 'Left end'
Schema:
CREATE TABLE basketball_match (
    Team_ID int,
    School_ID int,
    Team_Name text,
    ACC_Regular_Season text,
    ACC_Percent text,
    ACC_Home text,
    ACC_Road text,
    All_Games text,
    All_Games_Percent int,
    All_Home text,
    All_Road text,
    All_Neutral text
)

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

Question: A bar chart shows the distribution of All_Games and School_ID , and could you list by the bars in desc?

SQL:
SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games DESC

Question: Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home, and sort from low to high by the y axis.

SQL:
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID

Question: Show team id vs acc_percent as scatter plot use a different color for each All_Games

SQL:
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games

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

SQL:
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC

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

SQL:
SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID

Question: A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and sort by the x axis from high to low.

SQL:
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC

Question: Draw a bar chart about the distribution of All_Road and School_ID , order by the Y-axis from low to high please.

SQL:
SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID

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

SQL:
SELECT Team_Name, ACC_Percent FROM basketball_match

Question: Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, could you show in desc by the y-axis please?

SQL:
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC
Schema:
CREATE TABLE table_20297668_1 (
    standard_yarn_weight_system VARCHAR,
    wraps_per_inch__wpi_ VARCHAR
)

Question: Name the standard yarn weight system for 7 wpi

SQL:
SELECT standard_yarn_weight_system FROM table_20297668_1 WHERE wraps_per_inch__wpi_ = "7 wpi"
Schema:
CREATE TABLE table_1262 (
    "Name" text,
    "Position" text,
    "Number" real,
    "School/Club Team" text,
    "Season" text,
    "Acquisition via" text
)

Question: Nametheh school team for norman gonzales

SQL:
SELECT "School/Club Team" FROM table_1262 WHERE "Name" = 'Norman Gonzales'
Schema:
CREATE TABLE table_name_51 (
    points_against VARCHAR,
    drawn VARCHAR,
    tries_for VARCHAR
)

Question: For the club that had tries of 50 and drawn of 0, what were the points?

SQL:
SELECT points_against FROM table_name_51 WHERE drawn = "0" AND tries_for = "50"
Schema:
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 allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime 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 intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

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

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

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

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

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

Question: last time until 20 months ago when did patient 028-23341 get a prescription?

SQL:
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-23341')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-20 month') ORDER BY medication.drugstarttime DESC LIMIT 1
Schema:
CREATE TABLE demographic (
    subject_id text,
    hadm_id text,
    name text,
    marital_status text,
    age text,
    dob text,
    gender text,
    language text,
    religion text,
    admission_type text,
    days_stay text,
    insurance text,
    ethnicity text,
    expire_flag text,
    admission_location text,
    discharge_location text,
    diagnosis text,
    dod text,
    dob_year text,
    dod_year text,
    admittime text,
    dischtime text,
    admityear text
)

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

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

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
)

Question: how many of the patients aged below 76 had migraine unspecified w/o ntrc mgrn?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.short_title = "Migrne unsp wo ntrc mgrn"

Question: Find me the admission type and short title of procedure for the patient with patient id 2110.

SQL:
SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2110"
Schema:
CREATE TABLE table_name_3 (
    yards INTEGER,
    long VARCHAR,
    avg VARCHAR
)

Question: Name the lowest yards for 34 long and avg less than 12.6

SQL:
SELECT MIN(yards) FROM table_name_3 WHERE long = 34 AND avg < 12.6
Schema:
CREATE TABLE table_56314 (
    "Date" text,
    "Opponent" text,
    "Score" text,
    "Loss" text,
    "Attendance" real,
    "Record" text
)

Question: Who did they lose to on may 9?

SQL:
SELECT "Loss" FROM table_56314 WHERE "Date" = 'may 9'
Schema:
CREATE TABLE departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_ID decimal(4,0)
)

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

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

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

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

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

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

Question: For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, list x-axis in asc order please.

SQL:
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
Schema:
CREATE TABLE table_23718905_6 (
    matchup_results VARCHAR,
    city VARCHAR
)

Question: How many different matchup/results appear in San Diego, California?

SQL:
SELECT COUNT(matchup_results) FROM table_23718905_6 WHERE city = "San Diego, California"
Schema:
CREATE TABLE table_name_88 (
    years VARCHAR,
    actor VARCHAR,
    soap_opera VARCHAR,
    duration VARCHAR
)

Question: What years did Marienhof run, which featured Leonore Capell and lasted 10 years?

SQL:
SELECT years FROM table_name_88 WHERE soap_opera = "marienhof" AND duration = "10 years" AND actor = "leonore capell"
Schema:
CREATE TABLE body_builder (
    Body_Builder_ID int,
    People_ID int,
    Snatch real,
    Clean_Jerk real,
    Total real
)

CREATE TABLE people (
    People_ID int,
    Name text,
    Height real,
    Weight real,
    Birth_Date text,
    Birth_Place text
)

Question: Return a scatter chart about the correlation between Body_Builder_ID and Clean_Jerk .

SQL:
SELECT Body_Builder_ID, Clean_Jerk FROM body_builder
Schema:
CREATE TABLE table_10312547_1 (
    character VARCHAR
)

Question: How many playerd Mrs. Darling in the 1999 Broadway?

SQL:
SELECT COUNT(1999 AS _broadway) FROM table_10312547_1 WHERE character = "Mrs. Darling"
Schema:
CREATE TABLE procedures (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

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

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

Question: how many patients whose drug code is teraz5 and lab test fluid is urine?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "TERAZ5" AND lab.fluid = "Urine"

Question: what is the maximum age of patients whose death status is 0 and diagnosed with primary disease coronary artery disease\coronary artery bypass graft with mvr; ? maze?

SQL:
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE"
Schema:
CREATE TABLE table_name_33 (
    lost VARCHAR,
    drawn VARCHAR,
    tries_against VARCHAR
)

Question: What is the value for Lost when Drawn is 0, and Tries against is 41?

SQL:
SELECT lost FROM table_name_33 WHERE drawn = "0" AND tries_against = "41"
Schema:
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
)

Question: For those products with a price between 60 and 120, return a bar chart about the distribution of name and manufacturer , and sort in desc by the y-axis.

SQL:
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer DESC

Question: Count the names of all the products in the store and return me a bar chart, could you order Name in asc order?

SQL:
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name

Question: For those records from the products and each product's manufacturer, find headquarter and the amount of headquarter , and group by attribute headquarter, and visualize them by a bar chart, and I want to display x axis in descending order please.

SQL:
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC

Question: 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.

SQL:
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

Question: Give me a bar chart for how many name of each name, and order by the names in ascending.

SQL:
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name

Question: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of code , and group by attribute name, list by the total number in descending.

SQL:
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC

Question: For those records from the products and each product's manufacturer, find founder and the average of manufacturer , and group by attribute founder, and visualize them by a bar chart, I want to sort by the Y-axis in asc.

SQL:
SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Manufacturer)

Question: For those products with a price between 60 and 120, show me about the correlation between code and price , and group by attribute name in a scatter chart.

SQL:
SELECT Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name

Question: Create a bar chart showing maximal revenue across name

SQL:
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter

Question: Create a bar chart showing maximal revenue across name, and I want to rank X in descending order please.

SQL:
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Name DESC
Schema:
CREATE TABLE table_name_52 (
    venue VARCHAR,
    away_team VARCHAR
)

Question: Where does South Melbourne play?

SQL:
SELECT venue FROM table_name_52 WHERE away_team = "south melbourne"
Schema:
CREATE TABLE Ref_Address_Types (
    address_type_code VARCHAR(15),
    address_type_description VARCHAR(80)
)

CREATE TABLE Teachers (
    teacher_id INTEGER,
    address_id INTEGER,
    first_name VARCHAR(80),
    middle_name VARCHAR(80),
    last_name VARCHAR(80),
    gender VARCHAR(1),
    cell_mobile_number VARCHAR(40),
    email_address VARCHAR(40),
    other_details VARCHAR(255)
)

CREATE TABLE Ref_Detention_Type (
    detention_type_code VARCHAR(10),
    detention_type_description VARCHAR(80)
)

CREATE TABLE Ref_Incident_Type (
    incident_type_code VARCHAR(10),
    incident_type_description VARCHAR(80)
)

CREATE TABLE Addresses (
    address_id INTEGER,
    line_1 VARCHAR(120),
    line_2 VARCHAR(120),
    line_3 VARCHAR(120),
    city VARCHAR(80),
    zip_postcode VARCHAR(20),
    state_province_county VARCHAR(50),
    country VARCHAR(50),
    other_address_details VARCHAR(255)
)

CREATE TABLE Students_in_Detention (
    student_id INTEGER,
    detention_id INTEGER,
    incident_id INTEGER
)

CREATE TABLE Assessment_Notes (
    notes_id INTEGER,
    student_id INTEGER,
    teacher_id INTEGER,
    date_of_notes DATETIME,
    text_of_notes VARCHAR(255),
    other_details VARCHAR(255)
)

CREATE TABLE Detention (
    detention_id INTEGER,
    detention_type_code VARCHAR(10),
    teacher_id INTEGER,
    datetime_detention_start DATETIME,
    datetime_detention_end DATETIME,
    detention_summary VARCHAR(255),
    other_details VARCHAR(255)
)

CREATE TABLE Students (
    student_id INTEGER,
    address_id INTEGER,
    first_name VARCHAR(80),
    middle_name VARCHAR(40),
    last_name VARCHAR(40),
    cell_mobile_number VARCHAR(40),
    email_address VARCHAR(40),
    date_first_rental DATETIME,
    date_left_university DATETIME,
    other_student_details VARCHAR(255)
)

CREATE TABLE Student_Addresses (
    student_id INTEGER,
    address_id INTEGER,
    date_address_from DATETIME,
    date_address_to DATETIME,
    monthly_rental DECIMAL(19,4),
    other_details VARCHAR(255)
)

CREATE TABLE Behavior_Incident (
    incident_id INTEGER,
    incident_type_code VARCHAR(10),
    student_id INTEGER,
    date_incident_start DATETIME,
    date_incident_end DATETIME,
    incident_summary VARCHAR(255),
    recommendations VARCHAR(255),
    other_details VARCHAR(255)
)

Question: Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday by a bar chart.

SQL:
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
Schema:
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 lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

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

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

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

Question: what was the name of the laboratory test that patient 021-141335 received last in a month before?

SQL:
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY lab.labresulttime DESC LIMIT 1
Schema:
CREATE TABLE table_68490 (
    "Date" text,
    "Venue" text,
    "Score" text,
    "Result" text,
    "Competition" text
)

Question: Which date has a score of 2-1?

SQL:
SELECT "Date" FROM table_68490 WHERE "Score" = '2-1'
Schema:
CREATE TABLE table_71745 (
    "Year" real,
    "Opponent" text,
    "Competition" text,
    "Score" text,
    "Venue" text,
    "Attendance" text
)

Question: What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels?

SQL:
SELECT COUNT("Year") FROM table_71745 WHERE "Venue" = 'sydney cricket ground' AND "Opponent" = 'parramatta eels'
Schema:
CREATE TABLE table_31998 (
    "Stem Meaning" text,
    "2nd person sg" text,
    "2nd person sg honorific" text,
    "3rd person sg" text,
    "3rd person sg honorific" text
)

Question: Tell me the Stem Meaning of ical

SQL:
SELECT "Stem Meaning" FROM table_31998 WHERE "3rd person sg" = 'ical'