VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE table_14219514_1 (
    home__1st_leg_ VARCHAR
)

Question: Who was in 2nd leg when Boca Juniors was in home (1st leg)?

SQL:
SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Boca Juniors"
Schema:
CREATE TABLE table_19722233_5 (
    blocks VARCHAR,
    player VARCHAR
)

Question: how many times did debbie black block

SQL:
SELECT blocks FROM table_19722233_5 WHERE player = "Debbie Black"
Schema:
CREATE TABLE table_name_83 (
    decision VARCHAR,
    record VARCHAR
)

Question: Who had the decision goal when the record was 7-7-2?

SQL:
SELECT decision FROM table_name_83 WHERE record = "7-7-2"
Schema:
CREATE TABLE driver (
    name VARCHAR,
    home_city VARCHAR,
    age VARCHAR
)

Question: Show the name, home city, and age for all drivers.

SQL:
SELECT name, home_city, age FROM driver
Schema:
CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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

Question: Count the number of patients on a sulfameth/trimethoprim ds prescription who were hospitalized for more than 17 days.

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "17" AND prescriptions.drug = "Sulfameth/Trimethoprim DS"

Question: what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]"
Schema:
CREATE TABLE table_name_70 (
    rd_1 INTEGER,
    province VARCHAR,
    rd_4 VARCHAR
)

Question: Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0?

SQL:
SELECT MAX(rd_1) FROM table_name_70 WHERE province = "utrecht" AND rd_4 > 0
Schema:
CREATE TABLE Person (
    name varchar(20),
    age INTEGER,
    city TEXT,
    gender TEXT,
    job TEXT
)

CREATE TABLE PersonFriend (
    name varchar(20),
    friend varchar(20),
    year INTEGER
)

Question: What is average age for different job title Visualize by bar chart, I want to rank by the bars from low to high.

SQL:
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job

Question: A bar chart about what is average age for different job title?, and rank y axis in ascending order.

SQL:
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age)

Question: How many people are under 40 for each gender Plot them as bar chart, list x axis in asc order.

SQL:
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender

Question: how old is the youngest person for each job?, and could you order x-axis from low to high order?

SQL:
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
Schema:
CREATE TABLE table_204_123 (
    id number,
    "week" number,
    "date" text,
    "kickoff" text,
    "opponent" text,
    "results\nfinal score" text,
    "results\nteam record" text,
    "game site" text,
    "attendance" number
)

Question: which date had the least attendance ?

SQL:
SELECT "date" FROM table_204_123 ORDER BY "attendance" LIMIT 1

Question: what was the teams final record

SQL:
SELECT "results\nteam record" FROM table_204_123 ORDER BY "week" DESC LIMIT 1
Schema:
CREATE TABLE table_name_23 (
    attendance INTEGER,
    date VARCHAR
)

Question: What is the average number in attendance on September 16?

SQL:
SELECT AVG(attendance) FROM table_name_23 WHERE date = "september 16"
Schema:
CREATE TABLE table_23937219_3 (
    original_air_date VARCHAR,
    prod_code VARCHAR
)

Question: How many original air dates were there for the episode with production code 212?

SQL:
SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212
Schema:
CREATE TABLE table_name_39 (
    capacity VARCHAR,
    acceleration_0_100km_h VARCHAR
)

Question: what is the capacity when the acceleration 1-100km/h is 11.1 s?

SQL:
SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s"
Schema:
CREATE TABLE table_name_4 (
    to_par VARCHAR,
    player VARCHAR
)

Question: Name the To par of payne stewart?

SQL:
SELECT to_par FROM table_name_4 WHERE player = "payne stewart"
Schema:
CREATE TABLE lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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

CREATE TABLE 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: provide the admission time and marital status of subject id 6983.

SQL:
SELECT demographic.marital_status, demographic.admittime FROM demographic WHERE demographic.subject_id = "6983"

Question: what is minimum age of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and days of hospital stay is 20?

SQL:
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT   " AND demographic.days_stay = "20"
Schema:
CREATE TABLE table_203_83 (
    id number,
    "ranking" number,
    "company" text,
    "industry" text,
    "revenue (usd billions)" text,
    "fy" text,
    "capitalization (usd billions)" text,
    "employees" number,
    "listing" text,
    "headquarters" text,
    "ceo" text
)

