VishalCh/book-train huggingface dataset:
Schema:
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
)

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

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

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

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

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

CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime 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 lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

Question: since 5 years ago, what are the five most frequently performed procedures for patients in the same month after receiving a vascular surgery consultation?

SQL:
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'vascular surgery consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.treatmenttime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 5
Schema:
CREATE TABLE table_43705 (
    "Date" text,
    "Visitor" text,
    "Score" text,
    "Home" text,
    "Attendance" real,
    "Record" text,
    "Points" real
)

Question: What was the highest points on October 12, when the attendance where is over 10,701?

SQL:
SELECT MAX("Points") FROM table_43705 WHERE "Date" = 'october 12' AND "Attendance" > '10,701'
Schema:
CREATE TABLE Dorm (
    dormid INTEGER,
    dorm_name VARCHAR(20),
    student_capacity INTEGER,
    gender VARCHAR(1)
)

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 Lives_in (
    stuid INTEGER,
    dormid INTEGER,
    room_number INTEGER
)

CREATE TABLE Has_amenity (
    dormid INTEGER,
    amenid INTEGER
)

CREATE TABLE Dorm_amenity (
    amenid INTEGER,
    amenity_name VARCHAR(25)
)

Question: A bar chart for what are the number of the first names of all students in Smith Hall?, could you list in ascending by the total number please?

SQL:
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname)
Schema:
CREATE TABLE table_40077 (
    "Date" text,
    "Cover model" text,
    "Centerfold model" text,
    "Interview subject" text,
    "Pictorials" text
)

Question: Who was the Interview Subject on the Date when there were Pictorials of Christie Brinkley?

SQL:
SELECT "Interview subject" FROM table_40077 WHERE "Pictorials" = 'christie brinkley'
Schema:
CREATE TABLE table_62505 (
    "Player" text,
    "Country" text,
    "Year(s) won" text,
    "Total" real,
    "To par" real,
    "Finish" text
)

Question: What is the sum of the total of the player who won in 1979?

SQL:
SELECT SUM("Total") FROM table_62505 WHERE "Year(s) won" = '1979'
Schema:
CREATE TABLE table_name_72 (
    accreditation_level VARCHAR,
    date VARCHAR
)

Question: What is the accreditation level for the approved (awarded 05.12.12) date?

SQL:
SELECT accreditation_level FROM table_name_72 WHERE date = "approved (awarded 05.12.12)"
Schema:
CREATE TABLE race (
    Race_ID int,
    Name text,
    Class text,
    Date text,
    Track_ID text
)

CREATE TABLE track (
    Track_ID int,
    Name text,
    Location text,
    Seating real,
    Year_Opened real
)

Question: Give me a bar chart for the total number of each class, and could you sort from high to low by the y-axis please?

SQL:
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC
Schema:
CREATE TABLE table_name_5 (
    pick__number INTEGER,
    position VARCHAR,
    round VARCHAR
)

Question: Before round 7, what is the greatest Pick # for a player that plays defensive tackle?

SQL:
SELECT MAX(pick__number) FROM table_name_5 WHERE position = "defensive tackle" AND round < 7
Schema:
CREATE TABLE endowment (
    endowment_id int,
    School_id int,
    donator_name text,
    amount real
)

CREATE TABLE School (
    School_id text,
    School_name text,
    Location text,
    Mascot text,
    Enrollment int,
    IHSAA_Class text,
    IHSAA_Football_Class text,
    County text
)

CREATE TABLE budget (
    School_id int,
    Year int,
    Budgeted int,
    total_budget_percent_budgeted real,
    Invested int,
    total_budget_percent_invested real,
    Budget_invested_percent text
)

Question: Please give me a bar chart for the total enrollment in each county, sort in asc by the total number.

SQL:
SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment)
Schema:
CREATE TABLE table_8366 (
    "Game" real,
    "Date" text,
    "Opponent" text,
    "Score" text,
    "Location/Attendance" text,
    "Record" text
)

Question: What is Record, when Game is greater than 55, and when Date is 'March 25'?

SQL:
SELECT "Record" FROM table_8366 WHERE "Game" > '55' AND "Date" = 'march 25'
Schema:
CREATE TABLE table_3592 (
    "Team" text,
    "Manager" text,
    "Chairman" text,
    "Team captain" text,
    "Kit maker" text,
    "Sponsor" text
)

Question: Who is the captain of Neil Warnock's team?

SQL:
SELECT "Team captain" FROM table_3592 WHERE "Manager" = 'Neil Warnock'
Schema:
CREATE TABLE table_18106841_1 (
    members_of_parliament VARCHAR,
    winners__percentage_votes VARCHAR
)

Question: When the winners votes were 50.54% who were the members of parliment?

SQL:
SELECT members_of_parliament FROM table_18106841_1 WHERE winners__percentage_votes = "50.54%"
Schema:
CREATE TABLE table_20079931_4 (
    highest_scoring_team VARCHAR,
    circuit_location VARCHAR,
    winning_team VARCHAR
)

