VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE Customer_Address_History (
    customer_id INTEGER,
    address_id INTEGER,
    date_from DATETIME,
    date_to DATETIME
)

CREATE TABLE Order_Items (
    order_item_id INTEGER,
    order_id INTEGER,
    product_id INTEGER,
    order_quantity VARCHAR(80)
)

CREATE TABLE Contacts (
    contact_id INTEGER,
    customer_id INTEGER,
    gender VARCHAR(1),
    first_name VARCHAR(80),
    last_name VARCHAR(50),
    contact_phone VARCHAR(80)
)

CREATE TABLE Addresses (
    address_id INTEGER,
    line_1_number_building VARCHAR(80),
    city VARCHAR(50),
    zip_postcode VARCHAR(20),
    state_province_county VARCHAR(50),
    country VARCHAR(50)
)

CREATE TABLE Customers (
    customer_id INTEGER,
    payment_method_code VARCHAR(15),
    customer_number VARCHAR(20),
    customer_name VARCHAR(80),
    customer_address VARCHAR(255),
    customer_phone VARCHAR(80),
    customer_email VARCHAR(80)
)

CREATE TABLE Customer_Orders (
    order_id INTEGER,
    customer_id INTEGER,
    order_date DATETIME,
    order_status_code VARCHAR(15)
)

CREATE TABLE Products (
    product_id INTEGER,
    product_type_code VARCHAR(15),
    product_name VARCHAR(80),
    product_price DOUBLE
)

Question: Show the product name and total order quantity for each product. Show bar chart.

SQL:
SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name
Schema:
CREATE TABLE table_60828 (
    "Position" real,
    "Team" text,
    "Played" real,
    "Drawn" real,
    "Lost" real,
    "Goals For" real,
    "Goals Against" real,
    "Goal Difference" text,
    "Points 1" real
)

Question: How much Played has a Position of 7, and a Drawn smaller than 7?

SQL:
SELECT SUM("Played") FROM table_60828 WHERE "Position" = '7' AND "Drawn" < '7'
Schema:
CREATE TABLE d_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label 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 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 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 outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value number
)

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

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

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 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 d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

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 labevents (
    row_id number,
    subject_id number,
    hadm_id number,
    itemid number,
    charttime time,
    valuenum number,
    valueuom 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
)

Question: what are the ways to consume guaifenesin?

SQL:
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin'
Schema:
CREATE TABLE table_name_67 (
    gran_hamada VARCHAR,
    block_a VARCHAR
)

Question: Which Gran Hamada has a Block A of tatsuhito takaiwa?

SQL:
SELECT gran_hamada FROM table_name_67 WHERE block_a = "tatsuhito takaiwa"
Schema:
CREATE TABLE domain_conference (
    cid int,
    did int
)

CREATE TABLE cite (
    cited int,
    citing int
)

CREATE TABLE domain_keyword (
    did int,
    kid int
)

CREATE TABLE domain_publication (
    did int,
    pid int
)

CREATE TABLE domain_author (
    aid int,
    did int
)

CREATE TABLE domain (
    did int,
    name varchar
)

CREATE TABLE author (
    aid int,
    homepage varchar,
    name varchar,
    oid int
)

CREATE TABLE organization (
    continent varchar,
    homepage varchar,
    name varchar,
    oid int
)

CREATE TABLE domain_journal (
    did int,
    jid int
)

CREATE TABLE publication (
    abstract varchar,
    cid int,
    citation_num int,
    jid int,
    pid int,
    reference_num int,
    title varchar,
    year int
)

CREATE TABLE writes (
    aid int,
    pid int
)

CREATE TABLE conference (
    cid int,
    homepage varchar,
    name varchar
)

CREATE TABLE publication_keyword (
    kid int,
    pid int
)

CREATE TABLE journal (
    homepage varchar,
    jid int,
    name varchar
)

CREATE TABLE keyword (
    keyword varchar,
    kid int
)

Question: return me the number of papers in VLDB conference in ' University of Michigan ' .

