VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE settlements (
    settlement_id number,
    claim_id number,
    date_claim_made time,
    date_claim_settled time,
    amount_claimed number,
    amount_settled number,
    customer_policy_id number
)

CREATE TABLE customers (
    customer_id number,
    customer_details text
)

CREATE TABLE claims (
    claim_id number,
    policy_id number,
    date_claim_made time,
    date_claim_settled time,
    amount_claimed number,
    amount_settled number
)

CREATE TABLE payments (
    payment_id number,
    settlement_id number,
    payment_method_code text,
    date_payment_made time,
    amount_payment number
)

CREATE TABLE customer_policies (
    policy_id number,
    customer_id number,
    policy_type_code text,
    start_date time,
    end_date time
)

Question: Tell me the the date when the first claim was made.

SQL:
SELECT date_claim_made FROM claims ORDER BY date_claim_made LIMIT 1
Schema:
CREATE TABLE table_77878 (
    "Team" text,
    "Outgoing manager" text,
    "Manner of departure" text,
    "Date of vacancy" text,
    "Replaced by" text,
    "Date of appointment" text
)

Question: Tell me the outgoing manager for 22 november date of vacancy

SQL:
SELECT "Outgoing manager" FROM table_77878 WHERE "Date of vacancy" = '22 november'
Schema:
CREATE TABLE table_50927 (
    "Winner" text,
    "Country" text,
    "Winter Olympics" real,
    "FIS Nordic World Ski Championships" text,
    "Holmenkollen" text
)

Question: Who won the FIS Nordic World Ski Championships in 1972?