Question: What's the highest scoring team in the round in Ring Knutstorp in which Polestar Racing is the winning team?

SQL:
SELECT highest_scoring_team FROM table_20079931_4 WHERE circuit_location = "Ring Knutstorp" AND winning_team = "Polestar Racing"
Schema:
CREATE TABLE paper (
    paperid int,
    title varchar,
    venueid int,
    year int,
    numciting int,
    numcitedby int,
    journalid int
)

CREATE TABLE paperfield (
    fieldid int,
    paperid int
)

CREATE TABLE journal (
    journalid int,
    journalname varchar
)

CREATE TABLE dataset (
    datasetid int,
    datasetname varchar
)

CREATE TABLE paperdataset (
    paperid int,
    datasetid int
)

CREATE TABLE keyphrase (
    keyphraseid int,
    keyphrasename varchar
)

CREATE TABLE writes (
    paperid int,
    authorid int
)

CREATE TABLE paperkeyphrase (
    paperid int,
    keyphraseid int
)

CREATE TABLE venue (
    venueid int,
    venuename varchar
)

CREATE TABLE cite (
    citingpaperid int,
    citedpaperid int
)

CREATE TABLE field (
    fieldid int
)

CREATE TABLE author (
    authorid int,
    authorname varchar
)

Question: Is it true that geoffrey e. hinton has more citations than yann lecun ?

SQL:
SELECT DISTINCT author.authorname, COUNT(writes.paperid) FROM author, writes WHERE author.authorname IN ('geoffrey e. hinton', 'yann lecun') AND writes.authorid = author.authorid GROUP BY author.authorname ORDER BY COUNT(writes.paperid) DESC
Schema:
CREATE TABLE table_27753492_2 (
    mixed_doubles VARCHAR,
    tour VARCHAR
)

Question: Who is the mixed doubled on the tour korea super series?

SQL:
SELECT mixed_doubles FROM table_27753492_2 WHERE tour = "Korea Super Series"
Schema:
CREATE TABLE table_204_630 (
    id number,
    "no" number,
    "date" text,
    "race" text,
    "track" text,
    "winner" text,
    "reports" text
)

Question: which is longer the carolina or kentucky race ?

SQL:
SELECT "race" FROM table_204_630 WHERE "race" IN ('carolina 500', 'kentucky') ORDER BY "no" DESC LIMIT 1
Schema:
CREATE TABLE table_name_13 (
    cdt___5_utc_ VARCHAR,
    pdt___7_utc_ VARCHAR
)

Question: What time is CDT when PDT is 3:17 a.m.?

SQL:
SELECT cdt___5_utc_ FROM table_name_13 WHERE pdt___7_utc_ = "3:17 a.m."
Schema:
CREATE TABLE table_25679 (
    "Stage" real,
    "Winner" text,
    "General classification" text,
    "Mountains classification" text,
    "Points classification" text,
    "Youth classification" text,
    "Team Classification" text
)

Question: Who was Mountains Classification in the race with Nick Frey as Youth Classification and Tom Zirbel as Points Classification?

SQL:
SELECT "Mountains classification" FROM table_25679 WHERE "Youth classification" = 'Nick Frey' AND "Points classification" = 'Tom Zirbel'
Schema:
CREATE TABLE table_name_47 (
    region VARCHAR,
    catalog VARCHAR
)

Question: What Region has a Catalog of crgd 86136?

SQL:
SELECT region FROM table_name_47 WHERE catalog = "crgd 86136"
Schema:
CREATE TABLE table_name_24 (
    pashto VARCHAR,
    somali VARCHAR
)

Question: What is the Pashto word for the Somali word talaado?

SQL:
SELECT pashto FROM table_name_24 WHERE somali = "talaado"
Schema:
CREATE TABLE table_65588 (
    "Actor" text,
    "Character" text,
    "Soap Opera" text,
    "Years" text,
    "Duration" text
)

Question: What years have claudia ruffo as the actor?

SQL:
SELECT "Years" FROM table_65588 WHERE "Actor" = 'claudia ruffo'
Schema:
CREATE TABLE table_name_60 (
    final VARCHAR,
    run_3 VARCHAR
)

Question: What is Final, when Run 3 is 1:57.41?

SQL:
SELECT final FROM table_name_60 WHERE run_3 = "1:57.41"
Schema:
CREATE TABLE table_name_76 (
    away_team VARCHAR,
    venue VARCHAR
)

Question: Which away team has a venue of Arden Street Oval?

SQL:
SELECT away_team FROM table_name_76 WHERE venue = "arden street oval"
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 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 lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

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

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

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

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

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

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

Question: what was the first time that patient 031-24513 got a microbiology test?

