VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE table_16858 (
    "Player" text,
    "No." real,
    "Nationality" text,
    "Position" text,
    "Years for Jazz" text,
    "School/Club Team" text
)

Question: What years did number 54 play for the jazz

SQL:
SELECT "Years for Jazz" FROM table_16858 WHERE "No." = '54'
Schema:
CREATE TABLE Rating (
    rID int,
    mID int,
    stars int,
    ratingDate date
)

CREATE TABLE Reviewer (
    rID int,
    name text
)

CREATE TABLE Movie (
    mID int,
    title text,
    year int,
    director text
)

Question: For each director, how many reviews have they received Visualize by bar chart, and could you rank from high to low by the Y-axis?

SQL:
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY COUNT(*) DESC
Schema:
CREATE TABLE table_name_6 (
    played INTEGER,
    position VARCHAR,
    goals_against VARCHAR
)

Question: Which lowest played has a Position of 2, and Goals against larger than 53?

SQL:
SELECT MIN(played) FROM table_name_6 WHERE position = 2 AND goals_against > 53
Schema:
CREATE TABLE table_name_53 (
    english_title VARCHAR,
    director_s_ VARCHAR
)

Question: What is the English title of the film directed by Fernando Meirelles?

SQL:
SELECT english_title FROM table_name_53 WHERE director_s_ = "fernando meirelles"
Schema:
CREATE TABLE table_19548 (
    "Pick #" real,
    "Player" text,
    "Position" text,
    "Nationality" text,
    "NHL team" text,
    "College/junior/club team" text
)

Question: Name the college/junior club team for pick number 63

SQL:
SELECT "College/junior/club team" FROM table_19548 WHERE "Pick #" = '63'
Schema:
CREATE TABLE table_204_761 (
    id number,
    "rank" number,
    "nation" text,
    "gold" number,
    "silver" number,
    "bronze" number,
    "total" number
)

Question: what is the total number of silver medals won by russia , norway , and sweden combined ?

SQL:
SELECT SUM("silver") FROM table_204_761 WHERE "nation" IN ('russia', 'norway', 'sweden')
Schema:
CREATE TABLE shop (
    shop_id number,
    address text,
    num_of_staff text,
    score number,
    open_year text
)

CREATE TABLE happy_hour (
    hh_id number,
    shop_id number,
    month text,
    num_of_shaff_in_charge number
)

CREATE TABLE member (
    member_id number,
    name text,
    membership_card text,
    age number,
    time_of_purchase number,
    level_of_membership number,
    address text
)

CREATE TABLE happy_hour_member (
    hh_id number,
    member_id number,
    total_amount number
)

Question: Find the number of members living in each address.

SQL:
SELECT COUNT(*), address FROM member GROUP BY address
Schema:
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 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 medication (
    medicationid number,
    patientunitstayid number,
    drugname text,
    dosage text,
    routeadmin text,
    drugstarttime time,
    drugstoptime 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 treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime 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
)

Question: what is the variation of patient 006-181433's weight second measured on the current hospital visit compared to the first value measured on the current hospital visit?

SQL:
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1)
Schema:
CREATE TABLE table_name_43 (
    to_par VARCHAR,
    place VARCHAR
)

Question: What is To Par, when Place is 3?

SQL:
SELECT to_par FROM table_name_43 WHERE place = "3"
Schema:
CREATE TABLE d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

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

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

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

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

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

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 icustays (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    first_careunit text,
    last_careunit text,
    first_wardid number,
    last_wardid number,
    intime time,
    outtime time
)

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

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

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

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

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

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

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

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

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

Question: what age does patient 71192 have on the last hospital encounter?

SQL:
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
Schema:
CREATE TABLE table_name_15 (
    date_of_release VARCHAR,
    title VARCHAR
)

Question: On what date was god & guns released?

SQL:
SELECT date_of_release FROM table_name_15 WHERE title = "god & guns"
Schema:
CREATE TABLE table_19130829_4 (
    team__number1 VARCHAR
)

Question: What's the 2nd leg result in the round where team #1 is Iraklis?

SQL:
SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number1 = "Iraklis"
Schema:
CREATE TABLE table_204_692 (
    id number,
    "publication" text,
    "score" text,
    "review" text
)

Question: what number of publications are indicated as being in print ?

SQL:
SELECT COUNT("publication") FROM table_204_692 WHERE "review" = 'print'
Schema:
CREATE TABLE table_21885 (
    "Season" text,
    "Date" text,
    "Driver" text,
    "Team" text,
    "Chassis" text,
    "Engine" text,
    "Laps" text,
    "Miles (km)" text,
    "Race Time" text,
    "Average Speed (mph)" text,
    "Report" text
)

