answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT network FROM table_22514845_4 WHERE s_analyst = "Eddie Arcaro"
Which network has s analyst of eddie arcaro?
CREATE TABLE table_22514845_4 (network VARCHAR, s_analyst VARCHAR)
SELECT location FROM table_18461635_1 WHERE county = "Sussex"
Where is the team in Sussex county located?
CREATE TABLE table_18461635_1 (location VARCHAR, county VARCHAR)
SELECT score FROM table_name_81 WHERE result = "0 – 2"
Which Score has a Result of 0 2?
CREATE TABLE table_name_81 ( score VARCHAR, result VARCHAR )
SELECT reporters FROM table_22514845_4 WHERE year = 1984
Who are the reporters for the year of 1984?
CREATE TABLE table_22514845_4 (reporters VARCHAR, year VARCHAR)
SELECT captain FROM table_18461635_1 WHERE county = "Essex"
Who is the captain of the team in Essex county?
CREATE TABLE table_18461635_1 (captain VARCHAR, county VARCHAR)
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID)
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, and rank by the y-axis in asc.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
SELECT COUNT(trophy_presentation) FROM table_22514845_4 WHERE year = 1987
How many trophy presentations where in the year 1987?
CREATE TABLE table_22514845_4 (trophy_presentation VARCHAR, year VARCHAR)
SELECT tobago FROM table_1850282_5 WHERE species = "Helicops angulatus"
there are in tobago species name helicops angulatus
CREATE TABLE table_1850282_5 (tobago VARCHAR, species VARCHAR)
SELECT high_points FROM table_17325580_6 WHERE team = "Washington"
What is every high point when the team is Washington?
CREATE TABLE table_17325580_6 ( high_points VARCHAR, team VARCHAR )
SELECT MIN(year) FROM table_22514845_4 WHERE reporters = "Howard Cosell and Jack Whitaker" AND s_analyst = "Bill Hartack"
In which year were howard cosell and jack whitaker reporters and s analyst is bill hartack?
CREATE TABLE table_22514845_4 (year INTEGER, reporters VARCHAR, s_analyst VARCHAR)
SELECT tobago FROM table_1850282_5 WHERE species = "Liophis cobellus cobellus"
are in tobago species liophis cobellus cobellus?
CREATE TABLE table_1850282_5 (tobago VARCHAR, species VARCHAR)
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID DESC
Visualize a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, I want to order in descending by the Y please.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
SELECT race_caller FROM table_22514845_4 WHERE s_host = "Jim McKay and Al Michaels" AND year = 1987
Who is the race caller when jim mckay and al michaels were s hosts in the year 1987?
CREATE TABLE table_22514845_4 (race_caller VARCHAR, s_host VARCHAR, year VARCHAR)
SELECT MAX(ending_with) FROM table_1852650_1
Name the most ending with
CREATE TABLE table_1852650_1 (ending_with INTEGER)
SELECT player FROM table_11677760_1 WHERE college = "Direct to NBA" AND school = "St. Vincent – St. Mary High school" AND year = "2001-2002"
what is the player who's college is listed as direct to nba, school is st. vincent st. mary high school and the year is 2001-2002?
CREATE TABLE table_11677760_1 ( player VARCHAR, year VARCHAR, college VARCHAR, school VARCHAR )
SELECT s_host FROM table_22514845_5 WHERE s_analyst = "John Rotz and Howard Cosell"
Name the host for john rotz and howard cosell
CREATE TABLE table_22514845_5 (s_host VARCHAR, s_analyst VARCHAR)
SELECT MAX(ending_with) FROM table_1852650_1 WHERE sung_by = "Peyalvar"
Name the most ending with for peyalvar
CREATE TABLE table_1852650_1 (ending_with INTEGER, sung_by VARCHAR)
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 = 'total splenectomy') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 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') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 4)
since 3 years ago, what is the top four most frequent diagnosis that patients were diagnosed with within 2 months after receiving total splenectomy?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
SELECT race_caller FROM table_22514845_5 WHERE s_host = "Jim McKay" AND reporters = "Howard Cosell"
Name the race caller for jim mckay and howard cosell
CREATE TABLE table_22514845_5 (race_caller VARCHAR, s_host VARCHAR, reporters VARCHAR)
SELECT MIN(starting_from) FROM table_1852650_1 WHERE name_of_the_prabandham = "Thiruvezhukkurrirukkai"
Name the starting from thiruvezhukkurrirukkai
CREATE TABLE table_1852650_1 (starting_from INTEGER, name_of_the_prabandham VARCHAR)
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location DESC
What is the number of locations of the wrestlers? Visualize by a bar chart, and sort by the x-axis from high to low.
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
SELECT race_caller FROM table_22514845_5 WHERE trophy_presentation = "Jim McKay and Howard Cosell" AND reporters = "Howard Cosell" AND s_analyst = "Eddie Arcaro"
Name the race caller for jim mckay and howard cosell and eddie arcaro
CREATE TABLE table_22514845_5 (race_caller VARCHAR, s_analyst VARCHAR, trophy_presentation VARCHAR, reporters VARCHAR)
SELECT starting_from FROM table_1852650_1 WHERE name_of_the_prabandham = "Amalanadhi piran"
Name the starting from amalanadhi piran
CREATE TABLE table_1852650_1 (starting_from VARCHAR, name_of_the_prabandham VARCHAR)
SELECT COUNT("Week #") FROM table_29673 WHERE "Theme" = 'Judge''s Choice' AND "Order #" = '4'
How many different weeks are there in order number 4 that were judge's choice?
CREATE TABLE table_29673 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text )
SELECT reporters FROM table_22514845_5 WHERE race_caller = "Dave Johnson" AND s_analyst = "Eddie Arcaro and Howard Cosell"
Name the reporters for dave johnson for eddie arcaro and howard cosell
CREATE TABLE table_22514845_5 (reporters VARCHAR, race_caller VARCHAR, s_analyst VARCHAR)
SELECT reason_for_change FROM table_18563954_3 WHERE state__class_ = "Massachusetts (2)"
Why did the change happened in Massachusetts (2)?
CREATE TABLE table_18563954_3 (reason_for_change VARCHAR, state__class_ VARCHAR)
SELECT "performer" FROM table_204_268 WHERE "performer" IN ('ewan maccoll', 'kornog') GROUP BY "performer" ORDER BY COUNT(*) DESC LIMIT 1
who appeared on more albums , maccoll or kornog ?
CREATE TABLE table_204_268 ( id number, "album/single" text, "performer" text, "year" number, "variant" text, "notes" text )
SELECT reporters FROM table_22514845_5 WHERE s_analyst = "Howard Cosell"
Name the reporters for howard cosell
CREATE TABLE table_22514845_5 (reporters VARCHAR, s_analyst VARCHAR)
SELECT COUNT(reason_for_change) FROM table_18563954_3 WHERE state__class_ = "Connecticut (3)"
How many different reasons are there for the change in Connecticut (3)?
CREATE TABLE table_18563954_3 (reason_for_change VARCHAR, state__class_ VARCHAR)
SELECT COUNT("Womens Singles") FROM table_30326 WHERE "Year Location" = '1999 Rio de Janeiro'
Name the number of womens singles for 1999 rio de janeiro
CREATE TABLE table_30326 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
SELECT COUNT(reporters) FROM table_22514845_5 WHERE s_analyst = "Heywood Hale Broun"
Name the number of reporters for heywood hale broun
CREATE TABLE table_22514845_5 (reporters VARCHAR, s_analyst VARCHAR)
SELECT MAX(background) FROM table_1855342_5 WHERE ability_to_compromise = 13
When the ability to compromise is 13, what is background?
CREATE TABLE table_1855342_5 (background INTEGER, ability_to_compromise VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "NEB"
find the number of emergency hospital admitted patients who had neb route of drug administration.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT province FROM table_2251578_4 WHERE elevation__m_ = 4550
Which province has an elevation of 4550?
CREATE TABLE table_2251578_4 (province VARCHAR, elevation__m_ VARCHAR)
SELECT MAX(ability_to_compromise) FROM table_1855342_5 WHERE seq = "41"
When the seq is 41, what is the ability to compromise?
CREATE TABLE table_1855342_5 (ability_to_compromise INTEGER, seq VARCHAR)
SELECT "Rank" FROM table_36999 WHERE "Third quarter" = 'china mobile 195,680.4'
When the third quarter is China Mobile 195,680.4, what is the rank?
CREATE TABLE table_36999 ( "Rank" real, "First quarter" text, "Second quarter" text, "Third quarter" text, "Fourth quarter" text )
SELECT province FROM table_2251578_4 WHERE district = "San Antonio de Chuca"
Which province is in the district of San Antonio de Chuca?
CREATE TABLE table_2251578_4 (province VARCHAR, district VARCHAR)
SELECT MAX(leadership_ability) FROM table_1855342_5 WHERE overall_ability = 32
When the ability is 32, what is the leadership ability?
CREATE TABLE table_1855342_5 (leadership_ability INTEGER, overall_ability VARCHAR)
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrophic vaginitis'))
how much is the cost of the atrophic vaginitis diagnosing?
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
SELECT COUNT(elevation__m_) FROM table_2251578_4 WHERE district = "Paratia"
How many elevations are listed for Paratia?
CREATE TABLE table_2251578_4 (elevation__m_ VARCHAR, district VARCHAR)
SELECT MIN(experts_view) FROM table_1855342_5 WHERE willing_to_take_risks = 25
When 25 are willing to take risks, what is the experts view?
CREATE TABLE table_1855342_5 (experts_view INTEGER, willing_to_take_risks VARCHAR)
SELECT "Date of death" FROM table_55800 WHERE "Date of birth" = '28 may 1371'
What was the Date of Death of the person whose Date of Birth was 28 May 1371?
CREATE TABLE table_55800 ( "Name" text, "Date of birth" text, "Date of death" text, "Reign" text, "Relationship with predecessor" text )
SELECT province FROM table_2251578_4 WHERE district = "Condoroma"
What province is in the district of Condoroma?
CREATE TABLE table_2251578_4 (province VARCHAR, district VARCHAR)
SELECT directed_by FROM table_18569389_1 WHERE us_viewers__million_ = "4.22"
Name who directed the episode that was viewed by 4.22 million
CREATE TABLE table_18569389_1 (directed_by VARCHAR, us_viewers__million_ VARCHAR)
SELECT "Result" FROM table_59892 WHERE "Competition" = 'uefa cup' AND "Opponent" = 'palermo'
What is the result of the UEFA Cup, against Palermo?
CREATE TABLE table_59892 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Competition" text )
SELECT reporters FROM table_22514845_2 WHERE year = 2003
Name the reporters for 2003
CREATE TABLE table_22514845_2 (reporters VARCHAR, year VARCHAR)
SELECT title FROM table_18569389_1 WHERE production_code = "2T6908"
Name the title for production code 2t6908
CREATE TABLE table_18569389_1 (title VARCHAR, production_code VARCHAR)
SELECT "Score" FROM table_36602 WHERE "Stadium" = 'cn centre' AND "Date" = 'april 5, 2008'
What was the score at CN Centre on April 5, 2008?
CREATE TABLE table_36602 ( "Date" text, "Home Team" text, "Score" text, "Visiting Team" text, "Stadium" text )
SELECT COUNT(race_caller) FROM table_22514845_2 WHERE trophy_presentation = "Bob Costas and Charlsie Cantey"
Name the total number for race caller for bob costas and charlsie cantey
CREATE TABLE table_22514845_2 (race_caller VARCHAR, trophy_presentation VARCHAR)
SELECT COUNT(no_in_series) FROM table_18569389_1 WHERE us_viewers__million_ = "3.62"
Name the total number for number in series that got 3.62 viewers
CREATE TABLE table_18569389_1 (no_in_series VARCHAR, us_viewers__million_ VARCHAR)
SELECT COUNT("High points") FROM table_18818 WHERE "Team" = 'Utah'
How many leading scorers were there in the game against Utah?
CREATE TABLE table_18818 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT race_caller FROM table_22514845_3 WHERE year = 1994
Who is the race caller for the year 1994?
CREATE TABLE table_22514845_3 (race_caller VARCHAR, year VARCHAR)
SELECT original_air_date FROM table_18569389_1 WHERE directed_by = "Chris Long"
Name the air date that chris long directed
CREATE TABLE table_18569389_1 (original_air_date VARCHAR, directed_by VARCHAR)
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
what about a RENTAL CAR in DENVER
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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 ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) 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 ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) 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 ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) 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 ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) 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 ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) 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 )
SELECT COUNT(reporters) FROM table_22514845_3 WHERE year = 1993
How many reporters for the year 1993?
CREATE TABLE table_22514845_3 (reporters VARCHAR, year VARCHAR)
SELECT COUNT(production_code) FROM table_18569389_1 WHERE us_viewers__million_ = "5.08"
Name the number of production code for 5.08
CREATE TABLE table_18569389_1 (production_code VARCHAR, us_viewers__million_ VARCHAR)
SELECT date FROM table_14875671_1 WHERE attendance = 63995
What was the date when the attendance was 63995
CREATE TABLE table_14875671_1 ( date VARCHAR, attendance VARCHAR )
SELECT starting_odds FROM table_22517564_3 WHERE opening_odds = "2-1"
What were the starting odds for the opening odds of 2-1?
CREATE TABLE table_22517564_3 (starting_odds VARCHAR, opening_odds VARCHAR)
SELECT yacht AS Type FROM table_1858574_2 WHERE loa__metres_ = "17.07"
When 17.07 is the loa (metres) what is the type of yacht?
CREATE TABLE table_1858574_2 (yacht VARCHAR, loa__metres_ VARCHAR)
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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
i'm requesting flight information on a flight from SAN FRANCISCO to PITTSBURGH on friday
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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 ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( days_code varchar, day_name varchar ) 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 ) 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 ) 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 ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) 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 ) 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 ) CREATE TABLE month ( month_number int, month_name text )
SELECT jockey FROM table_22517564_3 WHERE opening_odds = "4-1"
Who was the jockey with opening odds of 4-1?
CREATE TABLE table_22517564_3 (jockey VARCHAR, opening_odds VARCHAR)
SELECT sail_number FROM table_1858574_2 WHERE position = 3
When 3 is the position what is the sail number?
CREATE TABLE table_1858574_2 (sail_number VARCHAR, position VARCHAR)
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and could you list by the X in descending please?
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) )
SELECT COUNT(jockey) FROM table_22517564_3 WHERE trainer = "Eoin Harty"
HOw many jockeys had eoin harty as a trainer
CREATE TABLE table_22517564_3 (jockey VARCHAR, trainer VARCHAR)
SELECT sail_number FROM table_1858574_2 WHERE yacht = "Aspect Computing"
When aspect computing is the yacht what is the sail number?
CREATE TABLE table_1858574_2 (sail_number VARCHAR, yacht VARCHAR)
SELECT record FROM table_name_56 WHERE games = "1991 port of spain"
What is the Record of the 1991 Port of Spain Games?
CREATE TABLE table_name_56 ( record VARCHAR, games VARCHAR )
SELECT post FROM table_22517564_3 WHERE horse_name = "Chocolate Candy"
Which post had the horse named chocolate candy?
CREATE TABLE table_22517564_3 (post VARCHAR, horse_name VARCHAR)
SELECT yacht AS Type FROM table_1858574_2 WHERE sail_number = "6606"
When 6606 is the sail number what is the type of yacht?
CREATE TABLE table_1858574_2 (yacht VARCHAR, sail_number VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "2"
calculate the number of male patients whose hospital stay was for more than 2 days.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT date_successor_seated FROM table_225199_4 WHERE district = "Virginia 11th"
What is every date successor seated for the Virginia 11th District?
CREATE TABLE table_225199_4 (date_successor_seated VARCHAR, district VARCHAR)
SELECT state_country FROM table_1858574_2 WHERE position = 5
When 5 is the position what is the state or country?
CREATE TABLE table_1858574_2 (state_country VARCHAR, position VARCHAR)
SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the sum of manufacturer , and group by attribute founder, and I want to sort X-axis in asc order.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT successor FROM table_225200_4 WHERE date_successor_seated = "Not filled this congress"
Name the successor for not filled this congress
CREATE TABLE table_225200_4 (successor VARCHAR, date_successor_seated VARCHAR)
SELECT MIN(ansi_code) FROM table_18600760_1 WHERE pop__2010_ = 609
Name the least ansi code for 609 population 2010
CREATE TABLE table_18600760_1 (ansi_code INTEGER, pop__2010_ VARCHAR)
SELECT original_air_date FROM table_11951237_3 WHERE directed_by = "Timothy Van Patten"
What is theoriginal air date of the episode directed by timothy van patten?
CREATE TABLE table_11951237_3 ( original_air_date VARCHAR, directed_by VARCHAR )
SELECT district FROM table_225200_4 WHERE reason_for_change = "Rep. Warren R. Davis died during previous congress"
Name the district for rep. warren r. davis died during previous congress
CREATE TABLE table_225200_4 (district VARCHAR, reason_for_change VARCHAR)
SELECT MIN(ansi_code) FROM table_18600760_1 WHERE township = "Ashtabula"
Name the ansi code fore ashtabula
CREATE TABLE table_18600760_1 (ansi_code INTEGER, township VARCHAR)
SELECT congress FROM table_name_51 WHERE _number_of_cosponsors = 19
Which Congress has a # of cosponsors of 19?
CREATE TABLE table_name_51 ( congress VARCHAR, _number_of_cosponsors VARCHAR )
SELECT COUNT(reason_for_change) FROM table_225200_4 WHERE date_successor_seated = "Not filled this congress"
Name the total number of reason for change for not filled this congress
CREATE TABLE table_225200_4 (reason_for_change VARCHAR, date_successor_seated VARCHAR)
SELECT COUNT(land___sqmi__) FROM table_18600760_1 WHERE township = "Ada"
Name the land for ada
CREATE TABLE table_18600760_1 (land___sqmi__ VARCHAR, township VARCHAR)
SELECT "Conf. Record" FROM table_29290 WHERE "Standings" = 'First' AND "Season" = '2003-04'
What was the conference record for the Pandas when they were first in the standings in the 2003-04 season?
CREATE TABLE table_29290 ( "Season" text, "Coach" text, "Conf. Record" text, "Overall" text, "Standings" text, "Postseason" text )
SELECT vacator FROM table_225200_4 WHERE reason_for_change = "Resigned February 26, 1836 because of ill health"
Name the vacator for resigned february 26, 1836 because of ill health
CREATE TABLE table_225200_4 (vacator VARCHAR, reason_for_change VARCHAR)
SELECT MAX(position) FROM table_18597302_1 WHERE team = "Atl. Colegiales"
What was the position of the Atl. Colegiales team?
CREATE TABLE table_18597302_1 (position INTEGER, team VARCHAR)
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
SELECT vacator FROM table_225205_3 WHERE reason_for_change = "Failure to elect"
Name the vacator for failure to elect
CREATE TABLE table_225205_3 (vacator VARCHAR, reason_for_change VARCHAR)
SELECT COUNT(position) FROM table_18597302_1 WHERE points = 9
What was the position where the team scored 9 points?
CREATE TABLE table_18597302_1 (position VARCHAR, points VARCHAR)
SELECT business.name FROM business, category WHERE business.city = 'Los Angeles' AND business.review_count > 100 AND category.business_id = business.business_id AND category.category_name = 'restaurant'
Find all restaurant in ' Los Angeles ' with more than 100 reviews
CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar )
SELECT state__class_ FROM table_225205_3 WHERE reason_for_change = "Iowa admitted to the Union December 28, 1846"
Name the state class for iowa admitted to the union december 28, 1846
CREATE TABLE table_225205_3 (state__class_ VARCHAR, reason_for_change VARCHAR)
SELECT COUNT(eliminated_by) FROM table_18598175_2 WHERE time = "32:32"
How many player eliminated an opponent within the time frame of 32:32?
CREATE TABLE table_18598175_2 (eliminated_by VARCHAR, time VARCHAR)
SELECT campus FROM campuses WHERE location = "Chico"
What campuses are located in Chico?
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number )
SELECT vacator FROM table_225206_3 WHERE reason_for_change = "Failure to elect"
Who was the vacator when the reason for change was failure to elect?
CREATE TABLE table_225206_3 (vacator VARCHAR, reason_for_change VARCHAR)
SELECT method_of_elimination FROM table_18598175_2 WHERE time = "32:32"
What was the styled used to defeat the opponent within the time frame of 32:32?
CREATE TABLE table_18598175_2 (method_of_elimination VARCHAR, time VARCHAR)
SELECT COUNT(*) FROM table_204_805 WHERE "club" = 'ttm samut sakhon'
what is the number of managerial changes that ttm samut sakhon made in 2009 ?
CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text )
SELECT COUNT(nat) FROM table_22542179_3 WHERE total_g = 6
Name the number of nat for total g of 6
CREATE TABLE table_22542179_3 (nat VARCHAR, total_g VARCHAR)
SELECT eliminated_by FROM table_18598175_2 WHERE method_of_elimination = "Pedigree"
Who won the match when the winner used the Pedigree attack?
CREATE TABLE table_18598175_2 (eliminated_by VARCHAR, method_of_elimination VARCHAR)
SELECT "Jockey" FROM table_46430 WHERE "Horse" = 'eight belles'
What is Jockey, when Horse is 'Eight Belles'?
CREATE TABLE table_46430 ( "Finished" real, "Time/ Behind" text, "Post" real, "Horse" text, "Jockey" text, "Trainer" text, "Owner" text )
SELECT l_g FROM table_22542179_3 WHERE player = "Rubio"
Name the l g for rubio
CREATE TABLE table_22542179_3 (l_g VARCHAR, player VARCHAR)
SELECT MIN(elimination_number) FROM table_18598175_2 WHERE time = "27:27"
What was the elimination number of the fighter who fought within 27:27?
CREATE TABLE table_18598175_2 (elimination_number INTEGER, time VARCHAR)
SELECT "College" FROM table_29215 WHERE "Position" = 'DE'
What college did the player who played DE go to?
CREATE TABLE table_29215 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
SELECT MIN(total_apps) FROM table_22542179_3 WHERE player = "Txema"
Name the least total apaps for txema
CREATE TABLE table_22542179_3 (total_apps INTEGER, player VARCHAR)