SQL:
SELECT "Winner" FROM table_50927 WHERE "FIS Nordic World Ski Championships" = '1972'
Schema:
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 departments (
    DEPARTMENT_ID decimal(4,0),
    DEPARTMENT_NAME varchar(30),
    MANAGER_ID decimal(6,0),
    LOCATION_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 those employees who was hired before 2002-06-21, give me the comparison about the average of department_id over the job_id , and group by attribute job_id, show x-axis in descending order.

SQL:
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
Schema:
CREATE TABLE table_2187178_1 (
    listed_owner_s_ VARCHAR,
    team VARCHAR
)

Question: Name the listed owners for brevak racing

SQL:
SELECT listed_owner_s_ FROM table_2187178_1 WHERE team = "Brevak Racing"
Schema:
CREATE TABLE table_7061 (
    "Year" real,
    "Foundry" text,
    "Diameter (mm)" real,
    "Weight (kg)" text,
    "Nominal Tone" text
)

Question: What is the sum total of all the years with a bell that weighed 857 kilograms?

SQL:
SELECT SUM("Year") FROM table_7061 WHERE "Weight (kg)" = '857'
Schema:
CREATE TABLE table_name_46 (
    money___$__ VARCHAR,
    player VARCHAR
)

Question: What is Chris Riley's Money?

SQL:
SELECT money___$__ FROM table_name_46 WHERE player = "chris riley"
Schema:
CREATE TABLE country (
    country_id number,
    name text,
    population number,
    area number,
    languages text
)

CREATE TABLE roller_coaster (
    roller_coaster_id number,
    name text,
    park text,
    country_id number,
    length number,
    height number,
    speed text,
    opened text,
    status text
)

Question: What are the speeds of the longest roller coaster?

SQL:
SELECT speed FROM roller_coaster ORDER BY length DESC LIMIT 1
Schema:
CREATE TABLE table_name_48 (
    points INTEGER,
    year VARCHAR,
    goals VARCHAR
)

Question: What are the lowest points with 2013 as the year, and goals less than 0?

SQL:
SELECT MIN(points) FROM table_name_48 WHERE year = "2013" AND goals < 0
Schema:
CREATE TABLE table_16888 (
    "Year" real,
    "Championship" text,
    "54 holes" text,
    "Winning score" text,
    "Margin of victory" text,
    "Runner(s)-up" text
)

Question: Who were the runner(s)-up when Tiger won by 11 strokes?

SQL:
SELECT "Runner(s)-up" FROM table_16888 WHERE "Margin of victory" = '11 strokes'
Schema:
CREATE TABLE table_15187735_8 (
    segment_a VARCHAR,
    series_ep VARCHAR
)

Question: Name the segment a for 8-08

SQL:
SELECT segment_a FROM table_15187735_8 WHERE series_ep = "8-08"
Schema:
CREATE TABLE table_25276250_3 (
    outputs VARCHAR,
    notes VARCHAR
)

Question: How many outputs are there for solid state, battery operated for portable use listed in notes?

SQL:
SELECT COUNT(outputs) FROM table_25276250_3 WHERE notes = "Solid state, battery operated for portable use"
Schema:
CREATE TABLE table_24990183_7 (
    name VARCHAR,
    rank VARCHAR
)

Question: If the rank is 17, what are the names?

SQL:
SELECT name FROM table_24990183_7 WHERE rank = 17
Schema:
CREATE TABLE table_name_51 (
    reservation VARCHAR
)

Question: What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9?

SQL:
SELECT SUM(1979) FROM table_name_51 WHERE reservation = "standing rock indian reservation" AND 1989 < 54.9
Schema:
CREATE TABLE table_49308 (
    "Week" real,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Attendance" text
)

Question: What is Opponent, when Attendance is 58,836?

SQL:
SELECT "Opponent" FROM table_49308 WHERE "Attendance" = '58,836'
Schema:
CREATE TABLE table_41893 (
    "Name" text,
    "Level" real,
    "Digits" real,
    "Average size (square miles)" text,
    "Number of HUs (approximate)" real,
    "Example name" text,
    "Example code (HUC)" real
)

Question: What is the mean huc example code when the example name's lower snake, there are 6 digits, and less than 3 levels?

SQL:
SELECT AVG("Example code (HUC)") FROM table_41893 WHERE "Example name" = 'lower snake' AND "Digits" = '6' AND "Level" < '3'
Schema:
CREATE TABLE table_29572 (
    "Name/Name of Act" text,
    "Age(s)" text,
    "Genre" text,
    "Act" text,
    "Hometown" text,
    "Qtr. Final (Week)" real,
    "Semi Final (Week)" text,
    "Position Reached" text
)

Question: What is the quarterfinal week for Austin Anderson?

SQL:
SELECT MIN("Qtr. Final (Week)") FROM table_29572 WHERE "Name/Name of Act" = 'Austin Anderson'
Schema:
CREATE TABLE table_30696 (
    "Reservoir" text,
    "Basin" text,
    "Location" text,
    "Type" text,
    "Height (m)" text,
    "Length along the top (m)" text,
    "Drainage basin (km\u00b2)" text,
    "Reservoir surface (ha)" text,
    "Volume (hm\u00b3)" text
)

Question: What is the volume when the resrvoir is Tanes?

SQL:
SELECT "Volume (hm\u00b3)" FROM table_30696 WHERE "Reservoir" = 'Tanes'
Schema:
CREATE TABLE table_23576 (
    "Story #" real,
    "Target #" text,
    "Title" text,
    "Author" text,
    "Reader" text,
    "Format" text,
    "Company" text,
    "Release Date" text,
    "Notes" text
)

Question: What's the title of the audio book with story number 91?

SQL:
SELECT "Title" FROM table_23576 WHERE "Story #" = '91'
Schema:
CREATE TABLE table_name_9 (
    class VARCHAR,
    erp_w VARCHAR
)

Question: What class is ERP W of 800?

SQL:
SELECT class FROM table_name_9 WHERE erp_w = 800
Schema:
CREATE TABLE allergy (
    allergyid number,
    patientunitstayid number,
    drugname text,
    allergyname text,
    allergytime 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 diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code 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 intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime time
)

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime 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
)

Question: tell me the cost of the diagnosis for smoking cessation counseling given?

SQL:
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'smoking cessation counseling given')
Schema:
CREATE TABLE station (
    id number,
    network_name text,
    services text,
    local_authority text
)

CREATE TABLE route (
    train_id number,
    station_id number
)

CREATE TABLE weekly_weather (
    station_id number,
    day_of_week text,
    high_temperature number,
    low_temperature number,
    precipitation number,
    wind_speed_mph number
)

