VishalCh/book-train huggingface dataset:
Schema:
CREATE TABLE diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

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

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

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

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

CREATE TABLE intakeoutput (
    intakeoutputid number,
    patientunitstayid number,
    cellpath text,
    celllabel text,
    cellvaluenumeric number,
    intakeoutputtime 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
)

Question: when did patient 021-221706 come to the hospital for the last time until 4 years ago via an floor?

SQL:
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '021-221706' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
Schema:
CREATE TABLE table_22993636_2 (
    overall_record VARCHAR,
    road_record VARCHAR
)

Question: What's the overall record of the team with 4-3 road record?

SQL:
SELECT overall_record FROM table_22993636_2 WHERE road_record = "4-3"
Schema:
CREATE TABLE table_54042 (
    "Driver" text,
    "Entrant" text,
    "Constructor" text,
    "Chassis" text,
    "Engine" text,
    "Tyre" text
)

Question: who is the constructor when the tyre is d, the engine is talbot 23cv 4.5 l6, the chassis is talbot-lago t26c and the entrant is ecurie belge?

SQL:
SELECT "Constructor" FROM table_54042 WHERE "Tyre" = 'd' AND "Engine" = 'talbot 23cv 4.5 l6' AND "Chassis" = 'talbot-lago t26c' AND "Entrant" = 'ecurie belge'
Schema:
CREATE TABLE table_47828 (
    "Place" text,
    "Player" text,
    "Country" text,
    "Score" text,
    "To par" real
)

Question: What is Place, when To Par is '5', and when Score is '72-73=145'?

SQL:
SELECT "Place" FROM table_47828 WHERE "To par" = '5' AND "Score" = '72-73=145'
Schema:
CREATE TABLE table_67462 (
    "Minister" text,
    "Party" text,
    "Governments" text,
    "Term start" text,
    "Term end" text
)

Question: When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party?

SQL:
SELECT "Term end" FROM table_67462 WHERE "Party" = 'national religious party' AND "Minister" = 'shlomo-yisrael ben-meir'
Schema:
CREATE TABLE editor (
    Name VARCHAR,
    Age VARCHAR
)

Question: List the names of editors in ascending order of age.

SQL:
SELECT Name FROM editor ORDER BY Age
Schema:
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 diagnosis (
    diagnosisid number,
    patientunitstayid number,
    diagnosisname text,
    diagnosistime time,
    icd9code text
)

CREATE TABLE treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

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

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

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

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

Question: what was the last time that patient 009-13409 was prescribed for a drug until 48 months ago?

SQL:
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-48 month') ORDER BY medication.drugstarttime DESC LIMIT 1
Schema:
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 treatment (
    treatmentid number,
    patientunitstayid number,
    treatmentname text,
    treatmenttime time
)

CREATE TABLE vitalperiodic (
    vitalperiodicid number,
    patientunitstayid number,
    temperature number,
    sao2 number,
    heartrate number,
    respiration number,
    systemicsystolic number,
    systemicdiastolic number,
    systemicmean number,
    observationtime time
)

CREATE TABLE 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 cost (
    costid number,
    uniquepid text,
    patienthealthsystemstayid number,
    eventtype text,
    eventid number,
    chargetime time,
    cost number
)

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

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

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

Question: what's the minimum cost of a hospital that includes a cortisol lab test until 4 years ago?

SQL:
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.patienthealthsystemstayid) AS t1
Schema:
CREATE TABLE Ref_Budget_Codes (
    Budget_Type_Code CHAR(15),
    Budget_Type_Description VARCHAR(255)
)