SQL:
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) ORDER BY microlab.culturetakentime LIMIT 1
Schema:
CREATE TABLE table_47989 (
    "Year" real,
    "Round" real,
    "Pick" real,
    "Player" text,
    "NBA Club" text
)

Question: What is the pick number for Danny Green in a round less than 2?

SQL:
SELECT COUNT("Pick") FROM table_47989 WHERE "Player" = 'danny green' AND "Round" < '2'
Schema:
CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime 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 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 lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime time
)

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

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

Question: when was the last time patient 016-35266 was admitted via a hospital other hospital?

SQL:
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-35266' AND patient.hospitaladmitsource = 'other hospital' ORDER BY patient.hospitaladmittime DESC LIMIT 1
Schema:
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 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 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)
)

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

Question: For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday.

SQL:
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
Schema:
CREATE TABLE Accounts (
    account_id INTEGER,
    customer_id INTEGER,
    date_account_opened DATETIME,
    account_name VARCHAR(50),
    other_account_details VARCHAR(255)
)

CREATE TABLE Order_Items (
    order_item_id INTEGER,
    order_id INTEGER,
    product_id INTEGER,
    product_quantity VARCHAR(50),
    other_order_item_details VARCHAR(255)
)

CREATE TABLE Financial_Transactions (
    transaction_id INTEGER,
    account_id INTEGER,
    invoice_number INTEGER,
    transaction_type VARCHAR(15),
    transaction_date DATETIME,
    transaction_amount DECIMAL(19,4),
    transaction_comment VARCHAR(255),
    other_transaction_details VARCHAR(255)
)

CREATE TABLE Orders (
    order_id INTEGER,
    customer_id INTEGER,
    date_order_placed DATETIME,
    order_details VARCHAR(255)
)

CREATE TABLE Product_Categories (
    production_type_code VARCHAR(15),
    product_type_description VARCHAR(80),
    vat_rating DECIMAL(19,4)
)

CREATE TABLE Invoices (
    invoice_number INTEGER,
    order_id INTEGER,
    invoice_date DATETIME
)

CREATE TABLE Products (
    product_id INTEGER,
    parent_product_id INTEGER,
    production_type_code VARCHAR(15),
    unit_price DECIMAL(19,4),
    product_name VARCHAR(80),
    product_color VARCHAR(20),
    product_size VARCHAR(20)
)

CREATE TABLE Invoice_Line_Items (
    order_item_id INTEGER,
    invoice_number INTEGER,
    product_id INTEGER,
    product_title VARCHAR(80),
    product_quantity VARCHAR(50),
    product_price DECIMAL(19,4),
    derived_product_cost DECIMAL(19,4),
    derived_vat_payable DECIMAL(19,4),
    derived_total_cost DECIMAL(19,4)
)

CREATE TABLE Customers (
    customer_id INTEGER,
    customer_first_name VARCHAR(50),
    customer_middle_initial VARCHAR(1),
    customer_last_name VARCHAR(50),
    gender VARCHAR(1),
    email_address VARCHAR(255),
    login_name VARCHAR(80),
    login_password VARCHAR(20),
    phone_number VARCHAR(255),
    town_city VARCHAR(50),
    state_county_province VARCHAR(50),
    country VARCHAR(50)
)

Question: Give me a pie to show how many other account details from different other account details.

SQL:
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details
Schema:
CREATE TABLE table_name_28 (
    score VARCHAR,
    opponent VARCHAR,
    location VARCHAR
)

Question: What is the score from the game where Algeria is the opponent at Porto-Novo?

SQL:
SELECT score FROM table_name_28 WHERE opponent = "algeria" AND location = "porto-novo"
Schema:
CREATE TABLE table_name_58 (
    location VARCHAR,
    built VARCHAR
)

Question: What is the Location of the Bridge Built in 1869?

SQL:
SELECT location FROM table_name_58 WHERE built = "1869"
Schema:
CREATE TABLE table_2544694_3 (
    indonesia_super_series_2008 VARCHAR,
    runner_up VARCHAR
)

Question: Which series occurred in which the semi-finalist was runner-up and the 7800.00 was 6420.00?

SQL:
SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE runner_up = "Semi-Finalist" AND 780000 = "6420.00"
Schema:
CREATE TABLE table_name_9 (
    status VARCHAR,
    commissioned VARCHAR
)

Question: What is the status of the fleet that was commissioned on July 28, 1963?

SQL:
SELECT status FROM table_name_9 WHERE commissioned = "july 28, 1963"
Schema:
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
)

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

SQL:
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)
Schema:
CREATE TABLE table_name_86 (
    score VARCHAR,
    date VARCHAR
)

Question: I want the score for 23 july 1992

SQL:
SELECT score FROM table_name_86 WHERE date = "23 july 1992"
Schema:
CREATE TABLE table_80251 (
    "Original NFL team" text,
    "Player" text,
    "Pos." text,
    "College" text,
    "Conf." text
)

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

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