CREATE TABLE train (
    id number,
    train_number number,
    name text,
    origin text,
    destination text,
    time text,
    interval text
)

Question: Give me the maximum low temperature and average precipitation at the Amersham station.

SQL:
SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = "Amersham"
Schema:
CREATE TABLE table_name_20 (
    event VARCHAR,
    location VARCHAR
)

Question: Which event was held at Manly Beach?

SQL:
SELECT event FROM table_name_20 WHERE location = "manly beach"
Schema:
CREATE TABLE table_43959 (
    "Tie no" text,
    "Home team" text,
    "Score" text,
    "Away team" text,
    "Attendance" text
)

Question: Who was the home team against the Bolton Wanderers?

SQL:
SELECT "Home team" FROM table_43959 WHERE "Away team" = 'bolton wanderers'
Schema:
CREATE TABLE table_51600 (
    "Home team" text,
    "Home team score" text,
    "Away team" text,
    "Away team score" text,
    "Venue" text,
    "Crowd" real,
    "Date" text
)

Question: Tell me the away team score for away team of south melbourne

SQL:
SELECT "Away team score" FROM table_51600 WHERE "Away team" = 'south melbourne'
Schema:
CREATE TABLE table_55306 (
    "Year" real,
    "Animal" text,
    "Artist" text,
    "Finish" text,
    "Mintage" real,
    "Issue Price" text
)

Question: What year was the downy woodpecker coin created?

SQL:
SELECT SUM("Year") FROM table_55306 WHERE "Animal" = 'downy woodpecker'
Schema:
CREATE TABLE table_28269 (
    "Model" text,
    "Launch" text,
    "Code name" text,
    "Transistors (million)" real,
    "Die size (mm 2 )" real,
    "Bus interface" text,
    "Memory ( MB )" text,
    "SM count" real,
    "Core config 1,3" text,
    "Core ( MHz )" real,
    "Shader ( MHz )" real,
    "Memory ( MHz )" text,
    "Pixel ( GP /s)" text,
    "Texture ( GT /s)" text,
    "Bandwidth ( GB /s)" text,
    "DRAM type" text,
    "Bus width ( bit )" real,
    "GFLOPS (FMA) 2" text,
    "TDP (watts)" real,
    "Release price (USD)" text
)

Question: What model has a launch of September 3, 2010?

SQL:
SELECT "Model" FROM table_28269 WHERE "Launch" = 'September 3, 2010'
Schema:
CREATE TABLE table_name_65 (
    opponent VARCHAR,
    save VARCHAR
)

Question: Which opponent has a save of smith (22)?

SQL:
SELECT opponent FROM table_name_65 WHERE save = "smith (22)"
Schema:
CREATE TABLE table_name_71 (
    win_draw_lose VARCHAR,
    venue VARCHAR,
    team VARCHAR
)

Question: What was the result of the home game against Derby County?

SQL:
SELECT win_draw_lose FROM table_name_71 WHERE venue = "home" AND team = "derby county"
Schema:
CREATE TABLE table_43812 (
    "Club" text,
    "League goals" text,
    "FA Cup goals" text,
    "League Cup goals" text,
    "Total" real
)

Question: Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals of 1?

SQL:
SELECT SUM("Total") FROM table_43812 WHERE "Club" = 'darlington' AND "League goals" = '13' AND "League Cup goals" = '1'
Schema:
CREATE TABLE table_train_103 (
    "id" int,
    "systolic_blood_pressure_sbp" int,
    "epilepsy" bool,
    "diastolic_blood_pressure_dbp" int,
    "heart_rate" int,
    "seizure_disorder" bool,
    "age" float,
    "NOUSE" float
)

Question: age 65 years and older

SQL:
SELECT * FROM table_train_103 WHERE age >= 65
Schema:
CREATE TABLE table_name_4 (
    location VARCHAR,
    frequency VARCHAR
)

Question: Which Location has a Frequency of 102.5 fm?

SQL:
SELECT location FROM table_name_4 WHERE frequency = "102.5 fm"
Schema:
CREATE TABLE table_name_89 (
    crowd INTEGER,
    venue VARCHAR
)

