VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE table_42825 (
    "Season" real,
    "Series" text,
    "Races" real,
    "Wins" real,
    "Poles" real,
    "F/Laps" real,
    "Podiums" real,
    "Points" text,
    "Position" text
)

Question: What is the average Season, when F/Laps is 1, and when Poles is less than 0?

SQL:
SELECT AVG("Season") FROM table_42825 WHERE "F/Laps" = '1' AND "Poles" < '0'
Schema:
CREATE TABLE party (
    Party_ID int,
    Minister text,
    Took_office text,
    Left_office text,
    Region_ID int,
    Party_name text
)

CREATE TABLE member (
    Member_ID int,
    Member_Name text,
    Party_ID text,
    In_office text
)

CREATE TABLE party_events (
    Event_ID int,
    Event_Name text,
    Party_ID int,
    Member_in_charge_ID int
)

CREATE TABLE region (
    Region_ID int,
    Region_name text,
    Date text,
    Label text,
    Format text,
    Catalogue text
)

Question: Show party names and the number of events for each party. Visualize by pie chart.

SQL:
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
Schema:
CREATE TABLE table_26930 (
    "Game" real,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Wildcats points" real,
    "Opponents" real,
    "Record" text
)

Question: List all results from the 3-3 scoring game.

SQL:
SELECT "Result" FROM table_26930 WHERE "Record" = '3-3'
Schema:
CREATE TABLE table_name_33 (
    laps VARCHAR,
    constructor VARCHAR,
    grid VARCHAR
)

Question: How many laps did BRM have with a grid of 11?

SQL:
SELECT COUNT(laps) FROM table_name_33 WHERE constructor = "brm" AND grid = 11
Schema:
CREATE TABLE table_name_64 (
    draw VARCHAR,
    performer VARCHAR,
    points VARCHAR
)

Question: What is the total number of draws for songs performed by Miranda with fewer than 48 points?

SQL:
SELECT COUNT(draw) FROM table_name_64 WHERE performer = "miranda" AND points < 48
Schema:
CREATE TABLE table_name_49 (
    date VARCHAR,
    games VARCHAR,
    time VARCHAR
)

Question: On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70?

SQL:
SELECT date FROM table_name_49 WHERE games = "2002 salt lake city" AND time = "3:57.70"
Schema:
CREATE TABLE table_204_211 (
    id number,
    "rank" number,
    "nation" text,
    "gold" number,
    "silver" number,
    "bronze" number,
    "total" number
)

Question: how many countries received silver medals ?

SQL:
SELECT COUNT("nation") FROM table_204_211 WHERE "silver" > 0
Schema:
CREATE TABLE table_name_43 (
    opponent VARCHAR,
    venue VARCHAR,
    date VARCHAR
)

Question: Who played against in venue a on 17 february 1900?

SQL:
SELECT opponent FROM table_name_43 WHERE venue = "a" AND date = "17 february 1900"
Schema:
CREATE TABLE table_203_364 (
    id number,
    "year" number,
    "driver" text,
    "nation of citizenship" text,
    "racing series" text,
    "type of vehicle" text
)

Question: does the united states have more nation of citzenship then united kingdom ?

SQL:
SELECT (SELECT COUNT(*) FROM table_203_364 WHERE "nation of citizenship" = 'united states') > (SELECT COUNT(*) FROM table_203_364 WHERE "nation of citizenship" = 'united kingdom')
Schema:
CREATE TABLE table_203_89 (
    id number,
    "#" number,
    "name\n(birth-death)" text,
    "took office" text,
    "left office" text,
    "monarch" text,
    "prime minister" text
)

Question: which governor served for the least number of years ?

SQL:
SELECT "name\n(birth-death)" FROM table_203_89 ORDER BY "left office" - "took office" LIMIT 1
Schema:
CREATE TABLE Statements (
    Statement_ID INTEGER,
    Statement_Details VARCHAR(255)
)