Question: When 228 is the lap and chip ganassi racing is the team what is the race time?

SQL:
SELECT "Race Time" FROM table_21885 WHERE "Team" = 'Chip Ganassi Racing' AND "Laps" = '228'
Schema:
CREATE TABLE table_29668 (
    "Week #" text,
    "Theme" text,
    "Song Choice" text,
    "Original Artist" text,
    "Order #" text,
    "Result" text
)

Question: Which song was picked that was originally performed by Marisa Monte?

SQL:
SELECT "Song Choice" FROM table_29668 WHERE "Original Artist" = 'Marisa Monte'
Schema:
CREATE TABLE table_name_83 (
    population INTEGER,
    median_household_income VARCHAR,
    number_of_households VARCHAR
)

Question: What is the population where the median household income is $87,832 and there are fewer than 64,886 households?

SQL:
SELECT AVG(population) FROM table_name_83 WHERE median_household_income = "$87,832" AND number_of_households < 64 OFFSET 886
Schema:
CREATE TABLE table_18686317_1 (
    rank VARCHAR,
    yardage VARCHAR
)

Question: What is the rank of the player who got 58179 in yardage?

SQL:
SELECT rank FROM table_18686317_1 WHERE yardage = 58179
Schema:
CREATE TABLE Courses (
    course_name VARCHAR,
    course_id VARCHAR
)

CREATE TABLE Student_Course_Enrolment (
    course_id VARCHAR
)

Question: What is the name of the course that has the most student enrollment?

SQL:
SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1
Schema:
CREATE TABLE table_39196 (
    "Season" real,
    "Series" text,
    "Team" text,
    "Races" real,
    "Wins" real,
    "Poles" real,
    "Podiums" real
)

Question: What is the largest amount of wins that was before the 2007 season, as well as the Team being silverstone motorsport academy?

SQL:
SELECT MAX("Wins") FROM table_39196 WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy'
Schema:
CREATE TABLE table_name_38 (
    away_team VARCHAR,
    tie_no VARCHAR
)

Question: What away team has 7 as the tie no.?

SQL:
SELECT away_team FROM table_name_38 WHERE tie_no = "7"
Schema:
CREATE TABLE table_train_71 (
    "id" int,
    "gender" string,
    "language" string,
    "intention_to_arterial_catheter" bool,
    "renal_disease" bool,
    "sepsis" bool,
    "allergy_to_hydroxyethyl_starch" bool,
    "age" float,
    "NOUSE" float
)

Question: male or female ages >= 3.5 years and <= 18 years on day of sepsis recognition

SQL:
SELECT * FROM table_train_71 WHERE (gender = 'male' OR gender = 'female') AND (age >= 3.5 AND age <= 18) AND sepsis = 1
Schema:
CREATE TABLE table_67049 (
    "Quarter" text,
    "Score" text,
    "Club" text,
    "Opponent" text,
    "Year" text,
    "Round" text,
    "Venue" text
)

Question: Which year has a Round of 17?

SQL:
SELECT "Year" FROM table_67049 WHERE "Round" = '17'
Schema:
CREATE TABLE table_203_379 (
    id number,
    "first issued" text,
    "design" text,
    "slogan" text,
    "serial format" text,
    "serials issued" text,
    "notes" text
)

Question: how many license plates were issued before 1960 ?

SQL:
SELECT COUNT(*) FROM table_203_379 WHERE "first issued" < 1960
Schema:
CREATE TABLE cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

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

Question: when was patient 035-24054's ventric #1 output for the last time on the current intensive care unit visit?

SQL:
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'ventric #1' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1
Schema:
CREATE TABLE table_name_66 (
    runner_up VARCHAR,
    year VARCHAR,
    champion VARCHAR
)

Question: Which runner-up placed in a year prior to 2006 and whose Champion was Elon?

SQL:
SELECT runner_up FROM table_name_66 WHERE year < 2006 AND champion = "elon"
Schema:
CREATE TABLE table_name_81 (
    touchdowns INTEGER,
    points VARCHAR,
    field_goals VARCHAR
)

Question: Which Touchdowns is the lowest one that has Points of 5, and a Field goals larger than 0?

SQL:
SELECT MIN(touchdowns) FROM table_name_81 WHERE points = 5 AND field_goals > 0
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 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 diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

Question: what is religion of subject id 26746?

SQL:
SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "26746"
Schema:
CREATE TABLE table_name_33 (
    constructor VARCHAR,
    laps VARCHAR,
    driver VARCHAR
)

Question: who is the constructor when the laps is more than 72 and the driver is eddie irvine?