Question: how many employees does vitol have ?

SQL:
SELECT "employees" FROM table_203_83 WHERE "company" = 'vitol'
Schema:
CREATE TABLE table_70516 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" real,
    "Money ( $ )" text
)

Question: What was E.J. 'Dutch' Harrison's lowest To Par?

SQL:
SELECT MIN("To par") FROM table_70516 WHERE "Player" = 'e.j. "dutch" harrison'
Schema:
CREATE TABLE procedures (
    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 lab (
    subject_id text,
    hadm_id text,
    itemid text,
    charttime text,
    flag text,
    value_unit text,
    label text,
    fluid text
)

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

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

Question: count the number of patients whose language is engl and diagnoses long title is unspecified protein-calorie malnutrition?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "ENGL" AND diagnoses.long_title = "Unspecified protein-calorie malnutrition"

Question: count the number of private health insurance patients who had transplant from cadaver.

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Transplant cadaver donor"
Schema:
CREATE TABLE table_20448 (
    "Information" text,
    "Akimel A-al The name is Tohono Oodham for children of the river" text,
    "Altade\u00f1a" text,
    "Aprende" text,
    "Centennial" text,
    "Kyrene MS" text,
    "del Pueblo" text
)

Question: Name the centennial for location

SQL:
SELECT "Centennial" FROM table_20448 WHERE "Information" = 'Location'
Schema:
CREATE TABLE financial_transactions (
    transaction_id number,
    account_id number,
    invoice_number number,
    transaction_type text,
    transaction_date time,
    transaction_amount number,
    transaction_comment text,
    other_transaction_details text
)

CREATE TABLE invoices (
    invoice_number number,
    order_id number,
    invoice_date time
)

CREATE TABLE customers (
    customer_id number,
    customer_first_name text,
    customer_middle_initial text,
    customer_last_name text,
    gender text,
    email_address text,
    login_name text,
    login_password text,
    phone_number text,
    town_city text,
    state_county_province text,
    country text
)

CREATE TABLE invoice_line_items (
    order_item_id number,
    invoice_number number,
    product_id number,
    product_title text,
    product_quantity text,
    product_price number,
    derived_product_cost number,
    derived_vat_payable number,
    derived_total_cost number
)

CREATE TABLE accounts (
    account_id number,
    customer_id number,
    date_account_opened time,
    account_name text,
    other_account_details text
)

CREATE TABLE product_categories (
    production_type_code text,
    product_type_description text,
    vat_rating number
)

CREATE TABLE products (
    product_id number,
    parent_product_id number,
    production_type_code text,
    unit_price number,
    product_name text,
    product_color text,
    product_size text
)

CREATE TABLE order_items (
    order_item_id number,
    order_id number,
    product_id number,
    product_quantity text,
    other_order_item_details text
)

CREATE TABLE orders (
    order_id number,
    customer_id number,
    date_order_placed time,
    order_details text
)

Question: What are the invoice dates, order ids, and order details for all invoices?

SQL:
SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id
Schema:
CREATE TABLE procedures (
    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 diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

Question: give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal"
Schema:
CREATE TABLE table_44912 (
    "Team" text,
    "Manager" text,
    "Home city" text,
    "Stadium" text,
    "Capacity" real
)

Question: what is the home city for the stadion src mladost?

SQL:
SELECT "Home city" FROM table_44912 WHERE "Stadium" = 'stadion src mladost'
Schema:
CREATE TABLE table_20094 (
    "Name" text,
    "Position" text,
    "Number" real,
    "School/Club Team" text,
    "Season" text,
    "Acquisition via" text
)

Question: How many players are listed for the school/club team Washington?

SQL:
SELECT COUNT("Name") FROM table_20094 WHERE "School/Club Team" = 'Washington'
Schema:
CREATE TABLE table_name_97 (
    chipset VARCHAR,
    graphics VARCHAR,
    model VARCHAR
)

Question: What type of chipset is in the Precision t3400 model with the PCI Express graphics?

SQL:
SELECT chipset FROM table_name_97 WHERE graphics = "pci express" AND model = "precision t3400"
Schema:
CREATE TABLE dorm (
    dormid number,
    dorm_name text,
    student_capacity number,
    gender text
)

CREATE TABLE lives_in (
    stuid number,
    dormid number,
    room_number number
)

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

CREATE TABLE has_amenity (
    dormid number,
    amenid number
)

CREATE TABLE dorm_amenity (
    amenid number,
    amenity_name text
)

Question: Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.

SQL:
SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100
Schema:
CREATE TABLE Customers (
    Customer_ID INTEGER,
    Customer_Details VARCHAR(255)
)

CREATE TABLE Payments (
    Payment_ID INTEGER,
    Settlement_ID INTEGER,
    Payment_Method_Code VARCHAR(255),
    Date_Payment_Made DATE,
    Amount_Payment INTEGER
)

CREATE TABLE Settlements (
    Settlement_ID INTEGER,
    Claim_ID INTEGER,
    Date_Claim_Made DATE,
    Date_Claim_Settled DATE,
    Amount_Claimed INTEGER,
    Amount_Settled INTEGER,
    Customer_Policy_ID INTEGER
)

CREATE TABLE Claims (
    Claim_ID INTEGER,
    Policy_ID INTEGER,
    Date_Claim_Made DATE,
    Date_Claim_Settled DATE,
    Amount_Claimed INTEGER,
    Amount_Settled INTEGER
)

CREATE TABLE Customer_Policies (
    Policy_ID INTEGER,
    Customer_ID INTEGER,
    Policy_Type_Code CHAR(15),
    Start_Date DATE,
    End_Date DATE
)

Question: For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis.

SQL:
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
Schema:
CREATE TABLE table_name_99 (
    total INTEGER,
    horse VARCHAR
)

Question: Tell me the highest total when the horse is spender s

SQL:
SELECT MAX(total) FROM table_name_99 WHERE horse = "spender s"
Schema:
CREATE TABLE table_19608 (
    "Series #" real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Original air date" text,
    "Production Code" real,
    "U.S. viewers (millions)" text
)

Question: What is the air date for 'there goes the bride'?

SQL:
SELECT "Original air date" FROM table_19608 WHERE "Title" = 'There Goes the Bride'
Schema:
CREATE TABLE train (
    Train_ID int,
    Name text,
    Time text,
    Service text
)

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

CREATE TABLE train_station (
    Train_ID int,
    Station_ID int
)

Question: Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please.

SQL:
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC
Schema:
CREATE TABLE table_44077 (
    "Season" text,
    "Series" text,
    "Team" text,
    "Races" text,
    "Wins" text,
    "Poles" text,
    "F/Laps" text,
    "Podiums" text,
    "Points" text,
    "Pos." text
)

Question: what is the wins when the f/laps is test driver and team is lotus racing?

SQL:
SELECT "Wins" FROM table_44077 WHERE "F/Laps" = 'test driver' AND "Team" = 'lotus racing'
Schema:
CREATE TABLE table_21474 (
    "Game" real,
    "Date" text,
    "Team" text,
    "Score" text,
    "High points" text,
    "High rebounds" text,
    "High assists" text,
    "Location Attendance" text,
    "Record" text
)

Question: What was the final record for the game in which Dirk Nowitzki (19) had the high points?

SQL:
SELECT "Record" FROM table_21474 WHERE "High points" = 'Dirk Nowitzki (19)'
Schema:
CREATE TABLE table_17290 (
    "Game" real,
    "Date" text,
    "Team" text,
    "Score" text,
    "High points" text,
    "High rebounds" text,
    "High assists" text,
    "Location Attendance" text,
    "Record" text
)

Question: What is the record where high assists is pierce (6)?

SQL:
SELECT "Record" FROM table_17290 WHERE "High assists" = 'Pierce (6)'
Schema:
CREATE TABLE table_45211 (
    "English" text,
    "Pali" text,
    "Sanskrit" text,
    "Chinese" text,
    "Tibetan" text
)

Question: Which Chinese has a Pali of atappa?

SQL:
SELECT "Chinese" FROM table_45211 WHERE "Pali" = 'atappa'
Schema:
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 cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

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 diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

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
)

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
)

Question: what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago?

SQL:
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t2.culturetakentime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4
Schema:
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 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 medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime 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 treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

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

Question: what was the number of aneurysm resection / repair procedures that were performed a year before?

SQL:
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection / repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')