CREATE TABLE Documents (
    Document_ID INTEGER,
    Document_Type_Code CHAR(15),
    Project_ID INTEGER,
    Document_Date DATETIME,
    Document_Name VARCHAR(255),
    Document_Description VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Documents_with_Expenses (
    Document_ID INTEGER,
    Budget_Type_Code CHAR(15),
    Document_Details VARCHAR(255)
)

CREATE TABLE Projects (
    Project_ID INTEGER,
    Project_Details VARCHAR(255)
)

CREATE TABLE Ref_Document_Types (
    Document_Type_Code CHAR(15),
    Document_Type_Name VARCHAR(255),
    Document_Type_Description VARCHAR(255)
)

CREATE TABLE Accounts (
    Account_ID INTEGER,
    Statement_ID INTEGER,
    Account_Details VARCHAR(255)
)

CREATE TABLE Ref_Budget_Codes (
    Budget_Type_Code CHAR(15),
    Budget_Type_Description VARCHAR(255)
)

Question: How many documents for each document type description? Visualize by a pie chart.

SQL:
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description
Schema:
CREATE TABLE table_4886 (
    "Year" text,
    "Player" text,
    "Nationality" text,
    "Position" text,
    "Club" text
)

Question: What was the nationality of five-eighth player Darren Lockyer?

SQL:
SELECT "Nationality" FROM table_4886 WHERE "Player" = 'darren lockyer' AND "Position" = 'five-eighth'
Schema:
CREATE TABLE table_61731 (
    "Result" text,
    "Record" text,
    "Opponent" text,
    "Method" text,
    "Location" text
)

Question: Which location has a method of decision and Nikos Tsoukalas for an opponent?

SQL:
SELECT "Location" FROM table_61731 WHERE "Method" = 'decision' AND "Opponent" = 'nikos tsoukalas'
Schema:
CREATE TABLE table_1108394_47 (
    party VARCHAR,
    manhattan VARCHAR
)

Question: How many parties received 29.9% of the vote in Manhattan?

SQL:
SELECT COUNT(party) FROM table_1108394_47 WHERE manhattan = "29.9_percentage"
Schema:
CREATE TABLE paperfield (
    fieldid int,
    paperid int
)

CREATE TABLE paperkeyphrase (
    paperid int,
    keyphraseid int
)

CREATE TABLE journal (
    journalid int,
    journalname varchar
)

CREATE TABLE cite (
    citingpaperid int,
    citedpaperid int
)

CREATE TABLE dataset (
    datasetid int,
    datasetname varchar
)

CREATE TABLE writes (
    paperid int,
    authorid int
)

CREATE TABLE paperdataset (
    paperid int,
    datasetid int
)

CREATE TABLE keyphrase (
    keyphraseid int,
    keyphrasename varchar
)

CREATE TABLE author (
    authorid int,
    authorname varchar
)

CREATE TABLE venue (
    venueid int,
    venuename varchar
)

CREATE TABLE field (
    fieldid int
)

CREATE TABLE paper (
    paperid int,
    title varchar,
    venueid int,
    year int,
    numciting int,
    numcitedby int,
    journalid int
)

Question: Information Extraction publications

SQL:
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Information Extraction' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
Schema:
CREATE TABLE table_43502 (
    "Tournament" text,
    "1978" text,
    "1979" text,
    "1980" text,
    "1982" text,
    "1983" text,
    "1984" text,
    "1985" text,
    "1986" text,
    "1987" text,
    "1988" text,
    "1989" text,
    "1990" text,
    "1991" text,
    "1992" text,
    "Career SR" text
)

Question: What is 1987, when 1986 is '1R'?

SQL:
SELECT "1987" FROM table_43502 WHERE "1986" = '1r'
Schema:
CREATE TABLE table_67971 (
    "Event" text,
    "Time" text,
    "Nationality" text,
    "Date" text,
    "Meet" text,
    "Location" text
)

Question: What Event's Time is 4:01.00?

SQL:
SELECT "Event" FROM table_67971 WHERE "Time" = '4:01.00'
Schema:
CREATE TABLE table_name_98 (
    venue VARCHAR,
    sport VARCHAR
)

Question: Which venue held a basketball team?

SQL:
SELECT venue FROM table_name_98 WHERE sport = "basketball"
Schema:
CREATE TABLE Roles (
    role_code VARCHAR(15),
    role_description VARCHAR(80)
)

CREATE TABLE Document_Sections (
    section_id INTEGER,
    document_code VARCHAR(15),
    section_sequence INTEGER,
    section_code VARCHAR(20),
    section_title VARCHAR(80)
)

CREATE TABLE Document_Sections_Images (
    section_id INTEGER,
    image_id INTEGER
)

CREATE TABLE Documents (
    document_code VARCHAR(15),
    document_structure_code VARCHAR(15),
    document_type_code VARCHAR(15),
    access_count INTEGER,
    document_name VARCHAR(80)
)

CREATE TABLE Functional_Areas (
    functional_area_code VARCHAR(15),
    parent_functional_area_code VARCHAR(15),
    functional_area_description VARCHAR(80)
)

CREATE TABLE Document_Functional_Areas (
    document_code VARCHAR(15),
    functional_area_code VARCHAR(15)
)

CREATE TABLE Images (
    image_id INTEGER,
    image_alt_text VARCHAR(80),
    image_name VARCHAR(40),
    image_url VARCHAR(255)
)

CREATE TABLE Users (
    user_id INTEGER,
    role_code VARCHAR(15),
    user_name VARCHAR(40),
    user_login VARCHAR(40),
    password VARCHAR(40)
)

CREATE TABLE Document_Structures (
    document_structure_code VARCHAR(15),
    parent_document_structure_code VARCHAR(15),
    document_structure_description VARCHAR(80)
)

Question: Find the number of users in each role. Plot them as bar chart.

SQL:
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
Schema:
CREATE TABLE table_name_59 (
    location VARCHAR,
    unit VARCHAR
)

Question: What country is the Jiufotang Formation located in?

SQL:
SELECT location FROM table_name_59 WHERE unit = "jiufotang formation"
Schema:
CREATE TABLE table_59553 (
    "Rider" text,
    "Bike" text,
    "Laps" real,
    "Time" text,
    "Grid" real
)

Question: What is the sum of Grid, when Time is '+16.687'?

SQL:
SELECT SUM("Grid") FROM table_59553 WHERE "Time" = '+16.687'
Schema:
CREATE TABLE table_66006 (
    "Rank" text,
    "Nation" text,
    "Gold" real,
    "Silver" real,
    "Bronze" real,
    "Total" real
)

Question: What is the highest number of bronze medals of west germany, which has more than 0 golds?

SQL:
SELECT MAX("Bronze") FROM table_66006 WHERE "Nation" = 'west germany' AND "Gold" > '0'
Schema:
CREATE TABLE table_204_349 (
    id number,
    "year" number,
    "conservative\ncouncillors" number,
    "labour\ncouncillors" number,
    "independent\ncouncillors" number,
    "liberal\ncouncillors" number
)

Question: why years have no liberal councillors serving ?

SQL:
SELECT "year" FROM table_204_349 WHERE "liberal\ncouncillors" = 0
Schema:
CREATE TABLE table_67629 (
    "Club" text,
    "Sport" text,
    "League" text,
    "Venue" text,
    "Championships (Years)" text
)

Question: Which club has a League of american basketball association, and a Venue of tba?

SQL:
SELECT "Club" FROM table_67629 WHERE "League" = 'american basketball association' AND "Venue" = 'tba'
Schema:
CREATE TABLE table_72369 (
    "District" text,
    "Incumbent" text,
    "Party" text,
    "First elected" real,
    "Status" text,
    "Opponent" text
)

Question: What year was incumbent jim mcdermott first elected?

SQL:
SELECT MIN("First elected") FROM table_72369 WHERE "Incumbent" = 'Jim McDermott'
Schema:
CREATE TABLE table_23817012_6 (
    gp_gs VARCHAR,
    ft_pct VARCHAR
)

Question: in the ft pct .667 what is the number of gp-gs

SQL:
SELECT COUNT(gp_gs) FROM table_23817012_6 WHERE ft_pct = ".667"
Schema:
CREATE TABLE table_47699 (
    "Week" real,
    "Date" text,
    "Opponent" text,
    "Result" text,
    "Attendance" real
)

Question: In what Weeks is the game against the Tampa Bay Buccaneers with less than 44,506 in Attendance?

SQL:
SELECT SUM("Week") FROM table_47699 WHERE "Opponent" = 'tampa bay buccaneers' AND "Attendance" < '44,506'
Schema:
CREATE TABLE Apartments (
    apt_id INTEGER,
    building_id INTEGER,
    apt_type_code CHAR(15),
    apt_number CHAR(10),
    bathroom_count INTEGER,
    bedroom_count INTEGER,
    room_count CHAR(5)
)

CREATE TABLE Guests (
    guest_id INTEGER,
    gender_code CHAR(1),
    guest_first_name VARCHAR(80),
    guest_last_name VARCHAR(80),
    date_of_birth DATETIME
)

CREATE TABLE Apartment_Facilities (
    apt_id INTEGER,
    facility_code CHAR(15)
)

CREATE TABLE Apartment_Bookings (
    apt_booking_id INTEGER,
    apt_id INTEGER,
    guest_id INTEGER,
    booking_status_code CHAR(15),
    booking_start_date DATETIME,
    booking_end_date DATETIME
)

CREATE TABLE View_Unit_Status (
    apt_id INTEGER,
    apt_booking_id INTEGER,
    status_date DATETIME,
    available_yn BIT
)

CREATE TABLE Apartment_Buildings (
    building_id INTEGER,
    building_short_name CHAR(15),
    building_full_name VARCHAR(80),
    building_description VARCHAR(255),
    building_address VARCHAR(255),
    building_manager VARCHAR(50),
    building_phone VARCHAR(80)
)

Question: Show each gender code and the corresponding count of guests sorted by the count in descending order by a pie chart.

SQL:
SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Schema:
CREATE TABLE table_name_15 (
    laps INTEGER,
    grid VARCHAR,
    driver VARCHAR
)

Question: How many laps did Ricardo Zonta drive with a grid less than 14?

SQL:
SELECT SUM(laps) FROM table_name_15 WHERE grid < 14 AND driver = "ricardo zonta"
Schema:
CREATE TABLE table_66547 (
    "Manufacturer" text,
    "Transmission" text,
    "Engine Capacity" real,
    "Fuel Type" text,
    "L/100km Urban (Cold)" real,
    "L/100km Extra-Urban" real,
    "L/100km Combined" real,
    "mpg-UK Urban (Cold)" real,
    "mpg-UK Extra-Urban" real,
    "mpg-UK Combined" real,
    "mpg-US Urban" real,
    "mpg-US Extra-Urban" real,
    "mpg-US Combined" real,
    "CO 2 g/km" real,
    "Green Rating" text
)

Question: What's the average L/km combines when the L/100km Urban is 13.9, the mpg-UK combined is more than 28.5 and the mpg-UK extra urban is less than 38.7?

SQL:
SELECT AVG("L/100km Combined") FROM table_66547 WHERE "L/100km Urban (Cold)" = '13.9' AND "mpg-UK Combined" > '28.5' AND "mpg-UK Extra-Urban" < '38.7'
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 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
)

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