SQL:
SELECT constructor FROM table_name_33 WHERE laps > 72 AND driver = "eddie irvine"
Schema:
CREATE TABLE table_name_88 (
    total INTEGER,
    silver VARCHAR,
    bronze VARCHAR,
    gold VARCHAR
)

Question: What is the average total for teams with under 34 bronzes, 0 silver, and under 14 gold?

SQL:
SELECT AVG(total) FROM table_name_88 WHERE bronze < 34 AND gold < 14 AND silver < 0
Schema:
CREATE TABLE table_15405 (
    "Year" real,
    "Team" text,
    "Chassis" text,
    "Engine" text,
    "Points" real
)

Question: What are the highest points with a Chassis of gordini t16, and a Year smaller than 1954?

SQL:
SELECT MAX("Points") FROM table_15405 WHERE "Chassis" = 'gordini t16' AND "Year" < '1954'
Schema:
CREATE TABLE table_29318 (
    "No. in series" real,
    "No. in season" real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Original air date" text,
    "Production code" text,
    "U.S. viewers (million)" text
)

Question: Who wrote the episodes with 7.70 u.s. viewers (million) ?

SQL:
SELECT "Written by" FROM table_29318 WHERE "U.S. viewers (million)" = '7.70'
Schema:
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 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
)

Question: calculate the total number of patients diagnosed with other b-complex deficiencies

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other B-complex deficiencies"
Schema:
CREATE TABLE table_68185 (
    "Season" real,
    "Overall" text,
    "Slalom" text,
    "Giant Slalom" text,
    "Super G" text,
    "Downhill" text,
    "Combined" text
)

Question: What super g was before 1998, had 2 giant slaloms and 24 downhills?

SQL:
SELECT "Super G" FROM table_68185 WHERE "Season" < '1998' AND "Giant Slalom" = '2' AND "Downhill" = '24'
Schema:
CREATE TABLE table_name_40 (
    pick VARCHAR,
    round VARCHAR,
    player VARCHAR
)

Question: Which pick's round was 5 when Kellen Davis was a player?

SQL:
SELECT pick FROM table_name_40 WHERE round = "5" AND player = "kellen davis"
Schema:
CREATE TABLE table_23117208_5 (
    title VARCHAR,
    written_by VARCHAR
)

Question: What is the name of the episode that was written by Michael Rauch?

SQL:
SELECT title FROM table_23117208_5 WHERE written_by = "Michael Rauch"
Schema:
CREATE TABLE table_32413 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
)

Question: What was the away team score when the home team was Carlton?

SQL:
SELECT "Away team score" FROM table_32413 WHERE "Home team" = 'carlton'
Schema:
CREATE TABLE table_21323 (
    "Rank" real,
    "1-year peak" text,
    "5-year peak" text,
    "10-year peak" text,
    "15-year peak" text,
    "20-year peak" text
)

Question: What is every 5-year peak when Emanuel Lasker, 2847 is the 10-year peak?

SQL:
SELECT "5-year peak" FROM table_21323 WHERE "10-year peak" = 'Emanuel Lasker, 2847'
Schema:
CREATE TABLE Has_Allergy (
    StuID INTEGER,
    Allergy VARCHAR(20)
)

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 Allergy_Type (
    Allergy VARCHAR(20),
    AllergyType VARCHAR(20)
)

Question: how old is each student and how many students are each age?

SQL:
SELECT Age, COUNT(*) FROM Student GROUP BY Age
Schema:
CREATE TABLE countries (
    COUNTRY_ID varchar(2),
    COUNTRY_NAME varchar(40),
    REGION_ID decimal(10,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 departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_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 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 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)
)

Question: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me the trend about department_id over hire_date with a line chart, show by the x-axis in desc.

SQL:
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC
Schema:
CREATE TABLE table_40605 (
    "Rank" real,
    "Name" text,
    "Team" text,
    "Games" real,
    "Rebounds" real
)

Question: What is the total number of Games, when Rank is less than 4, and when Rebounds is less than 102?

SQL:
SELECT COUNT("Games") FROM table_40605 WHERE "Rank" < '4' AND "Rebounds" < '102'
Schema:
CREATE TABLE table_39930 (
    "Date" text,
    "Centerfold model" text,
    "Interview subject" text,
    "20 Questions" text,
    "Pictorials" text
)

Question: Which Pictorials has a 20 Questions of eva longoria?

SQL:
SELECT "Pictorials" FROM table_39930 WHERE "20 Questions" = 'eva longoria'
Schema:
CREATE TABLE table_name_18 (
    film_title_used_in_nomination VARCHAR,
    original_title VARCHAR
)

Question: What is the nomination title used for the original film, Monsieur Hawarden?

SQL:
SELECT film_title_used_in_nomination FROM table_name_18 WHERE original_title = "monsieur hawarden"