answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT frequency FROM table_name_11 WHERE part_number_s_ = "au80610006240aa"
What is Frequency, when Part Number(s) is au80610006240aa?
CREATE TABLE table_name_11 ( frequency VARCHAR, part_number_s_ VARCHAR )
SELECT 1 AS st_leg FROM table_name_57 WHERE home__2nd_leg_ = "gimnasia de mendoza"
What was the score on the first leg when gimnasia de mendoza played at home for the second leg?
CREATE TABLE table_name_57 (home__2nd_leg_ VARCHAR)
SELECT world_rank_by_arwu_, _2013 FROM table_27484208_1 WHERE members = "University of Tübingen"
What was the world rank by ARWU in 2013 of the University of Tübingen?
CREATE TABLE table_27484208_1 (world_rank_by_arwu_ VARCHAR, _2013 VARCHAR, members VARCHAR)
SELECT "Away team score" FROM table_56516 WHERE "Crowd" > '13,000' AND "Home team" = 'hawthorn'
If the home team playing is hawthorn and there are more than 13,000 people in the crowd, what did the away team score?
CREATE TABLE table_56516 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT home__2nd_leg_ FROM table_name_39 WHERE aggregate = "2-4"
Which team played at home for the second leg and has an aggregate score of 2-4?
CREATE TABLE table_name_39 (home__2nd_leg_ VARCHAR, aggregate VARCHAR)
SELECT COUNT(no_in_series) FROM table_27481781_2 WHERE viewers__millions_ = "18.73"
How many episodes have 18.73 million viewers?
CREATE TABLE table_27481781_2 (no_in_series VARCHAR, viewers__millions_ VARCHAR)
SELECT "Date From" FROM table_49812 WHERE "Moving To" = 'birmingham city'
What is Date From, when Moving To is 'Birmingham City'?
CREATE TABLE table_49812 ( "Date From" text, "Date To" text, "Pos." text, "Name" text, "Moving To" text )
SELECT 2 AS nd_leg FROM table_name_84 WHERE home__2nd_leg_ = "atlético tucumán"
What was the 2nd leg score when atlético tucumán played at home?
CREATE TABLE table_name_84 (home__2nd_leg_ VARCHAR)
SELECT result FROM table_27487712_1 WHERE district = "Georgia's 3rd"
What was the result of the election for georgia's 3rd district?
CREATE TABLE table_27487712_1 (result VARCHAR, district VARCHAR)
SELECT score FROM table_name_24 WHERE date = "may 26"
What was the score of the game on May 26?
CREATE TABLE table_name_24 ( score VARCHAR, date VARCHAR )
SELECT record FROM table_name_85 WHERE res = "win" AND time = "5:00" AND round > 3
What is the record of the match with a win res., a 5:00 time, and more than 3 rounds?
CREATE TABLE table_name_85 (record VARCHAR, round VARCHAR, res VARCHAR, time VARCHAR)
SELECT incumbent FROM table_27487712_1 WHERE district = "Georgia's 8th"
Who was the incumbent from georgia's 8th district?
CREATE TABLE table_27487712_1 (incumbent VARCHAR, district VARCHAR)
SELECT "Week 2 Sept 7" FROM table_34490 WHERE "Week 7 Oct 12" = 'ball state (7-0)'
Which Week 2 Sept 7 has a Week 7 Oct 12 of ball state (7-0)?
CREATE TABLE table_34490 ( "Week 1 Sept 2" text, "Week 2 Sept 7" text, "Week 3 Sept 14" text, "Week 5 Sept 28" text, "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 10 Nov 2" text, "Week 13 Nov 23" text, "Week 14 Nov 30" text, "Week 15 Dec 7" text, "Week 16 (Final) Jan 9" text )
SELECT method FROM table_name_22 WHERE opponent = "georges st-pierre"
What is the method of opponent georges st-pierre?
CREATE TABLE table_name_22 (method VARCHAR, opponent VARCHAR)
SELECT result FROM table_27487712_1 WHERE incumbent = "Bob Barr"
What was the result of the election with incumbent bob barr?
CREATE TABLE table_27487712_1 (result VARCHAR, incumbent 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA'
i'd like a flight on AA from NEWARK to NASHVILLE
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) 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_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 compartment_class ( compartment varchar, class_type 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 food_service ( meal_code text, meal_number int, compartment text, meal_description 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE month ( month_number int, month_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 code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id 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 time_interval ( period text, begin_time int, end_time int )
SELECT location FROM table_name_46 WHERE round = 3 AND event = "fightfest 2"
What is the location of fightfest 2, which has 3 rounds?
CREATE TABLE table_name_46 (location VARCHAR, round VARCHAR, event VARCHAR)
SELECT result FROM table_27487712_1 WHERE incumbent = "John Lewis"
What was the result of the election with incumbent john lewis?
CREATE TABLE table_27487712_1 (result VARCHAR, incumbent VARCHAR)
SELECT producer_s_ FROM table_name_50 WHERE director_s_ = "daniel cormack"
Which producer did Daniel Cormack direct?
CREATE TABLE table_name_50 ( producer_s_ VARCHAR, director_s_ VARCHAR )
SELECT opponent FROM table_name_21 WHERE time = "1:19"
Who is the opponent with a time of 1:19?
CREATE TABLE table_name_21 (opponent VARCHAR, time VARCHAR)
SELECT incumbent FROM table_27487712_1 WHERE elected = 1978
Who was the incumbent for the election in 1978?
CREATE TABLE table_27487712_1 (incumbent VARCHAR, elected VARCHAR)
SELECT date FROM table_17288869_7 WHERE high_rebounds = "Dirk Nowitzki (14)"
On what day did Dirk Nowitzki (14) have a high rebound?
CREATE TABLE table_17288869_7 ( date VARCHAR, high_rebounds VARCHAR )
SELECT opponent FROM table_name_81 WHERE record = "0-1"
Who is the opponent with a 0-1 record?
CREATE TABLE table_name_81 (opponent VARCHAR, record VARCHAR)
SELECT judges FROM table_27487310_5 WHERE country = "Netherlands" AND air_dates = "28 November 2011 – 24 December 2011"
Who are the judges in the Netherlands for the season airing 28 November 2011 – 24 December 2011?
CREATE TABLE table_27487310_5 (judges VARCHAR, country VARCHAR, air_dates VARCHAR)
SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the nurse has the most appointments?
CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE nurse ( employeeid number, name text, position text, registered boolean, ssn number ) CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable boolean ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, oncallstart time, oncallend time ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE affiliated_with ( physician number, department number, primaryaffiliation boolean ) CREATE TABLE appointment ( appointmentid number, patient number, prepnurse number, physician number, start time, end time, examinationroom text ) CREATE TABLE stay ( stayid number, patient number, room number, staystart time, stayend time ) CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE physician ( employeeid number, name text, position text, ssn number ) CREATE TABLE patient ( ssn number, name text, address text, phone text, insuranceid number, pcp number ) CREATE TABLE block ( blockfloor number, blockcode number ) CREATE TABLE department ( departmentid number, name text, head number )
SELECT COUNT(rank_by_average) FROM table_name_12 WHERE total_points > 392 AND average = 24.8
What is the total rank with more than 392 total points and an 24.8 average?
CREATE TABLE table_name_12 (rank_by_average VARCHAR, total_points VARCHAR, average VARCHAR)
SELECT name FROM table_27487310_5 WHERE network = "SBS 6"
What is the version aired on SBS 6 called?
CREATE TABLE table_27487310_5 (name VARCHAR, network VARCHAR)
SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'goalie')
What is the count of states with college students playing in the mid position but not as goalies?
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
SELECT MAX(average) FROM table_name_62 WHERE place < 3 AND total_points < 433 AND rank_by_average < 2
What is the highest average with less than 3 places, less than 433 total points, and a rank less than 2?
CREATE TABLE table_name_62 (average INTEGER, rank_by_average VARCHAR, place VARCHAR, total_points VARCHAR)
SELECT air_dates FROM table_27487310_5 WHERE network = "ABS-CBN"
What are the air dates of the show in ABS-CBN?
CREATE TABLE table_27487310_5 (air_dates VARCHAR, network VARCHAR)
SELECT COUNT("Title") FROM table_3516 WHERE "Written by" = 'Charleen Easton'
What is the number of titles written by Charleen Easton?
CREATE TABLE table_3516 ( "Episode #" text, "Season Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text )
SELECT COUNT(average) FROM table_name_34 WHERE total_points = 54 AND rank_by_average < 10
What is the total average with 54 total points and a rank less than 10?
CREATE TABLE table_name_34 (average VARCHAR, total_points VARCHAR, rank_by_average VARCHAR)
SELECT host_s_ FROM table_27487310_5 WHERE air_dates = "18 January 2012"
Who is the host on the series aired on 18 January 2012?
CREATE TABLE table_27487310_5 (host_s_ VARCHAR, air_dates VARCHAR)
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin - sliding scale administration' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', microlab.culturetakentime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.culturetakentime, 'start of month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 5
what were the five most commonly ordered microbiology tests for patients who previously received a insulin - sliding scale administration during the same month since 2105?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT COUNT(rank_by_average) FROM table_name_99 WHERE number_of_dances = 2 AND total_points > 37
What is the total rank by average for 2 dances, which have more than 37 total points?
CREATE TABLE table_name_99 (rank_by_average VARCHAR, number_of_dances VARCHAR, total_points VARCHAR)
SELECT name FROM table_27487310_5 WHERE host_s_ = "unknown"
What is the name of the series with the unknown host?
CREATE TABLE table_27487310_5 (name VARCHAR, host_s_ VARCHAR)
SELECT COUNT("Total passengers") FROM table_38482 WHERE "Domestic passengers" = '2,803,907' AND "Year" > '1999'
what total number of passengers is domestic and larger than 2,803,907 and a year after 1999?
CREATE TABLE table_38482 ( "Year" real, "Domestic passengers" real, "International passengers" real, "Total passengers" real, "Change" text )
SELECT championship FROM table_name_86 WHERE opponent_in_the_final = "aaron krickstein" AND score_in_the_final = "7–5, 6–2"
What Championship has an Opponent in the final of aaron krickstein, and a Score in the final of 7–5, 6–2?
CREATE TABLE table_name_86 (championship VARCHAR, opponent_in_the_final VARCHAR, score_in_the_final VARCHAR)
SELECT points_per_game FROM table_27487336_1 WHERE passing_yards_per_game = "179.6"
What is every value for points per game if passing yards per game is 179.6?
CREATE TABLE table_27487336_1 (points_per_game VARCHAR, passing_yards_per_game VARCHAR)
SELECT record FROM table_name_17 WHERE location_attendance = "td banknorth garden 18,624"
What is Record, when Location Attendance is 'TD Banknorth Garden 18,624'?
CREATE TABLE table_name_17 ( record VARCHAR, location_attendance VARCHAR )
SELECT score_in_the_final FROM table_name_44 WHERE surface = "hard" AND championship = "washington, d.c. , u.s." AND opponent_in_the_final = "ivan lendl"
What Score in the final has a Surface of hard, a Championship of washington, d.c. , u.s., and an Opponent in the final of ivan lendl?
CREATE TABLE table_name_44 (score_in_the_final VARCHAR, opponent_in_the_final VARCHAR, surface VARCHAR, championship VARCHAR)
SELECT sacks FROM table_27487336_1 WHERE interceptions = "19"
What is every value for sacks if interceptions is 19?
CREATE TABLE table_27487336_1 (sacks VARCHAR, interceptions VARCHAR)
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
For those employees who did not have any job in the past, return a line chart about the change of manager_id over hire_date , and show X-axis from high to low order.
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
SELECT MAX(number_of_seasons_in_liga_mx) FROM table_name_27 WHERE club = "cruz azul"
What is the highest Number of seasons in Liga MX for Club cruz azul?
CREATE TABLE table_name_27 (number_of_seasons_in_liga_mx INTEGER, club VARCHAR)
SELECT passing_yards_per_game FROM table_27487336_1 WHERE rushing_yards_per_game = "113.6"
What is every value for passing yards per game if rushing yards per game is 113.6?
CREATE TABLE table_27487336_1 (passing_yards_per_game VARCHAR, rushing_yards_per_game VARCHAR)
SELECT SUM("Against") FROM table_50665 WHERE "Opposing Team" = 'cuyo selection'
Sum of cuyo selection as the opposing team?
CREATE TABLE table_50665 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Status" text )
SELECT MAX(number_of_seasons_in_liga_mx) FROM table_name_33 WHERE club = "cruz azul" AND number_of_seasons_in_top_division > 68
What is the highest Number of seasons in Liga MX for Club cruz azul, when their season in the top division is higher than 68?
CREATE TABLE table_name_33 (number_of_seasons_in_liga_mx INTEGER, club VARCHAR, number_of_seasons_in_top_division VARCHAR)
SELECT rushing_yards_per_game FROM table_27487336_1 WHERE sacks = "25"
What is every value for rushing yards per game if sacks if 25?
CREATE TABLE table_27487336_1 (rushing_yards_per_game VARCHAR, sacks VARCHAR)
SELECT COUNT(native_american) FROM table_1333612_1 WHERE whites = "1.0%"
how many native american with whites being 1.0%
CREATE TABLE table_1333612_1 ( native_american VARCHAR, whites VARCHAR )
SELECT COUNT(top_division_titles) FROM table_name_55 WHERE number_of_seasons_in_top_division > 40 AND first_season_of_current_spell_in_top_division = "1943-44" AND number_of_seasons_in_liga_mx > 89
What is the total number of Top division titles for the club that has more than 40 seasons in top division, a First season of current spell in top division of 1943-44, and more than 89 seasons in Liga MX?
CREATE TABLE table_name_55 (top_division_titles VARCHAR, number_of_seasons_in_liga_mx VARCHAR, number_of_seasons_in_top_division VARCHAR, first_season_of_current_spell_in_top_division VARCHAR)
SELECT rushing_yards_per_game FROM table_27487336_1 WHERE season = "1984"
What is every value for rushing yards per game if the season is 1984?
CREATE TABLE table_27487336_1 (rushing_yards_per_game VARCHAR, season VARCHAR)
SELECT MIN(first_elected) FROM table_name_86 WHERE incumbent = "dave reichert"
When was the earliest incumbent dave reichert was first elected?
CREATE TABLE table_name_86 ( first_elected INTEGER, incumbent VARCHAR )
SELECT SUM(top_division_titles) FROM table_name_66 WHERE number_of_seasons_in_liga_mx > 42 AND club = "guadalajara"
How many top division titles does Club Guadalajara have, with more than 42 seasons in Liga MX?
CREATE TABLE table_name_66 (top_division_titles INTEGER, number_of_seasons_in_liga_mx VARCHAR, club VARCHAR)
SELECT COUNT(season) FROM table_27487336_1 WHERE sacks = "39"
How many seasons have a sacks of 39?
CREATE TABLE table_27487336_1 (season VARCHAR, sacks VARCHAR)
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p thoracotomy - decortication' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.diagnosistime) > 4 * 365) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid
what's the four year survival rate of a person diagnosed with s/p thoracotomy - decortication?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT club FROM table_name_32 WHERE number_of_seasons_in_liga_mx < 40 AND number_of_seasons_in_top_division = 65
Which club has fewer than 40 seasons in Liga MX and 65 seasons in the top division?
CREATE TABLE table_name_32 (club VARCHAR, number_of_seasons_in_liga_mx VARCHAR, number_of_seasons_in_top_division VARCHAR)
SELECT average FROM table_27496841_3 WHERE rank_by_average = 3
Name the average for rank of 3
CREATE TABLE table_27496841_3 (average VARCHAR, rank_by_average VARCHAR)
SELECT demographic.dod FROM demographic WHERE demographic.name = "Kelly Gallardo"
what is the date of death of patient name kelly gallardo?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT SUM(number) FROM table_name_4 WHERE location = "bois de warville" AND time < 810
What number is in Bois de Warville with a time less than 810?
CREATE TABLE table_name_4 (number INTEGER, location VARCHAR, time VARCHAR)
SELECT total_points FROM table_27496841_3 WHERE place = 2
Name the total points for 2
CREATE TABLE table_27496841_3 (total_points VARCHAR, place VARCHAR)
SELECT "name" FROM table_204_489 ORDER BY "floors" DESC LIMIT 1
which building has the most floors according to this chart ?
CREATE TABLE table_204_489 ( id number, "rank" number, "name" text, "height" text, "floors" number, "year" number, "notes" text )
SELECT MAX(time) FROM table_name_24 WHERE number = 21
What is number 21's highest time?
CREATE TABLE table_name_24 (time INTEGER, number VARCHAR)
SELECT decision FROM table_27501030_7 WHERE opponent = "Atlanta Thrashers"
What is the decision when the opponents are atlanta thrashers?
CREATE TABLE table_27501030_7 (decision VARCHAR, opponent VARCHAR)
SELECT "race distance\nlaps" FROM table_204_604 WHERE "date" = 'february 26'
how many laps did matt kenset complete on february 26 , 2006 .
CREATE TABLE table_204_604 ( id number, "year" number, "date" text, "driver" text, "team" text, "manufacturer" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text )
SELECT SUM(number) FROM table_name_89 WHERE opponent = "fokker d.vii" AND time = 1655
What number with the opponent Fokker D.vii have with a time of 1655?
CREATE TABLE table_name_89 (number INTEGER, opponent VARCHAR, time VARCHAR)
SELECT COUNT(game) FROM table_27501030_7 WHERE points = 57
How many game entries are there when the points are 57?
CREATE TABLE table_27501030_7 (game VARCHAR, points VARCHAR)
SELECT "Series" FROM table_18977 WHERE "Date" = 'May 23'
What was the series count at on May 23?
CREATE TABLE table_18977 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
SELECT opponent FROM table_name_5 WHERE time > 1040 AND aircraft = "spad xiii" AND number < 22 AND location = "dun-sur-meuse"
Who is the opponent with a time higher than 1040, a Spad xiii aircraft in Dun-Sur-Meuse with a lower number than 22?
CREATE TABLE table_name_5 (opponent VARCHAR, location VARCHAR, number VARCHAR, time VARCHAR, aircraft VARCHAR)
SELECT MIN(año) FROM table_27501971_2
What is the smallest año?
CREATE TABLE table_27501971_2 (año INTEGER)
SELECT "Cross Code Debut" FROM table_64937 WHERE "Player" = 'bev risman'
What is Bev Risman's Cross Code Debut?
CREATE TABLE table_64937 ( "Player" text, "Int'l Debut" text, "Year" text, "Cross Code Debut" text, "Date" text )
SELECT SUM(number) FROM table_name_66 WHERE opponent = "fokker d.vii" AND time = 600
What number has the opponent Fokker d.vii with a time of 600?
CREATE TABLE table_name_66 (number INTEGER, opponent VARCHAR, time VARCHAR)
SELECT COUNT(premio) FROM table_27501971_2 WHERE categoría = "Artist of the Year"
How many premio are there when "Artist of the Year" was the categoria?
CREATE TABLE table_27501971_2 (premio VARCHAR, categoría VARCHAR)
SELECT MAX(rank_final) FROM table_26681728_1 WHERE score_final = "14.975"
What was the maximum rank-final value for a score of 14.975?
CREATE TABLE table_26681728_1 ( rank_final INTEGER, score_final VARCHAR )
SELECT name FROM table_name_27 WHERE floors > 36 AND years_as_tallest = "1986–1992"
What is the Name of the Building with 36 or more Floors with Years as tallest of 1986–1992?
CREATE TABLE table_name_27 (name VARCHAR, floors VARCHAR, years_as_tallest VARCHAR)
SELECT resultado FROM table_27501971_2 WHERE country = "E.E.U.U"
What was the resultado when E.E.U.U was the country?
CREATE TABLE table_27501971_2 (resultado VARCHAR, country VARCHAR)
SELECT "Away team score" FROM table_77624 WHERE "Home team score" = '14.14 (98)'
When the Home team scored 14.14 (98), what did the Away Team score?
CREATE TABLE table_77624 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT years_as_tallest FROM table_name_55 WHERE height_ft__m_ = "145 (44)"
What is the Years as tallest of the Building with a Height ft (m) of 145 (44)?
CREATE TABLE table_name_55 (years_as_tallest VARCHAR, height_ft__m_ VARCHAR)
SELECT categoría FROM table_27501971_2 WHERE country = "E.E.U.U"
What was the categoria when E.E.U.U was the country?
CREATE TABLE table_27501971_2 (categoría VARCHAR, country VARCHAR)
SELECT "Venue" FROM table_45340 WHERE "Date" = '16 january 1996'
what is the venue when the date is 16 january 1996?
CREATE TABLE table_45340 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT street_address FROM table_name_70 WHERE floors = 17
What is the Street Address of the Building with 17 Floors?
CREATE TABLE table_name_70 (street_address VARCHAR, floors VARCHAR)
SELECT country FROM table_27501971_2 WHERE año = 2012
When the año was 2012, who was the county?
CREATE TABLE table_27501971_2 (country VARCHAR, año VARCHAR)
SELECT "Party" FROM table_793 WHERE "Incumbent" = 'Richard S. Whaley'
What was the winning party when the incumbent was richard s. whaley?
CREATE TABLE table_793 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
SELECT name FROM table_name_28 WHERE street_address = "100 north tampa street"
What is the Name of the Building at 100 North Tampa Street?
CREATE TABLE table_name_28 (name VARCHAR, street_address VARCHAR)
SELECT written_by FROM table_27504682_1 WHERE directed_by = "Lawrence Trilling"
Name who wrote the episode by lawrence trilling
CREATE TABLE table_27504682_1 (written_by VARCHAR, directed_by VARCHAR)
SELECT "Notes" FROM table_64606 WHERE "Time" = '3:19.167'
What are the notes for the time at 3:19.167?
CREATE TABLE table_64606 ( "Rank" real, "Athletes" text, "Country" text, "Time" text, "Notes" text )
SELECT away FROM table_name_68 WHERE round = "q3"
What away is there for the q3 round?
CREATE TABLE table_name_68 (away VARCHAR, round VARCHAR)
SELECT original_air_date FROM table_27504682_1 WHERE written_by = "Alex Taub"
Name the air date for alex taub
CREATE TABLE table_27504682_1 (original_air_date VARCHAR, written_by VARCHAR)
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name DESC
Bar chart of minimal salary from each dept name, and list in descending by the X-axis please.
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) )
SELECT aggregate FROM table_name_56 WHERE opponents = "bayer leverkusen"
What is the Aggregate of Bayer Leverkusen opponents?
CREATE TABLE table_name_56 (aggregate VARCHAR, opponents VARCHAR)
SELECT COUNT(opponent) FROM table_27501030_8 WHERE game = 69
How many games were numbered 69?
CREATE TABLE table_27501030_8 (opponent VARCHAR, game VARCHAR)
SELECT MIN(year) FROM table_name_41 WHERE attendance = 77 OFFSET 254
When was the earliest year when the attendance was 77,254?
CREATE TABLE table_name_41 ( year INTEGER, attendance VARCHAR )
SELECT competition FROM table_name_80 WHERE venue = "serravalle, san marino"
What is the competition that was at serravalle, san marino?
CREATE TABLE table_name_80 (competition VARCHAR, venue VARCHAR)
SELECT COUNT(march) FROM table_27501030_8 WHERE opponent = "Pittsburgh Penguins"
How many times did they play the pittsburgh penguins?
CREATE TABLE table_27501030_8 (march VARCHAR, opponent VARCHAR)
SELECT MIN("Result") FROM table_72859 WHERE "3rd throw" = 'not 8'
What is the result when the 3rd throw is not 8?
CREATE TABLE table_72859 ( "1st throw" real, "2nd throw" real, "3rd throw" text, "Equation" text, "Result" real )
SELECT venue FROM table_name_78 WHERE result = "won" AND competition = "friendly" AND date = "28 may 2012"
Where was the friendly competition that Andriy Yarmolenko won on 28 may 2012?
CREATE TABLE table_name_78 (venue VARCHAR, date VARCHAR, result VARCHAR, competition VARCHAR)
SELECT MIN(qtr_final__week_) FROM table_27529608_21 WHERE genre = "Dancing" AND age_s_ = "32"
What is the earliest quarterfinal week when the genre is dancing and the act is 32?
CREATE TABLE table_27529608_21 (qtr_final__week_ INTEGER, genre VARCHAR, age_s_ VARCHAR)
SELECT MAX(erp_w) FROM table_name_94 WHERE call_sign = "w284av"
What is the highest ERP W of the translator with a call sign of w284av?
CREATE TABLE table_name_94 ( erp_w INTEGER, call_sign VARCHAR )
SELECT result FROM table_name_2 WHERE venue = "kyiv, ukraine"
What is the result of the game at kyiv, ukraine?
CREATE TABLE table_name_2 (result VARCHAR, venue VARCHAR)
SELECT MIN(qtr_final__week_) FROM table_27529608_21 WHERE name_name_of_act = "Austin Anderson"
What is the quarterfinal week for Austin Anderson?
CREATE TABLE table_27529608_21 (qtr_final__week_ INTEGER, name_name_of_act VARCHAR)
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI"
what is minimum age of patients whose gender is m and discharge location is left against medical advi?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE 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 )