Question: provide the number of patients whose marital status is widowed and procedure long title is percutaneous (endoscopic) jejunostomy [pej]?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]"
Schema:
CREATE TABLE table_14038363_1 (
    height VARCHAR,
    player VARCHAR
)

Question: How tall is Maksim Botin?

SQL:
SELECT height FROM table_14038363_1 WHERE player = "Maksim Botin"
Schema:
CREATE TABLE table_name_62 (
    shoots VARCHAR,
    player VARCHAR
)

Question: What shows for shoots for craig peacock a?

SQL:
SELECT shoots FROM table_name_62 WHERE player = "craig peacock a"
Schema:
CREATE TABLE table_32178 (
    "Date" text,
    "Result" text,
    "Score" text,
    "Stadium" text,
    "City" text,
    "Crowd" real
)

Question: What was the date of game with a score of 42-6?

SQL:
SELECT "Date" FROM table_32178 WHERE "Score" = '42-6'
Schema:
CREATE TABLE table_name_62 (
    social_sec_leeds VARCHAR,
    media_officer VARCHAR,
    treasurer VARCHAR
)

Question: What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson?

SQL:
SELECT social_sec_leeds FROM table_name_62 WHERE media_officer = "jason james" AND treasurer = "james davidson"
Schema:
CREATE TABLE table_28803803_1 (
    date VARCHAR,
    name VARCHAR
)

