text
stringlengths
432
6.49k
target
stringlengths
2
4.44k
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_24 ( opponent VARCHAR, attendance VARCHAR ) ### Question ### Tell me the opponent for attendance of 55,527 ### Accurate SQL ###
SELECT opponent FROM table_name_24 WHERE attendance = "55,527"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_20615 ( "#" real, "Series Sorted" text, "Title" text, "Author" text, "Doctor" text, "Featuring" text, "Released" text ) ### Question ### Name the total number of series sorted for when released is april 2010 ### Accurate SQL ###
SELECT COUNT("Series Sorted") FROM table_20615 WHERE "Released" = 'April 2010'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: 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 ) ### Question ### what is the yearly minimum amount of platelet count of patient 88441? ### Accurate SQL ###
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88441) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') GROUP BY STRFTIME('%y', labevents.charttime)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_11677691_2 ( hometown VARCHAR, player VARCHAR ) ### Question ### WHAT IS THE HOMETOWN OF TONY STEWARD? ### Accurate SQL ###
SELECT hometown FROM table_11677691_2 WHERE player = "Tony Steward"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Ref_budget_codes ( Id VARCHAR ) ### Question ### How many budget types do we have? ### Accurate SQL ###
SELECT COUNT(*) FROM Ref_budget_codes
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) TABLE: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) TABLE: CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) TABLE: CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) ### Question ### Create a bar chart showing total number of meter 100 across meter 200, and rank y-axis from high to low order. ### Accurate SQL ###
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100) DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_68 (erp_w VARCHAR, frequency_mhz VARCHAR, city_of_license VARCHAR) ### Question ### What is the ERP W of a Frequency MHz greater than 89.5 in the city of Washburn, Texas? ### Accurate SQL ###
SELECT erp_w FROM table_name_68 WHERE frequency_mhz > 89.5 AND city_of_license = "washburn, texas"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: 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 ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: 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 ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: 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 ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: 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 ### how many patients have undergone aortocor bypas-2 cor art within 2 months during this year after the previous procedure of parent infus nutrit sub? ### Accurate SQL ###
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'parent infus nutrit sub') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'aortocor bypas-2 cor art') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month')
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_92 (rank INTEGER, matches VARCHAR) ### Question ### What is the Rank of the player with 362 Matches? ### Accurate SQL ###
SELECT MAX(rank) FROM table_name_92 WHERE matches = 362
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_12791809_1 (freight_carried_s_tonne INTEGER, super_b_capacity_reached_ VARCHAR, _citation_needed_ VARCHAR) ### Question ### What is the least amount of freight carried when the super b capacity reached was February 26? ### Accurate SQL ###
SELECT MIN(freight_carried_s_tonne) FROM table_12791809_1 WHERE super_b_capacity_reached_[_citation_needed_] = "February 26"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_17 (engine VARCHAR, driver VARCHAR, tyre VARCHAR, constructor VARCHAR) ### Question ### what is the engine when the tyre is d, the constructor is era and the driver is bob gerard? ### Accurate SQL ###
SELECT engine FROM table_name_17 WHERE tyre = "d" AND constructor = "era" AND driver = "bob gerard"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) TABLE: CREATE TABLE month ( month_number int, month_name text ) TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int ) TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int ) TABLE: CREATE TABLE code_description ( code varchar, description text ) TABLE: CREATE TABLE days ( days_code varchar, day_name varchar ) TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text ) TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) ### Question ### in the month of december are there any flights from ATLANTA to DENVER that stop in BOSTON ### Accurate SQL ###
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'BOSTON' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_68 ( memory_map VARCHAR, model VARCHAR, byte_string VARCHAR, max_memory__kwords_ VARCHAR ) ### Question ### On a Sigma 9 with a standard byte string and more than 128 max memory, what is the value of the memory map? ### Accurate SQL ###
SELECT memory_map FROM table_name_68 WHERE byte_string = "standard" AND max_memory__kwords_ > 128 AND model = "sigma 9"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_78131 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) ### Question ### Which hometown has a player of Ray Drew? ### Accurate SQL ###
SELECT "Hometown" FROM table_78131 WHERE "Player" = 'ray drew'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### how many patients admitted before the year 2170 had liver transplant as the primary disease? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.admityear < "2170"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_16581695_3 ( no_in_season VARCHAR, production_code VARCHAR ) ### Question ### How many seasons have a production code of 204? ### Accurate SQL ###
SELECT COUNT(no_in_season) FROM table_16581695_3 WHERE production_code = 204
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_37350 ( "Week" real, "Date" text, "Opponent" text, "Time ( ET )" text, "Game site" text, "Result" text, "Record" text ) ### Question ### What opponent has a record of 6-9? ### Accurate SQL ###
SELECT "Opponent" FROM table_37350 WHERE "Record" = '6-9'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_19241 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text ) ### Question ### Who made the report when the home team is north Melbourne? ### Accurate SQL ###
SELECT "Report" FROM table_19241 WHERE "Home team" = 'North Melbourne'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_44 ( first_season_of_current_spell_in_segunda_división INTEGER, city VARCHAR ) ### Question ### What is the total of the first season in Segunda Divisi n that has a City of ca ete? ### Accurate SQL ###
SELECT SUM(first_season_of_current_spell_in_segunda_división) FROM table_name_44 WHERE city = "cañete"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_43 ( governments VARCHAR, term_start VARCHAR ) ### Question ### What governments did the minister with a term start on 24 September 1984 have? ### Accurate SQL ###
SELECT governments FROM table_name_43 WHERE term_start = "24 september 1984"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_27756164_2 (game VARCHAR, high_rebounds VARCHAR) ### Question ### In how many different games did Roy Hibbert (16) did the most high rebounds? ### Accurate SQL ###
SELECT COUNT(game) FROM table_27756164_2 WHERE high_rebounds = "Roy Hibbert (16)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: 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 ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### what is the average days of hospital stay for the patients born after 2180? ### Accurate SQL ###
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2180"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_53416 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) ### Question ### what is the average losses when the wins is 9 and ties more than 0? ### Accurate SQL ###
SELECT AVG("Losses") FROM table_53416 WHERE "Wins" = '9' AND "Ties" > '0'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_17250 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) ### Question ### What was the score for the game in which Emeka Okafor (10) had high rebounds? ### Accurate SQL ###
SELECT "Score" FROM table_17250 WHERE "High rebounds" = 'Emeka Okafor (10)'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_56 (argon VARCHAR, neon VARCHAR) ### Question ### Name the Argon which has a Neon of 0.484? ### Accurate SQL ###
SELECT argon FROM table_name_56 WHERE neon = "0.484"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) TABLE: CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) TABLE: 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) ) TABLE: 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) ) TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) TABLE: 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) ) TABLE: CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) TABLE: 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) ) TABLE: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) ### Question ### How many accounts are opened in each day for all accounts by the customer with first name 'Meaghan' ? Bin the account open day by weekday in a bar chart, and order y-axis in descending order. ### Accurate SQL ###
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY COUNT(date_account_opened) DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_95 ( place VARCHAR, player VARCHAR ) ### Question ### Which Place has a Player of lee trevino? ### Accurate SQL ###
SELECT place FROM table_name_95 WHERE player = "lee trevino"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_93 (venue VARCHAR, result VARCHAR) ### Question ### Which venue led to a draw? ### Accurate SQL ###
SELECT venue FROM table_name_93 WHERE result = "draw"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Question ### count the number of patients whose admission type is elective and procedure icd9 code is 9744? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "9744"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) ### Question ### Site's questions per hour of the day. Questions grouped per hour of the day, posted less than X Days ago; also graphed ### Accurate SQL ###
SELECT CAST(STR(DATEPART(hour, p.CreationDate)) AS INT) AS Hour, COUNT(DATEPART(hour, p.CreationDate)) AS "# of questions" FROM Posts AS p WHERE p.PostTypeId = 1 AND DATEDIFF(DAY, p.CreationDate, GETDATE()) < '##Days:int?7##' GROUP BY DATEPART(hour, p.CreationDate)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_12 (date VARCHAR, visitor VARCHAR, record VARCHAR) ### Question ### What date was the visitor chicago black hawks, and a Record of 1-1? ### Accurate SQL ###
SELECT date FROM table_name_12 WHERE visitor = "chicago black hawks" AND record = "1-1"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_55 ( institution VARCHAR, affiliation VARCHAR ) ### Question ### Which institution is private/catholic? ### Accurate SQL ###
SELECT institution FROM table_name_55 WHERE affiliation = "private/catholic"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_34 (Id VARCHAR) ### Question ### What is the 2008 result where 2003 is 325? ### Accurate SQL ###
SELECT 2008 FROM table_name_34 WHERE 2003 = "325"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_4 ( player VARCHAR, place VARCHAR ) ### Question ### Who was the player who placed t10? ### Accurate SQL ###
SELECT player FROM table_name_4 WHERE place = "t10"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_1805191_36 (candidates VARCHAR, incumbent VARCHAR) ### Question ### Who are all of the candidates in elections where Dennis Kucinich was a candidate? ### Accurate SQL ###
SELECT candidates FROM table_1805191_36 WHERE incumbent = "Dennis Kucinich"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_17299 ( "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 game 39? ### Accurate SQL ###
SELECT COUNT("Record") FROM table_17299 WHERE "Game" = '39'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE journal ( journal_id number, date text, theme text, sales number ) TABLE: CREATE TABLE journal_committee ( editor_id number, journal_id number, work_type text ) TABLE: CREATE TABLE editor ( editor_id number, name text, age number ) ### Question ### List the names of editors in ascending order of age. ### Accurate SQL ###
SELECT name FROM editor ORDER BY age
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_10335_1 (estimated_deaths VARCHAR, operational VARCHAR) ### Question ### what's the estimated deaths with operational period of 17 march 1942 – end of june 1943 ### Accurate SQL ###
SELECT estimated_deaths FROM table_10335_1 WHERE operational = "17 March 1942 – end of June 1943"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) ### Question ### Which question since 100K has had the best reception for [R] tag?. ### Accurate SQL ###
SELECT Id AS "post_link", Score, ViewCount FROM (SELECT ROW_NUMBER() OVER (ORDER BY a.CreationDate) AS "rownumber", * FROM Posts AS a, PostTags AS b WHERE a.Id = b.PostId AND b.TagId = 4452) AS abSorted WHERE rownumber > 100000 ORDER BY Score DESC LIMIT 100
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int ) TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) TABLE: CREATE TABLE code_description ( code varchar, description text ) TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text ) TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int ) TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) TABLE: CREATE TABLE days ( days_code varchar, day_name varchar ) TABLE: CREATE TABLE month ( month_number int, month_name text ) ### Question ### flight will start from BOSTON ### Accurate SQL ###
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND flight.from_airport = airport_service.airport_code
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_17 ( combination_classification VARCHAR, stage VARCHAR ) ### Question ### Which Combination classification has a Stage of 14? ### Accurate SQL ###
SELECT combination_classification FROM table_name_17 WHERE stage = "14"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: 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 ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: 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 ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) ### Question ### had the heart rate of patient 5828 been on the current icu visit ever less than 72.0? ### Accurate SQL ###
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND chartevents.valuenum < 72.0
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_90 (rank VARCHAR, title VARCHAR) ### Question ### What rank did Best Friends receive? ### Accurate SQL ###
SELECT rank FROM table_name_90 WHERE title = "best friends"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_41481 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text ) ### Question ### What score has Toronto Eagles as the home? ### Accurate SQL ###
SELECT "Score" FROM table_41481 WHERE "Home" = 'toronto eagles'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_train_149 ( "id" int, "prostate_specific_antigen_psa" float, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "fasting_serum_glucose" int, "vitamin_d" int, "NOUSE" float ) ### Question ### prostate specific antigen > 4 ng / ml ### Accurate SQL ###
SELECT * FROM table_train_149 WHERE prostate_specific_antigen_psa > 4
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_17 ( team VARCHAR, chassis___engine VARCHAR, laps VARCHAR ) ### Question ### What team has a porsche 956 b chassis-engine with less than 79 laps? ### Accurate SQL ###
SELECT team FROM table_name_17 WHERE chassis___engine = "porsche 956 b" AND laps < 79
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_17360840_5 ( points VARCHAR, record VARCHAR ) ### Question ### How many points were scored when the record was 6-8-6? ### Accurate SQL ###
SELECT COUNT(points) FROM table_17360840_5 WHERE record = "6-8-6"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_55943 ( "Rank" real, "Team" text, "Floor Exercise" real, "Pommel Horse" real, "Rings" real, "Vault" real, "Parallel Bars" real, "Horizontal Bar" real, "Total" real ) ### Question ### How many pommel horses have a Total smaller than 230.019, a Team of china (chn), and a Vault smaller than 38.437? ### Accurate SQL ###
SELECT COUNT("Pommel Horse") FROM table_55943 WHERE "Total" < '230.019' AND "Team" = 'china (chn)' AND "Vault" < '38.437'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_25386 ( "Player" text, "Games Played" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real ) ### Question ### Name the steals for 5 blocks ### Accurate SQL ###
SELECT "Steals" FROM table_25386 WHERE "Blocks" = '5'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_1840433_2 (number_of_editions VARCHAR, most_wins_by VARCHAR) ### Question ### How many editions have a most wins value of Franco Marvulli (4)? ### Accurate SQL ###
SELECT COUNT(number_of_editions) FROM table_1840433_2 WHERE most_wins_by = "Franco Marvulli (4)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_29616 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text ) ### Question ### On how many days in October was the score 6-1? ### Accurate SQL ###
SELECT COUNT("October") FROM table_29616 WHERE "Score" = '6-1'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_91 ( group VARCHAR, official_history VARCHAR ) ### Question ### Which group has David D'Angers as the official history? ### Accurate SQL ###
SELECT group FROM table_name_91 WHERE official_history = "david d'angers"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_1449169_1 (common VARCHAR, area__km_2__ VARCHAR) ### Question ### Which common has an area (km2) of 103.02? ### Accurate SQL ###
SELECT common FROM table_1449169_1 WHERE area__km_2__ = "103.02"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Question ### what is the number of patients whose diagnoses short title is prsnl hst colonic polyps and lab test fluid is blood? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Prsnl hst colonic polyps" AND lab.fluid = "Blood"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_31 (assist_pass VARCHAR, goal VARCHAR) ### Question ### Which Assist/pass has a Goal of 5? ### Accurate SQL ###
SELECT assist_pass FROM table_name_31 WHERE goal = "5"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_28138035_26 ( mens_doubles VARCHAR, mens_singles VARCHAR ) ### Question ### Who won the mens doubles when wang hao won the mens singles? ### Accurate SQL ###
SELECT mens_doubles FROM table_28138035_26 WHERE mens_singles = "Wang Hao"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_204_664 ( id number, "rank" number, "bib" number, "name" text, "nationality" text, "start" text, "penalties (p+p+s+s)" text, "time" text, "deficit" text ) ### Question ### what is the largest penalty ? ### Accurate SQL ###
SELECT MAX("penalties (p+p+s+s)") FROM table_204_664
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_5 ( goals INTEGER, tries VARCHAR, position VARCHAR ) ### Question ### Tell me the highest goals with tries less than 1 and fullback position ### Accurate SQL ###
SELECT MAX(goals) FROM table_name_5 WHERE tries < 1 AND position = "fullback"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_11 (away_team VARCHAR, home_team VARCHAR) ### Question ### who is the away team when the home team is luton town? ### Accurate SQL ###
SELECT away_team FROM table_name_11 WHERE home_team = "luton town"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_14342480_5 ( field_goals INTEGER ) ### Question ### Name the most field goals ### Accurate SQL ###
SELECT MAX(field_goals) FROM table_14342480_5
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_13 ( height__cm_ INTEGER, weight__kg_ VARCHAR ) ### Question ### What is the sum of Height (cm), when the Weight (kg) is 90? ### Accurate SQL ###
SELECT SUM(height__cm_) FROM table_name_13 WHERE weight__kg_ = 90
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_11148572_1 (mls_cup_runner_up VARCHAR, season VARCHAR) ### Question ### Which shield winner has the mls cup runner up and the season is 2000? ### Accurate SQL ###
SELECT mls_cup_runner_up FROM table_11148572_1 WHERE season = 2000
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_45 (actor VARCHAR, result VARCHAR, category VARCHAR) ### Question ### What actor was nominated for best actress? ### Accurate SQL ###
SELECT actor FROM table_name_45 WHERE result = "nominated" AND category = "best actress"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE country (Name VARCHAR, Population VARCHAR) ### Question ### What are names of countries with the top 3 largest population? ### Accurate SQL ###
SELECT Name FROM country ORDER BY Population DESC LIMIT 3
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE perpetrator ( Date VARCHAR, People_ID VARCHAR ) TABLE: CREATE TABLE people ( People_ID VARCHAR, Height VARCHAR ) ### Question ### Show the date of the tallest perpetrator. ### Accurate SQL ###
SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_2226343_1 ( manufacturer VARCHAR, average_speed__mph_ VARCHAR ) ### Question ### Who is the manufacturer when 150.088 is the average speed (mph)? ### Accurate SQL ###
SELECT manufacturer FROM table_2226343_1 WHERE average_speed__mph_ = "150.088"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_41852 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) ### Question ### What is the ICAO when the IATA is ist? ### Accurate SQL ###
SELECT "ICAO" FROM table_41852 WHERE "IATA" = 'ist'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) TABLE: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) ### Question ### For those records from the products and each product's manufacturer, a bar chart shows the distribution of founder and the sum of manufacturer , and group by attribute founder, and I want to display by the names from low to high. ### Accurate SQL ###
SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_68876 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text ) ### Question ### Name the start for finish being 21st ### Accurate SQL ###
SELECT "Start" FROM table_68876 WHERE "Finish" = '21st'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_3055 ( "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Withdrew due to" text ) ### Question ### List the rank of the player that left the tournament due to right foot injury ### Accurate SQL ###
SELECT COUNT("Rank") FROM table_3055 WHERE "Withdrew due to" = 'right foot injury'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) TABLE: 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 ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) ### Question ### on the last hospital visit what is the age of patient 004-10432? ### Accurate SQL ###
SELECT patient.age FROM patient WHERE patient.uniquepid = '004-10432' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: 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 ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: 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 ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: 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 ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) ### Question ### tell me the total amount of patient 18316's output on 11/16/2103. ### Accurate SQL ###
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18316)) AND STRFTIME('%y-%m-%d', outputevents.charttime) = '2103-11-16'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) TABLE: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) ### Question ### For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of manufacturer , and group by attribute name. ### Accurate SQL ###
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) ### Question ### how many treatment of hyperkalemia - insulin / glucose procedures have occurred since 2100? ### Accurate SQL ###
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'treatment of hyperkalemia - insulin / glucose' AND STRFTIME('%y', treatment.treatmenttime) >= '2100'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_69 (bask VARCHAR, indoor_track VARCHAR, school VARCHAR) ### Question ### What is the basketball status for Valparaiso who has an indoor track status of yes? ### Accurate SQL ###
SELECT bask FROM table_name_69 WHERE indoor_track = "yes" AND school = "valparaiso"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_38 (height VARCHAR, year VARCHAR) ### Question ### The year 1974 has what listed as the Height? ### Accurate SQL ###
SELECT height FROM table_name_38 WHERE year = 1974
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE days ( days_code varchar, day_name varchar ) TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int ) TABLE: CREATE TABLE code_description ( code varchar, description text ) TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int ) TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text ) TABLE: CREATE TABLE month ( month_number int, month_name text ) TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) ### Question ### show me the flights before 1100 on 8 2 from BOSTON to DENVER on DL ### Accurate SQL ###
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((date_day.day_number = 2 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time < 1100 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'DL'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_98 ( pick__number INTEGER, college VARCHAR ) ### Question ### What is the lowest Pick #, when College is 'Jackson State'? ### Accurate SQL ###
SELECT MIN(pick__number) FROM table_name_98 WHERE college = "jackson state"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) ### Question ### New Users by Date (last 30 days). ### Accurate SQL ###
SELECT CAST(CreationDate AS DATE) AS "date", COUNT(Id) AS "new_users" FROM Users WHERE CreationDate >= DATEADD(d, -30, GETDATE()) GROUP BY CAST(CreationDate AS DATE) ORDER BY CAST(CreationDate AS DATE) DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_27 (source VARCHAR, date VARCHAR) ### Question ### What is the source on 6 September? ### Accurate SQL ###
SELECT source FROM table_name_27 WHERE date = "6 september"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_51701 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) ### Question ### Name the tournament for april 3, 2005 ### Accurate SQL ###
SELECT "Tournament" FROM table_51701 WHERE "Date" = 'april 3, 2005'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_48581 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) ### Question ### WHAT IS THE TEAM WITH ATTENDANCE AT TARGET CENTER 11,921? ### Accurate SQL ###
SELECT "Team" FROM table_48581 WHERE "Location Attendance" = 'target center 11,921'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_90 ( tries_against VARCHAR, tries_for VARCHAR ) ### Question ### How many tries against did the club with 48 tries for have? ### Accurate SQL ###
SELECT tries_against FROM table_name_90 WHERE tries_for = "48"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_204_34 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) ### Question ### how many countries scored at least 3 gold medals ? ### Accurate SQL ###
SELECT COUNT("nation") FROM table_204_34 WHERE "gold" >= 3
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_24567 ( "Country" text, "% of imports from Russia" text, "% cut" text, "Diversification" text, "Gas storage" text, "Alternative fuel" text ) ### Question ### What country had 20% imports from russia? ### Accurate SQL ###
SELECT "Country" FROM table_24567 WHERE "% of imports from Russia" = '20%'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_64631 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) ### Question ### What's the location of the team Peter Stuyvesant International Racing? ### Accurate SQL ###
SELECT "City / State" FROM table_64631 WHERE "Team" = 'peter stuyvesant international racing'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_43537 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) ### Question ### what date did tie number 5 occur? ### Accurate SQL ###
SELECT "Date" FROM table_43537 WHERE "Tie no" = '5'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int ) TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) TABLE: CREATE TABLE days ( days_code varchar, day_name varchar ) TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int ) TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) TABLE: CREATE TABLE code_description ( code varchar, description text ) TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) TABLE: CREATE TABLE month ( month_number int, month_name text ) TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text ) TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) ### Question ### what flights from CHICAGO to KANSAS CITY ### Accurate SQL ###
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_23214833_1 (team_captain VARCHAR, stadium VARCHAR) ### Question ### Who's the captain of the team whose stadium is Gradski Stadion? ### Accurate SQL ###
SELECT team_captain FROM table_23214833_1 WHERE stadium = "Gradski Stadion"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_26041144_11 (matches INTEGER) ### Question ### What is the lowest number of matches for a record holder? ### Accurate SQL ###
SELECT MIN(matches) FROM table_26041144_11
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_11222744_2 (copyright_information VARCHAR, title VARCHAR) ### Question ### where title is am/pm callanetics , what are all the copyright information? ### Accurate SQL ###
SELECT copyright_information FROM table_11222744_2 WHERE title = "AM/PM Callanetics"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int ) TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) TABLE: CREATE TABLE area ( course_id int, area varchar ) TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int ) TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) ### Question ### In Spring and Summer term how many 200 -level classes are being offered ? ### Accurate SQL ###
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester AND semester.year = 2016
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_76 (name__english_ VARCHAR, location VARCHAR) ### Question ### What is the English Name of the Location in Chester? ### Accurate SQL ###
SELECT name__english_ FROM table_name_76 WHERE location = "chester"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_56 (grid INTEGER, laps INTEGER) ### Question ### What is the average grid with more than 23 laps? ### Accurate SQL ###
SELECT AVG(grid) FROM table_name_56 WHERE laps > 23
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_96 (score VARCHAR, leading_scorer VARCHAR) ### Question ### What score has tim duncan (27) as the leading scorer? ### Accurate SQL ###
SELECT score FROM table_name_96 WHERE leading_scorer = "tim duncan (27)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_1477 ( "Player" text, "Team" text, "Matches" real, "Innings" real, "Runs" real, "Average" text, "Highest Score" text, "100s" real, "50s" real ) ### Question ### How many numbers were recorde under 50s when there was 2 matches? ### Accurate SQL ###
SELECT COUNT("50s") FROM table_1477 WHERE "Matches" = '2'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_39 (club VARCHAR, round VARCHAR, score VARCHAR) ### Question ### Which club has a 2nd round score of 1:0, 3:0? ### Accurate SQL ###
SELECT club FROM table_name_39 WHERE round = "2nd round" AND score = "1:0, 3:0"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ### among patients with item id 51466, how many of them were tested by lab for abnormal delta? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "delta"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_197446_1 (elected VARCHAR, term_began VARCHAR) ### Question ### What year was the congressional service elected for a term beginning on January 3, 1989? ### Accurate SQL ###
SELECT elected FROM table_197446_1 WHERE term_began = "January 3, 1989"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_33 ( goals_scored INTEGER, team VARCHAR, points VARCHAR ) ### Question ### What is the total number of Goals Scored, when the Team is San Salvador F.C., and when the Points are less than 10? ### Accurate SQL ###
SELECT MAX(goals_scored) FROM table_name_33 WHERE team = "san salvador f.c." AND points < 10