Question: What is the smallest crowd for victoria park?

SQL:
SELECT MIN(crowd) FROM table_name_89 WHERE venue = "victoria park"
Schema:
CREATE TABLE table_73846 (
    "Season no." real,
    "Series no." real,
    "Title" text,
    "Directed by" text,
    "Written by" text,
    "Original air date" text,
    "Production code" text
)

Question: What episode number in the season is titled 'stray'?

SQL:
SELECT MAX("Season no.") FROM table_73846 WHERE "Title" = 'Stray'
Schema:
CREATE TABLE table_439 (
    "Overall Pick #" real,
    "AFL Team" text,
    "Player" text,
    "Position" text,
    "College" text
)

Question: What is the position for the pick number 17?

SQL:
SELECT "Position" FROM table_439 WHERE "Overall Pick #" = '17'
Schema:
CREATE TABLE table_15621965_18 (
    no INTEGER,
    position VARCHAR
)

Question: WHAT WAS THE NUMBER OF THE ONLY FORWARD-CENTER TO MAKE THE ROSTER?

SQL:
SELECT MIN(no) FROM table_15621965_18 WHERE position = "Forward-Center"
Schema:
CREATE TABLE table_77295 (
    "Year" real,
    "Team" text,
    "Co-Drivers" text,
    "Class" text,
    "Laps" real,
    "Pos." text,
    "Class Pos." text
)

Question: What was the class position of the team that was in the 4th position?

SQL:
SELECT "Class Pos." FROM table_77295 WHERE "Pos." = '4th'
Schema:
CREATE TABLE Product_Categories (
    production_type_code VARCHAR(15),
    product_type_description VARCHAR(80),
    vat_rating DECIMAL(19,4)
)

CREATE TABLE Accounts (
    account_id INTEGER,
    customer_id INTEGER,
    date_account_opened DATETIME,
    account_name VARCHAR(50),
    other_account_details VARCHAR(255)
)

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

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 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 Invoices (
    invoice_number INTEGER,
    order_id INTEGER,
    invoice_date DATETIME
)

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 Orders (
    order_id INTEGER,
    customer_id INTEGER,
    date_order_placed DATETIME,
    order_details VARCHAR(255)
)

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

Question: How many accounts for each customer? Show a bar chart that groups by customer's last name.

SQL:
SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
Schema:
CREATE TABLE table_2446333_2 (
    date VARCHAR,
    circuit VARCHAR
)

Question: Name the date for eastern creek raceway

SQL:
SELECT date FROM table_2446333_2 WHERE circuit = "Eastern Creek Raceway"
Schema:
CREATE TABLE table_26850 (
    "Governorate" text,
    "Kurdistan Democratic Party" real,
    "Patriotic Union of Kurdistan" real,
    "Total Kurdistan List" real,
    "Total Governorate Seats" real
)

Question: Name the least total kurdistan list

SQL:
SELECT MIN("Total Kurdistan List") FROM table_26850
Schema:
CREATE TABLE table_name_40 (
    week INTEGER,
    record VARCHAR
)

Question: What is the earliest week that shows a record of 8 5?

SQL:
SELECT MIN(week) FROM table_name_40 WHERE record = "8–5"
Schema:
CREATE TABLE market (
    Market_ID int,
    District text,
    Num_of_employees int,
    Num_of_shops real,
    Ranking int
)

CREATE TABLE phone (
    Name text,
    Phone_ID int,
    Memory_in_G int,
    Carrier text,
    Price real
)

CREATE TABLE phone_market (
    Market_ID int,
    Phone_ID text,
    Num_of_stock int
)

Question: Create a pie chart showing the number of carrier across carrier.

SQL:
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier
Schema:
CREATE TABLE table_45278 (
    "Series Number" real,
    "Number of Episodes" real,
    "Original Air Date" real,
    "DVD Region 2 release date" text,
    "DVD Region 1 release date" text
)

Question: How many series originally aired before 1999 with more than 7 episodes and a DVD Region 1 release date of 16 april 2013?