Question: What are the dates that Falling Angel aired?

SQL:
SELECT date FROM table_28803803_1 WHERE name = "Falling Angel"
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 prescriptions (
    subject_id text,
    hadm_id text,
    icustay_id text,
    drug_type text,
    drug text,
    formulary_drug_cd text,
    route text,
    drug_dose text
)

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

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

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

Question: give me the number of patients whose year of birth is less than 2182 and procedure short title is coronar arteriogr-1 cath?

SQL:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath"
Schema:
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 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)
)

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

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

Question: How many completion students in each day? Return a line chart grouping by date of completion, and order by the X-axis in descending please.

SQL:
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion DESC
Schema:
CREATE TABLE claims (
    Effective_Date VARCHAR,
    claim_id VARCHAR
)

CREATE TABLE settlements (
    claim_id VARCHAR,
    settlement_amount INTEGER
)

Question: What is the effective date of the claim that has the largest amount of total settlement?

SQL:
SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1
Schema:
CREATE TABLE table_13089 (
    "Municipality" text,
    "Inhabitants" real,
    "Mayor" text,
    "Party" text,
    "Election" real
)

Question: Which inhabitants have 2009 as the election, with cremona as the municipality?

SQL:
SELECT "Inhabitants" FROM table_13089 WHERE "Election" = '2009' AND "Municipality" = 'cremona'
Schema:
CREATE TABLE table_name_94 (
    round VARCHAR,
    player VARCHAR
)