SQL:
SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid
Schema:
CREATE TABLE route (
    train_id int,
    station_id int
)

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

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

CREATE TABLE station (
    id int,
    network_name text,
    services text,
    local_authority text
)

Question: A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order?

SQL:
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC
Schema:
CREATE TABLE table_61462 (
    "Player" text,
    "Country" text,
    "Year(s) won" text,
    "Total" real,
    "To par" text,
    "Finish" text
)

Question: Where did the player who won in 1991 finish?

SQL:
SELECT "Finish" FROM table_61462 WHERE "Year(s) won" = '1991'
Schema:
CREATE TABLE table_name_31 (
    weight VARCHAR,
    number VARCHAR
)

Question: How much does number 26 weigh?

SQL:
SELECT weight FROM table_name_31 WHERE number = "26"
Schema:
CREATE TABLE table_41853 (
    "Team" text,
    "Match" real,
    "Points" real,
    "Draw" real,
    "Lost" real
)

Question: Which team has 10 losses?

SQL:
SELECT "Team" FROM table_41853 WHERE "Lost" = '10'
Schema:
CREATE TABLE table_48303 (
    "Rank" real,
    "Company" text,
    "Headquarters" text,
    "Industry" text,
    "Sales (billion $)" real,
    "Profits (billion $)" real,
    "Assets (billion $)" real,
    "Market Value (billion $)" real
)

Question: What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets?

SQL:
SELECT MAX("Market Value (billion $)") FROM table_48303 WHERE "Profits (billion $)" = '20.96' AND "Assets (billion $)" > '166.99'
Schema:
CREATE TABLE microlab (
    microlabid number,
    patientunitstayid number,
    culturesite text,
    organism text,
    culturetakentime time
)

CREATE TABLE lab (
    labid number,
    patientunitstayid number,
    labname text,
    labresult number,
    labresulttime 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
)

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 intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime 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 cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

Question: when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit.

SQL:
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.systemicdiastolic IS NULL ORDER BY vitalperiodic.systemicdiastolic, vitalperiodic.observationtime DESC LIMIT 1
Schema:
CREATE TABLE table_25595209_1 (
    loa__metres_ VARCHAR,
    yacht VARCHAR
)

Question: What is the LOA of Brindabella?

SQL:
SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = "Brindabella"
Schema:
CREATE TABLE d_labitems (
    row_id number,
    itemid number,
    label text
)

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

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

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 d_items (
    row_id number,
    itemid number,
    label text,
    linksto text
)

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

CREATE TABLE outputevents (
    row_id number,
    subject_id number,
    hadm_id number,
    icustay_id number,
    charttime time,
    itemid number,
    value 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 cost (
    row_id number,
    subject_id number,
    hadm_id number,
    event_type text,
    event_id number,
    chargetime time,
    cost number
)

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

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_icd_procedures (
    row_id number,
    icd9_code text,
    short_title text,
    long_title text
)

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

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 d_icd_diagnoses (
    row_id number,
    icd9_code text,
    short_title text,
    long_title 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 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
)

Question: what are the top three most common specimen tests performed since 2 years ago?

SQL:
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
Schema:
CREATE TABLE table_29292 (
    "Season" text,
    "Coach" text,
    "Conf. Record" text,
    "Overall" text,
    "Standings" text,
    "Postseason" text
)

Question: In what season was the conference record for the Pandas 15-1-1?

SQL:
SELECT "Season" FROM table_29292 WHERE "Conf. Record" = '15-1-1'
Schema:
CREATE TABLE table_60842 (
    "Constituency number" real,
    "Name" text,
    "Reserved for ( SC / ST /None)" text,
    "District" text,
    "Electorates (2011)" real
)

Question: What district has abhayapuri south as the name?

SQL:
SELECT "District" FROM table_60842 WHERE "Name" = 'abhayapuri south'
Schema:
CREATE TABLE table_7771 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" text
)

Question: What was Tom Kite's to par?

SQL:
SELECT "To par" FROM table_7771 WHERE "Player" = 'tom kite'
Schema:
CREATE TABLE table_name_94 (
    rank INTEGER,
    country VARCHAR,
    total VARCHAR
)

Question: Which Rank is the Country of soviet union with a Total smaller than 19?

SQL:
SELECT MIN(rank) FROM table_name_94 WHERE country = "soviet union" AND total < 19
Schema:
CREATE TABLE table_25277262_2 (
    directed_by VARCHAR,
    no_in_season VARCHAR
)

Question: How many people directed episode 3 in the season?

SQL:
SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3
Schema:
CREATE TABLE table_dev_20 (
    "id" int,
    "anemia" bool,
    "gender" string,
    "systolic_blood_pressure_sbp" int,
    "hemoglobin_a1c_hba1c" float,
    "platelets" int,
    "dyslipidemia" bool,
    "renal_disease" bool,
    "creatinine_clearance_cl" float,
    "neutropenia" int,
    "estimated_glomerular_filtration_rate_egfr" int,
    "thrombocytopenia" float,
    "diastolic_blood_pressure_dbp" int,
    "lymphopenia" int,
    "ldl" int,
    "serum_creatinine" float,
    "kidney_disease" bool,
    "triglyceride_tg" float,
    "uncontrolled_blood_pressure" bool,
    "NOUSE" float
)

Question: baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 / l ) , neutropenia ( < 1500 / l ) , or thrombocytopenia ( platelets < 100000 / l ) .

SQL:
SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000
Schema:
CREATE TABLE table_203_408 (
    id number,
    "rd." number,
    "grand prix" text,
    "date" text,
    "location" text,
    "pole position" text,
    "fastest lap" text,
    "winning driver" text,
    "constructor" text,
    "report" text
)

Question: who was the winning driver after nigel mansell ?

SQL:
SELECT "winning driver" FROM table_203_408 WHERE "rd." > (SELECT "rd." FROM table_203_408 WHERE "winning driver" = 'nigel mansell') ORDER BY "rd." LIMIT 1
Schema:
CREATE TABLE table_name_11 (
    type VARCHAR,
    model VARCHAR
)

Question: What type of car has the model 6cm?

SQL:
SELECT type FROM table_name_11 WHERE model = "6cm"
Schema:
CREATE TABLE table_name_98 (
    score VARCHAR,
    country VARCHAR
)

Question: What is the player from England's score?

SQL:
SELECT score FROM table_name_98 WHERE country = "england"
Schema:
CREATE TABLE table_2140071_8 (
    episode INTEGER,
    premier_date VARCHAR
)

Question: Which Maximum episode premiered March 8, 2008?

SQL:
SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = "March 8, 2008"
Schema:
CREATE TABLE table_name_32 (
    acceleration_0_100km_h VARCHAR,
    name VARCHAR
)

Question: What is the acceleration 1-100km/h when the name is 1.5 dci?

SQL:
SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = "1.5 dci"
Schema:
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 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
)

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

Question: what is average age of patients whose marital status is married and discharge location is home health care?

SQL:
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "HOME HEALTH CARE"

Question: give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.days_stay > "4"
Schema:
CREATE TABLE table_name_5 (
    away VARCHAR,
    date VARCHAR
)

Question: Which away game was played on 2008-07-18?

SQL:
SELECT away FROM table_name_5 WHERE date = "2008-07-18"
Schema:
CREATE TABLE table_17319931_1 (
    team VARCHAR,
    driver VARCHAR
)

Question: What is the team whose driver Jeff Simmons?

SQL:
SELECT team FROM table_17319931_1 WHERE driver = "Jeff Simmons"
Schema:
CREATE TABLE table_20986710_1 (
    score_in_final VARCHAR,
    runner_up VARCHAR
)

Question: What was the final score when tracy austin was runner up?

SQL:
SELECT score_in_final FROM table_20986710_1 WHERE runner_up = "Tracy Austin"
Schema:
CREATE TABLE table_name_61 (
    nba_draft VARCHAR,
    player VARCHAR
)

Question: Which NBA Draft had Labradford Smith?

SQL:
SELECT nba_draft FROM table_name_61 WHERE player = "labradford smith"
Schema:
CREATE TABLE table_24015 (
    "Player" text,
    "Played" real,
    "Legs Won" real,
    "Legs Lost" real,
    "LWAT" real,
    "100+" real,
    "140+" real,
    "180s" real,
    "High Checkout" real,
    "3-dart Average" text
)

Question: Which player has a 92.58 3-dart average?

SQL:
SELECT "Player" FROM table_24015 WHERE "3-dart Average" = '92.58'
Schema:
CREATE TABLE table_name_95 (
    conference_joined VARCHAR,
    previous_conference VARCHAR,
    mascot VARCHAR
)

Question: Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers?

SQL:
SELECT conference_joined FROM table_name_95 WHERE previous_conference = "northwestern" AND mascot = "oilers"
Schema:
CREATE TABLE resultsdata15 (
    sample_pk number,
    commod text,
    commtype text,
    lab text,
    pestcode text,
    testclass text,
    concen number,
    lod number,
    conunit text,
    confmethod text,
    confmethod2 text,
    annotate text,
    quantitate text,
    mean text,
    extract text,
    determin text
)

CREATE TABLE sampledata15 (
    sample_pk number,
    state text,
    year text,
    month text,
    day text,
    site text,
    commod text,
    source_id text,
    variety text,
    origin text,
    country text,
    disttype text,
    commtype text,
    claim text,
    quantity number,
    growst text,
    packst text,
    distst text
)

Question: If sample 6480 is imported, which country is it originally from?

SQL:
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2
Schema:
CREATE TABLE schedule (
    Cinema_ID int,
    Film_ID int,
    Date text,
    Show_times_per_day int,
    Price float
)

CREATE TABLE cinema (
    Cinema_ID int,
    Name text,
    Openning_year int,
    Capacity int,
    Location text
)

CREATE TABLE film (
    Film_ID int,
    Rank_in_series int,
    Number_in_season int,
    Title text,
    Directed_by text,
    Original_air_date text,
    Production_code text
)

Question: Give me the title and highest price for each film Show bar chart, list from low to high by the Y.

SQL:
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)
Schema:
CREATE TABLE table_17204 (
    "Round" real,
    "Overall" text,
    "Player" text,
    "Position" text,
    "Nationality" text,
    "Club team" text
)

Question: What club team did JArrod Maidens play for?

SQL:
SELECT "Club team" FROM table_17204 WHERE "Player" = 'Jarrod Maidens'
Schema:
CREATE TABLE table_15829930_5 (
    matches INTEGER,
    year VARCHAR
)

Question: Name the least matches for year 2008

SQL:
SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008
Schema:
CREATE TABLE table_15441 (
    "Riding" text,
    "Province" text,
    "Candidate" text,
    "Votes" real,
    "Placement" text
)

Question: What is the Placement when the Candidate is Jean-Patrick Berthiaume?

SQL:
SELECT "Placement" FROM table_15441 WHERE "Candidate" = 'jean-patrick berthiaume'
Schema:
CREATE TABLE table_777 (
    "District" text,
    "Incumbent" text,
    "Party" text,
    "First elected" real,
    "Result" text,
    "Candidates" text
)

Question: How many winners were there in the race of 1922

SQL:
SELECT COUNT("Incumbent") FROM table_777 WHERE "First elected" = '1922'
Schema:
CREATE TABLE table_15431251_1 (
    title VARCHAR,
    no_in_season VARCHAR
)

Question: What is the title for episode number 7 in the season?

SQL:
SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7
Schema:
CREATE TABLE table_72981 (
    "Outcome" text,
    "Edition" real,
    "Round" text,
    "Opponent Team" text,
    "Surface" text,
    "Opponent" text,
    "Score" text
)

Question: What was the score when the opponent was Dominika Cibulkov ?

SQL:
SELECT "Score" FROM table_72981 WHERE "Opponent" = 'Dominika Cibulková'