CREATE TABLE Projects (
    Project_ID INTEGER,
    Project_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 Statements (
    Statement_ID INTEGER,
    Statement_Details VARCHAR(255)
)

CREATE TABLE Accounts (
    Account_ID INTEGER,
    Statement_ID INTEGER,
    Account_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 Documents_with_Expenses (
    Document_ID INTEGER,
    Budget_Type_Code CHAR(15),
    Document_Details VARCHAR(255)
)

Question: What are the different budget type codes, and how many documents are there for each. Show a pie chart.

SQL:
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code
Schema:
CREATE TABLE table_31969 (
    "Heat Rank" real,
    "Lane" real,
    "Swimmer" text,
    "Country" text,
    "Time" real,
    "Overall Rank" text
)

Question: In heat rank 7, what is the sum of lanes?

SQL:
SELECT SUM("Lane") FROM table_31969 WHERE "Heat Rank" = '7'
Schema:
CREATE TABLE table_51037 (
    "Date" text,
    "Series" text,
    "Circuit" text,
    "City / State" text,
    "Winner" text,
    "Team" text
)

Question: What is the city/state of the circuit where Russell Ingall Larry Perkins was the winner?

SQL:
SELECT "City / State" FROM table_51037 WHERE "Winner" = 'russell ingall larry perkins'
Schema:
CREATE TABLE table_143352_1 (
    construction_started INTEGER,
    net_mwe VARCHAR
)

Question: When did construction start on the Power station with a net MWE of 1190

SQL:
SELECT MIN(construction_started) FROM table_143352_1 WHERE net_mwe = 1190
Schema:
CREATE TABLE table_26866233_1 (
    director VARCHAR,
    series__number VARCHAR
)

Question: Who are the directors of the episode in series # 54?

SQL:
SELECT director FROM table_26866233_1 WHERE series__number = 54
Schema:
CREATE TABLE table_71546 (
    "Date" text,
    "Winner" text,
    "Score" text,
    "Location" text,
    "Series" text
)

Question: What is the Location, when the Score is 38-29?

SQL:
SELECT "Location" FROM table_71546 WHERE "Score" = '38-29'
Schema:
CREATE TABLE table_name_79 (
    week VARCHAR,
    host_team VARCHAR
)

Question: Which week did the Baltimore Ravens play at home ?

SQL:
SELECT week FROM table_name_79 WHERE host_team = "baltimore ravens"
Schema:
CREATE TABLE table_203_756 (
    id number,
    "year" number,
    "title" text,
    "role" text,
    "network" text,
    "notes" text
)

Question: count of unique roles

SQL:
SELECT COUNT("role") FROM table_203_756
Schema:
CREATE TABLE table_name_62 (
    record VARCHAR,
    attendance VARCHAR
)

Question: Which Record has an Attendance of 24,597?

SQL:
SELECT record FROM table_name_62 WHERE attendance = "24,597"
Schema:
CREATE TABLE table_62596 (
    "Player" text,
    "Country" text,
    "Year(s) won" text,
    "Total" real,
    "To par" text,
    "Finish" text
)

Question: Who had a finish of t15?

SQL:
SELECT "Player" FROM table_62596 WHERE "Finish" = 't15'
Schema:
CREATE TABLE table_62642 (
    "Region" text,
    "Date" text,
    "Label" text,
    "Format" text,
    "Catalog number" text,
    "Lyrics" text
)

Question: In what language is the Lyrics of the release on August 10, 2005 with Catalog number of TOCP-66427?

SQL:
SELECT "Lyrics" FROM table_62642 WHERE "Date" = 'august 10, 2005' AND "Catalog number" = 'tocp-66427'
Schema:
CREATE TABLE Ref_Document_Types (
    Document_Type_Code CHAR(15),
    Document_Type_Name VARCHAR(255),
    Document_Type_Description VARCHAR(255)
)

CREATE TABLE All_Documents (
    Document_ID INTEGER,
    Date_Stored DATETIME,
    Document_Type_Code CHAR(15),
    Document_Name CHAR(255),
    Document_Description CHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Roles (
    Role_Code CHAR(15),
    Role_Name VARCHAR(255),
    Role_Description VARCHAR(255)
)

CREATE TABLE Ref_Locations (
    Location_Code CHAR(15),
    Location_Name VARCHAR(255),
    Location_Description VARCHAR(255)
)

CREATE TABLE Ref_Calendar (
    Calendar_Date DATETIME,
    Day_Number INTEGER
)

CREATE TABLE Documents_to_be_Destroyed (
    Document_ID INTEGER,
    Destruction_Authorised_by_Employee_ID INTEGER,
    Destroyed_by_Employee_ID INTEGER,
    Planned_Destruction_Date DATETIME,
    Actual_Destruction_Date DATETIME,
    Other_Details VARCHAR(255)
)

CREATE TABLE Document_Locations (
    Document_ID INTEGER,
    Location_Code CHAR(15),
    Date_in_Location_From DATETIME,
    Date_in_Locaton_To DATETIME
)

CREATE TABLE Employees (
    Employee_ID INTEGER,
    Role_Code CHAR(15),
    Employee_Name VARCHAR(255),
    Gender_MFU CHAR(1),
    Date_of_Birth DATETIME,
    Other_Details VARCHAR(255)
)

Question: What are all the calendar dates? Show a bar chart binning calendar date by weekday.

SQL:
SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar
Schema:
CREATE TABLE Photos (
    Photo_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Name VARCHAR(255),
    Description VARCHAR(255),
    Filename VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Staff (
    Staff_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Name VARCHAR(40),
    Other_Details VARCHAR(255)
)

CREATE TABLE Visits (
    Visit_ID INTEGER,
    Tourist_Attraction_ID INTEGER,
    Tourist_ID INTEGER,
    Visit_Date DATETIME,
    Visit_Details VARCHAR(40)
)

CREATE TABLE Street_Markets (
    Market_ID INTEGER,
    Market_Details VARCHAR(255)
)

CREATE TABLE Tourist_Attractions (
    Tourist_Attraction_ID INTEGER,
    Attraction_Type_Code CHAR(15),
    Location_ID INTEGER,
    How_to_Get_There VARCHAR(255),
    Name VARCHAR(255),
    Description VARCHAR(255),
    Opening_Hours VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Ref_Hotel_Star_Ratings (
    star_rating_code CHAR(15),
    star_rating_description VARCHAR(80)
)

CREATE TABLE Features (
    Feature_ID INTEGER,
    Feature_Details VARCHAR(255)
)

CREATE TABLE Shops (
    Shop_ID INTEGER,
    Shop_Details VARCHAR(255)
)

CREATE TABLE Ref_Attraction_Types (
    Attraction_Type_Code CHAR(15),
    Attraction_Type_Description VARCHAR(255)
)

CREATE TABLE Locations (
    Location_ID INTEGER,
    Location_Name VARCHAR(255),
    Address VARCHAR(255),
    Other_Details VARCHAR(255)
)

CREATE TABLE Visitors (
    Tourist_ID INTEGER,
    Tourist_Details VARCHAR(255)
)

CREATE TABLE Hotels (
    hotel_id INTEGER,
    star_rating_code CHAR(15),
    pets_allowed_yn CHAR(1),
    price_range real,
    other_hotel_details VARCHAR(255)
)

CREATE TABLE Museums (
    Museum_ID INTEGER,
    Museum_Details VARCHAR(255)
)

CREATE TABLE Royal_Family (
    Royal_Family_ID INTEGER,
    Royal_Family_Details VARCHAR(255)
)

CREATE TABLE Theme_Parks (
    Theme_Park_ID INTEGER,
    Theme_Park_Details VARCHAR(255)
)

CREATE TABLE Tourist_Attraction_Features (
    Tourist_Attraction_ID INTEGER,
    Feature_ID INTEGER
)

Question: Show the names and ids of tourist attractions that are visited at most once. Plot them as pie chart.

SQL:
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
Schema:
CREATE TABLE table_36 (
    "Calls" text,
    "Frequency" text,
    "Branding" text,
    "Format" text,
    "Market/Rank" text,
    "Timeslot" text,
    "Group owner" text
)

Question: What is the Branding for Group Owner Qantam of Cape Cod, LLC?

SQL:
SELECT "Branding" FROM table_36 WHERE "Group owner" = 'Qantam of Cape Cod, LLC'
Schema:
CREATE TABLE table_9053 (
    "Date" text,
    "Venue" text,
    "Score" text,
    "Competition" text,
    "Report" text
)

Question: What was the Competition on November 16, 2007?

SQL:
SELECT "Competition" FROM table_9053 WHERE "Date" = 'november 16, 2007'
Schema:
CREATE TABLE table_name_46 (
    television_service VARCHAR,
    language VARCHAR
)

Question: Which television service has italian for its language?

SQL:
SELECT television_service FROM table_name_46 WHERE language = "italian"
Schema:
CREATE TABLE table_39379 (
    "Year" real,
    "English title" text,
    "Original title" text,
    "Country" text,
    "Director" text
)

Question: English title of am lie had what year?

SQL:
SELECT "Year" FROM table_39379 WHERE "English title" = 'amélie'
Schema:
CREATE TABLE table_61007 (
    "Position" real,
    "Club" text,
    "Played" real,
    "Points" real,
    "Wins" real,
    "Draws" real,
    "Losses" real,
    "Goals for" real,
    "Goals against" real,
    "Goal Difference" real
)

Question: WHAT ARE THE GOALS WITH DRAWS SMALLER THAN 6, AND LOSSES SMALLER THAN 7?

SQL:
SELECT AVG("Goals for") FROM table_61007 WHERE "Draws" < '6' AND "Losses" < '7'
Schema:
CREATE TABLE table_name_4 (
    inhabitants INTEGER,
    mayor VARCHAR,
    election VARCHAR
)

Question: Which Inhabitants have a Mayor of matteo renzi, and an Election larger than 2009?

SQL:
SELECT MIN(inhabitants) FROM table_name_4 WHERE mayor = "matteo renzi" AND election > 2009
Schema:
CREATE TABLE table_204_91 (
    id number,
    "year" number,
    "original title" text,
    "english title" text,
    "role" text,
    "notes" text
)

Question: what was henrick malberg 's first film ?

SQL:
SELECT "original title" FROM table_204_91 ORDER BY "year" LIMIT 1
Schema:
CREATE TABLE teaches (
    ID varchar(5),
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0)
)

CREATE TABLE classroom (
    building varchar(15),
    room_number varchar(7),
    capacity numeric(4,0)
)

CREATE TABLE instructor (
    ID varchar(5),
    name varchar(20),
    dept_name varchar(20),
    salary numeric(8,2)
)

CREATE TABLE takes (
    ID varchar(5),
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0),
    grade varchar(2)
)

CREATE TABLE student (
    ID varchar(5),
    name varchar(20),
    dept_name varchar(20),
    tot_cred numeric(3,0)
)

CREATE TABLE advisor (
    s_ID varchar(5),
    i_ID varchar(5)
)

CREATE TABLE section (
    course_id varchar(8),
    sec_id varchar(8),
    semester varchar(6),
    year numeric(4,0),
    building varchar(15),
    room_number varchar(7),
    time_slot_id varchar(4)
)

CREATE TABLE course (
    course_id varchar(8),
    title varchar(50),
    dept_name varchar(20),
    credits numeric(2,0)
)

CREATE TABLE time_slot (
    time_slot_id varchar(4),
    day varchar(1),
    start_hr numeric(2),
    start_min numeric(2),
    end_hr numeric(2),
    end_min numeric(2)
)

CREATE TABLE prereq (
    course_id varchar(8),
    prereq_id varchar(8)
)

CREATE TABLE department (
    dept_name varchar(20),
    building varchar(15),
    budget numeric(12,2)
)

Question: Find the names and average salaries of all departments whose average salary is greater than 42000, and rank by the dept_name in ascending.

SQL:
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
Schema:
CREATE TABLE table_15315816_1 (
    year VARCHAR,
    champion VARCHAR
)

Question: When are all years that the champion is Ji Min Jeong?

SQL:
SELECT year FROM table_15315816_1 WHERE champion = "Ji Min Jeong"
Schema:
CREATE TABLE table_name_58 (
    location VARCHAR,
    score VARCHAR
)

Question: what is the location when the score is w 105-99?

SQL:
SELECT location FROM table_name_58 WHERE score = "w 105-99"
Schema:
CREATE TABLE table_69468 (
    "Year" real,
    "Entrant" text,
    "Chassis" text,
    "Engine" text,
    "Points" real
)

Question: Which entrant has a year after 1999?

SQL:
SELECT "Entrant" FROM table_69468 WHERE "Year" > '1999'
Schema:
CREATE TABLE table_name_52 (
    year INTEGER,
    opponent VARCHAR
)

Question: What is the highest Year, when Opponent is #2 Syracuse?

SQL:
SELECT MAX(year) FROM table_name_52 WHERE opponent = "#2 syracuse"
Schema:
CREATE TABLE table_842 (
    "Game" real,
    "Date" text,
    "Team" text,
    "Score" text,
    "High points" text,
    "High rebounds" text,
    "High assists" text,
    "Location Attendance" text,
    "Record" text
)

Question: Who did the Raptors play when their record was 45-36?

SQL:
SELECT "Team" FROM table_842 WHERE "Record" = '45-36'
Schema:
CREATE TABLE table_20137 (
    "Condition" text,
    "Prothrombin time" text,
    "Partial thromboplastin time" text,
    "Bleeding time" text,
    "Platelet count" text
)

Question: What are all the possible bleeding time results where prothrombin time and platelet count are both unaffected?

SQL:
SELECT "Bleeding time" FROM table_20137 WHERE "Prothrombin time" = 'Unaffected' AND "Platelet count" = 'Unaffected'
Schema:
CREATE TABLE table_61634 (
    "Name" text,
    "Birth" text,
    "Marriage" text,
    "Became Consort" text,
    "Ceased to be Consort" text,
    "Spouse" text
)

Question: On what date did the woman married to Louis II become consort?

SQL:
SELECT "Became Consort" FROM table_61634 WHERE "Spouse" = 'louis ii'
Schema:
CREATE TABLE table_name_23 (
    crowd VARCHAR,
    away_team VARCHAR
)

Question: When Richmond is the away team, what is the crowd size?

SQL:
SELECT crowd FROM table_name_23 WHERE away_team = "richmond"
Schema:
CREATE TABLE table_dev_22 (
    "id" int,
    "gender" string,
    "hemoglobin_a1c_hba1c" float,
    "heart_disease" bool,
    "cardiovascular_disease" bool,
    "esophageal_varices" bool,
    "liver_disease" bool,
    "diabetes" bool,
    "serum_creatinine" float,
    "hypertension" bool,
    "portal_hypertension" bool,
    "NOUSE" float
)

Question: cirrhosis of the liver, portal hypertension, or esophageal varices

SQL:
SELECT * FROM table_dev_22 WHERE liver_disease = 1 OR portal_hypertension = 1 OR esophageal_varices = 1
Schema:
CREATE TABLE table_13971 (
    "Draw" real,
    "Artist" text,
    "Song" text,
    "Result" text,
    "Place" real
)

Question: What's the smallest draw that has a place bigger more than 1 and Anastasia Prikhodko as the artist?

SQL:
SELECT MIN("Draw") FROM table_13971 WHERE "Artist" = 'anastasia prikhodko' AND "Place" > '1'
Schema:
CREATE TABLE buildings (
    id int,
    name text,
    City text,
    Height int,
    Stories int,
    Status text
)

CREATE TABLE Office_locations (
    building_id int,
    company_id int,
    move_in_year int
)

CREATE TABLE Companies (
    id int,
    name text,
    Headquarters text,
    Industry text,
    Sales_billion real,
    Profits_billion real,
    Assets_billion real,
    Market_Value_billion text
)

Question: , order by the bars from low to high.

SQL:
SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY Industry
Schema:
CREATE TABLE table_27646 (
    "Letters" text,
    "Organization" text,
    "Nickname" text,
    "Founding Date" text,
    "Founding University" text,
    "Type" text
)

Question: What is the type if the organization name is Gamma RHO Lambda 1?

SQL:
SELECT "Type" FROM table_27646 WHERE "Organization" = 'Gamma Rho Lambda 1'
Schema:
CREATE TABLE table_42494 (
    "Ballarat FL" text,
    "Wins" real,
    "Byes" real,
    "Losses" real,
    "Draws" real,
    "Against" real
)

Question: How many losses have byes greater than 2?

SQL:
SELECT COUNT("Losses") FROM table_42494 WHERE "Byes" > '2'