Question: What round did Matt Clark play?

SQL:
SELECT round FROM table_name_94 WHERE player = "matt clark"
Schema:
CREATE TABLE Apartment_Facilities (
    apt_id INTEGER,
    facility_code CHAR(15)
)

CREATE TABLE Apartments (
    apt_id INTEGER,
    building_id INTEGER,
    apt_type_code CHAR(15),
    apt_number CHAR(10),
    bathroom_count INTEGER,
    bedroom_count INTEGER,
    room_count CHAR(5)
)

CREATE TABLE Guests (
    guest_id INTEGER,
    gender_code CHAR(1),
    guest_first_name VARCHAR(80),
    guest_last_name VARCHAR(80),
    date_of_birth DATETIME
)

CREATE TABLE Apartment_Buildings (
    building_id INTEGER,
    building_short_name CHAR(15),
    building_full_name VARCHAR(80),
    building_description VARCHAR(255),
    building_address VARCHAR(255),
    building_manager VARCHAR(50),
    building_phone VARCHAR(80)
)

CREATE TABLE Apartment_Bookings (
    apt_booking_id INTEGER,
    apt_id INTEGER,
    guest_id INTEGER,
    booking_status_code CHAR(15),
    booking_start_date DATETIME,
    booking_end_date DATETIME
)

CREATE TABLE View_Unit_Status (
    apt_id INTEGER,
    apt_booking_id INTEGER,
    status_date DATETIME,
    available_yn BIT
)

Question: Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart, display by the Y-axis from high to low.

SQL:
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
Schema:
CREATE TABLE table_19808 (
    "#" real,
    "Episode" text,
    "Writer" text,
    "Director" text,
    "Original air date" text,
    "Viewing figure" text
)

Question: Which numerical entry corresponds to 'Episode 9'?

SQL:
SELECT COUNT("#") FROM table_19808 WHERE "Episode" = 'Episode 9'
Schema:
CREATE TABLE party_events (
    event_id number,
    event_name text,
    party_id number,
    member_in_charge_id number
)

CREATE TABLE party (
    party_id number,
    minister text,
    took_office text,
    left_office text,
    region_id number,
    party_name text
)

CREATE TABLE region (
    region_id number,
    region_name text,
    date text,
    label text,
    format text,
    catalogue text
)

CREATE TABLE member (
    member_id number,
    member_name text,
    party_id text,
    in_office text
)

Question: Show the minister who took office after 1961 or before 1959.

SQL:
SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
Schema:
CREATE TABLE table_204_334 (
    id number,
    "opposition" text,
    "matches" number,
    "won" number,
    "drawn" number,
    "lost" number,
    "for" number,
    "against" number,
    "win%" text
)

Question: how many teams did the comets win 2 matches against ?

SQL:
SELECT COUNT("opposition") FROM table_204_334 WHERE "won" = 2
Schema:
CREATE TABLE table_name_62 (
    city___state VARCHAR,
    series VARCHAR
)

Question: In what City/State did the ATCC Round 4 series take place?

SQL:
SELECT city___state FROM table_name_62 WHERE series = "atcc round 4"