SQL:
SELECT COUNT("Series Number") FROM table_45278 WHERE "Original Air Date" < '1999' AND "Number of Episodes" > '7' AND "DVD Region 1 release date" = '16 april 2013'
Schema:
CREATE TABLE table_name_68 (
    away VARCHAR,
    round VARCHAR
)

Question: What away is there for the q3 round?

SQL:
SELECT away FROM table_name_68 WHERE round = "q3"
Schema:
CREATE TABLE table_203_652 (
    id number,
    "goal" number,
    "date" text,
    "venue" text,
    "opponent" text,
    "score" text,
    "result" text,
    "competition" text
)

Question: how many competitions had a score of 1-0 at most ?

SQL:
SELECT COUNT(*) FROM table_203_652 WHERE "score" = '1-0'
Schema:
CREATE TABLE table_66695 (
    "Rank" real,
    "Nation" text,
    "Gold" real,
    "Silver" real,
    "Bronze" real,
    "Total" real
)

Question: What is the total number of Silver for the Nation with more than 1 Bronze and a Rank less than 5?

SQL:
SELECT COUNT("Silver") FROM table_66695 WHERE "Bronze" > '1' AND "Rank" < '5'
Schema:
CREATE TABLE table_204_617 (
    id number,
    "date" text,
    "opponent#" text,
    "rank#" text,
    "site" text,
    "tv" text,
    "result" text,
    "attendance" number
)

Question: who was the sooners opponent after usc ?

SQL:
SELECT "opponent#" FROM table_204_617 WHERE "date" > (SELECT "date" FROM table_204_617 WHERE "opponent#" = 'usc') ORDER BY "date" LIMIT 1
Schema:
CREATE TABLE table_29902 (
    "Game" real,
    "Date" text,
    "Team" text,
    "Score" text,
    "High points" text,
    "High rebounds" text,
    "High assists" text,
    "Location Attendance" text,
    "Record" text
)

Question: How many times was the high rebounds by marcus camby (18)?

SQL:
SELECT COUNT("Date") FROM table_29902 WHERE "High rebounds" = 'Marcus Camby (18)'
Schema:
CREATE TABLE table_29469 (
    "Team" text,
    "Head coach" text,
    "Team captain" text,
    "Kit maker" text,
    "Shirt sponsor" text,
    "Past Season" text
)

Question: What sponsor has the head coach Samad Marfavi?

SQL:
SELECT "Shirt sponsor" FROM table_29469 WHERE "Head coach" = 'Samad Marfavi'
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 diagnoses (
    subject_id text,
    hadm_id text,
    icd9_code text,
    short_title text,
    long_title text
)

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

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

Question: what is date of birth and primary disease of subject name brian brock?

SQL:
SELECT demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = "Brian Brock"
Schema:
CREATE TABLE Students (
    student_id INTEGER,
    date_of_registration DATETIME,
    date_of_latest_logon DATETIME,
    login_name VARCHAR(40),
    password VARCHAR(10),
    personal_name VARCHAR(40),
    middle_name VARCHAR(40),
    family_name VARCHAR(40)
)

CREATE TABLE Student_Tests_Taken (
    registration_id INTEGER,
    date_test_taken DATETIME,
    test_result VARCHAR(255)
)

CREATE TABLE Course_Authors_and_Tutors (
    author_id INTEGER,
    author_tutor_ATB VARCHAR(3),
    login_name VARCHAR(40),
    password VARCHAR(40),
    personal_name VARCHAR(80),
    middle_name VARCHAR(80),
    family_name VARCHAR(80),
    gender_mf VARCHAR(1),
    address_line_1 VARCHAR(80)
)

CREATE TABLE Student_Course_Enrolment (
    registration_id INTEGER,
    student_id INTEGER,
    course_id INTEGER,
    date_of_enrolment DATETIME,
    date_of_completion DATETIME
)

CREATE TABLE Courses (
    course_id INTEGER,
    author_id INTEGER,
    subject_id INTEGER,
    course_name VARCHAR(120),
    course_description VARCHAR(255)
)

CREATE TABLE Subjects (
    subject_id INTEGER,
    subject_name VARCHAR(120)
)

Question: Find the number of the enrollment date for all the tests that have 'Pass' result, and could you order x axis from high to low order please?

SQL:
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC