answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT scores FROM table_29141354_2 WHERE jamie_and_johns_guest = "Phillips Idowu"
What were the scores when Jamie and Johns guest was Phillips Idowu?
CREATE TABLE table_29141354_2 (scores VARCHAR, jamie_and_johns_guest VARCHAR)
SELECT "hospital" FROM table_203_216 WHERE "rank" IN (8, 9)
what two hospitals holding consecutive rankings of 8 and 9 respectively , both provide 1200 hospital beds ?
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text )
SELECT COUNT(population) FROM table_25200461_9 WHERE city = "Santa Clara"
If the city is Santa Clara, what is the population total number?
CREATE TABLE table_25200461_9 (population VARCHAR, city VARCHAR)
SELECT first_broadcast FROM table_29141354_2 WHERE episode = "02x02"
When was episode 02x02 first broadcast?
CREATE TABLE table_29141354_2 (first_broadcast VARCHAR, episode VARCHAR)
SELECT COUNT(location_attendance) FROM table_17080868_6 WHERE date = "December 29"
what is the total number of attendance where the date is december 29?
CREATE TABLE table_17080868_6 ( location_attendance VARCHAR, date VARCHAR )
SELECT prefecture FROM table_2518850_4 WHERE city_town = "Susaki"
In what prefecture is Susaki located?
CREATE TABLE table_2518850_4 (prefecture VARCHAR, city_town VARCHAR)
SELECT andrew_and_georgies_guest FROM table_29141354_2 WHERE jamie_and_johns_guest = "Jessica Ennis"
Who was Andrew and Georgies guest when Jamie and Johns guest was Jessica Ennis?
CREATE TABLE table_29141354_2 (andrew_and_georgies_guest VARCHAR, jamie_and_johns_guest 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 ((date_day.day_number = 24 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time < 1800 AND flight.flight_days = days.days_code) OR (date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 700 AND flight.flight_days = days.days_code)) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
list all flights going from BOSTON to ATLANTA after 1800 o'clock on wednesday and before 700 o'clock am on thursday
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) 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_leg ( flight_id int, leg_number int, leg_flight 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 ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 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 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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE code_description ( code varchar, 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 ) 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 flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 )
SELECT COUNT(year_of_previous_participation) FROM table_2518850_4 WHERE total_number_of_participation = 1 AND high_school_name = "Maebashi Ikuei"
How many previous years did Maebashi Ikuei high school have a total number of 1 participation?
CREATE TABLE table_2518850_4 (year_of_previous_participation VARCHAR, total_number_of_participation VARCHAR, high_school_name VARCHAR)
SELECT first_broadcast FROM table_29141354_2 WHERE episode = "02x07"
When was episode 02x07 first broadcast?
CREATE TABLE table_29141354_2 (first_broadcast VARCHAR, episode VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other bronchoscopy"
how many patients whose procedure long title is other bronchoscopy?
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 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 )
SELECT prefecture FROM table_2518850_4 WHERE high_school_name = "Nihon Bunri"
In what prefecture is Nihon Bunri located?
CREATE TABLE table_2518850_4 (prefecture VARCHAR, high_school_name VARCHAR)
SELECT top_mc FROM table_29160596_1 WHERE year_inducted = 2007 AND peak_ranking = 6
List all the MCs with peak ranking of 6 who were inducted in 2007.
CREATE TABLE table_29160596_1 (top_mc VARCHAR, year_inducted VARCHAR, peak_ranking 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 = 'TACOMA' AND date_day.day_number = 10 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 = 'BURBANK' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
are there any flights on 6 10 from BURBANK to TACOMA
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 days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id 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 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, 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 ( 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
SELECT prefecture FROM table_2518850_4 WHERE city_town = "Daito"
In what prefecture is Daito located?
CREATE TABLE table_2518850_4 (prefecture VARCHAR, city_town VARCHAR)
SELECT top_mc FROM table_29160596_1 WHERE appearances = 5 AND year_inducted = 2007
List all the MCs with 5 appearances who were inducted in 2007?
CREATE TABLE table_29160596_1 (top_mc VARCHAR, appearances VARCHAR, year_inducted VARCHAR)
SELECT to_par FROM table_name_10 WHERE money___$__ = 800
Which to par has a prize less than $800?
CREATE TABLE table_name_10 ( to_par VARCHAR, money___$__ VARCHAR )
SELECT high_school_name FROM table_2518850_4 WHERE prefecture = "Kyoto"
Which high school is located in Kyoto?
CREATE TABLE table_2518850_4 (high_school_name VARCHAR, prefecture VARCHAR)
SELECT MAX(appearances) FROM table_29160596_1 WHERE top_mc = "Meek Mill"
How many appearances by Meek Mill?
CREATE TABLE table_29160596_1 (appearances INTEGER, top_mc VARCHAR)
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'total cholesterol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY cost.patienthealthsystemstayid) AS t1
what is the minimum total hospital cost that includes the total cholesterol lab test until 3 years ago?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE 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 year_of_previous_participation FROM table_2518850_4 WHERE prefecture = "Kagoshima"
What was the year of previous participation for the school in the Kagoshima prefecture?
CREATE TABLE table_2518850_4 (year_of_previous_participation VARCHAR, prefecture VARCHAR)
SELECT championship FROM table_29163303_1 WHERE score = "6–7 (4–7) , 3–6"
What are the championship venues where the score was 6–7 (4–7) , 3–6?
CREATE TABLE table_29163303_1 (championship VARCHAR, score VARCHAR)
SELECT MAX("Crowd") FROM table_56750 WHERE "Home team" = 'north melbourne'
What is the largest Crowd number for the Home team of North Melbourne?
CREATE TABLE table_56750 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT january_15_16 FROM table_25216791_3 WHERE march_27_29 = "March 29, 2006"
What was the data on January 15-16 if March 27-29 is March 29, 2006?
CREATE TABLE table_25216791_3 (january_15_16 VARCHAR, march_27_29 VARCHAR)
SELECT surface FROM table_29163303_1 WHERE championship = "Australian Open (6)"
On what surface was the Australian Open (6) played on?
CREATE TABLE table_29163303_1 (surface VARCHAR, championship VARCHAR)
SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year DESC
Can you draw the trend of maximal score over the year?, rank by the x-axis in descending.
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT )
SELECT november_3 FROM table_25216791_3 WHERE january_15_16 = "January 15, 2010"
What was the data on November 3, if the data on January 15-16 is January 15, 2010?
CREATE TABLE table_25216791_3 (november_3 VARCHAR, january_15_16 VARCHAR)
SELECT partner FROM table_29163303_1 WHERE year = 2003 AND surface = "Hard"
Who was Bob Bryan's partner/s on a hard surface in 2003?
CREATE TABLE table_29163303_1 (partner VARCHAR, year VARCHAR, surface VARCHAR)
SELECT COUNT("peak name") FROM table_203_808 WHERE "elevation" < 3200
how many peaks are below 3200 feet ?
CREATE TABLE table_203_808 ( id number, "rank" number, "peak name" text, "elevation" text, "location" text, "notes" text )
SELECT COUNT(january_15_16) FROM table_25216791_3 WHERE august_21_22 = "155"
How many datas were recorded on January 15-16 if August 21-22 is 155?
CREATE TABLE table_25216791_3 (january_15_16 VARCHAR, august_21_22 VARCHAR)
SELECT shipyard FROM table_291768_1 WHERE commissioned = "November 30, 1970"
which vessel area was called for on november 30, 1970
CREATE TABLE table_291768_1 (shipyard VARCHAR, commissioned VARCHAR)
SELECT written_by FROM table_24018430_3 WHERE directed_by = "Shannon Flynn"
what is writtenand directed by shannon flynn?
CREATE TABLE table_24018430_3 ( written_by VARCHAR, directed_by VARCHAR )
SELECT january_15_16 FROM table_25216791_3 WHERE june_10_11 = "June 10, 1964"
What was the data on January 15-16 if the data recorded June 10-11 is June 10, 1964?
CREATE TABLE table_25216791_3 (january_15_16 VARCHAR, june_10_11 VARCHAR)
SELECT commissioned FROM table_291768_1 WHERE launched = "September 20, 1968"
what project was initially started before september 20, 1968
CREATE TABLE table_291768_1 (commissioned VARCHAR, launched VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Cont inv mec ven 96+ hrs"
provide the number of patients whose admission type is emergency and procedure short title is cont inv mec ven 96+ hrs?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(points_for) FROM table_25229283_4 WHERE percentage___percentage_ = "94.29"
How many data are on points for if the percentage is 94.29?
CREATE TABLE table_25229283_4 (points_for VARCHAR, percentage___percentage_ VARCHAR)
SELECT launched FROM table_291768_1 WHERE commissioned = "August 6, 1969"
when was the first start date that actually began on august 6, 1969
CREATE TABLE table_291768_1 (launched VARCHAR, commissioned VARCHAR)
SELECT SUM(occ_championships) FROM table_name_96 WHERE school = "central crossing"
How many times have Central Crossing won the OCC Championship?
CREATE TABLE table_name_96 ( occ_championships INTEGER, school VARCHAR )
SELECT opponent FROM table_25229283_4 WHERE points_for = 177
Who was the opponent with a points for of 177?
CREATE TABLE table_25229283_4 (opponent VARCHAR, points_for VARCHAR)
SELECT directed_by FROM table_29273057_1 WHERE production_code = "IP01003"
Who directed the episode with production code ip01003?
CREATE TABLE table_29273057_1 (directed_by VARCHAR, production_code VARCHAR)
SELECT COUNT(game) FROM table_22654073_13 WHERE date = "May 11"
How many games were played on May 11?
CREATE TABLE table_22654073_13 ( game VARCHAR, date VARCHAR )
SELECT MIN(points_against) FROM table_25229283_4 WHERE opponent = "Port Adelaide"
What was the minimum points against if the opponent is Port Adelaide?
CREATE TABLE table_25229283_4 (points_against INTEGER, opponent VARCHAR)
SELECT poles FROM table_29434211_1 WHERE series = "European F3 Open"
How many poles does the European F3 Open series have?
CREATE TABLE table_29434211_1 (poles VARCHAR, series VARCHAR)
SELECT "driver" FROM table_204_496 ORDER BY "pos" DESC LIMIT 1
at the 2006 gran premio telmex , who finished last ?
CREATE TABLE table_204_496 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
SELECT rider FROM table_25220821_3 WHERE thurs_3_june = "20' 27.93 110.615mph"
If Thursday 3 June is 20' 27.93 110.615mph, what are the names of the riders?
CREATE TABLE table_25220821_3 (rider VARCHAR, thurs_3_june VARCHAR)
SELECT MAX(season) FROM table_29434211_1 WHERE podiums = 2
What is the maximum season that has exactly 2 podiums?
CREATE TABLE table_29434211_1 (season INTEGER, podiums VARCHAR)
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'moexipril' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
in a year before, how many prescriptions were written for moexipril?
CREATE TABLE d_labitems ( row_id number, itemid number, label 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 )
SELECT COUNT(tues_1_june) FROM table_25220821_3 WHERE mon_31_may = "20' 15.35 111.761mph"
What is the Tuesday 1 June total number if Monday 31 May is 20' 15.35 111.761mph?
CREATE TABLE table_25220821_3 (tues_1_june VARCHAR, mon_31_may VARCHAR)
SELECT written_by FROM table_29436007_1 WHERE no_in_season = 23
Who wrote episode 23 of the season?
CREATE TABLE table_29436007_1 (written_by VARCHAR, no_in_season VARCHAR)
SELECT "Date" FROM table_33717 WHERE "Opponent" = 'new orleans saints'
What day did they play the New Orleans Saints?
CREATE TABLE table_33717 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT fri_4_june FROM table_25220821_3 WHERE wed_2_june = "20' 11.98 112.071mph"
What is Friday 4 June if Wednesday 2 June is 20' 11.98 112.071mph?
CREATE TABLE table_25220821_3 (fri_4_june VARCHAR, wed_2_june VARCHAR)
SELECT COUNT(season) FROM table_29471472_1 WHERE position = "3rd"
How many seasons are there for the 3rd position?
CREATE TABLE table_29471472_1 (season VARCHAR, position VARCHAR)
SELECT iata FROM table_name_52 WHERE icao = "wipp"
What is the IATA when the ICAO is wipp?
CREATE TABLE table_name_52 ( iata VARCHAR, icao VARCHAR )
SELECT COUNT(rider) FROM table_25220821_3 WHERE tues_1_june = "21' 05.27 107.351mph"
If Tuesday 1 June is 21' 05.27 107.351mph, what is the rider total number?
CREATE TABLE table_25220821_3 (rider VARCHAR, tues_1_june VARCHAR)
SELECT MAX(season) FROM table_29471472_1 WHERE team = "Autosport Academy"
What season was the team autosport academy?
CREATE TABLE table_29471472_1 (season INTEGER, team VARCHAR)
SELECT "Season" FROM table_24966 WHERE "No." = '4'
What is the year range of season 4?
CREATE TABLE table_24966 ( "No." real, "Season" text, "Championship" real, "No. of teams" real, "Start (reg. season)" text, "Finish (incl. championship)" text, "Top record" text, "National Champion" text )
SELECT MAX(rank) FROM table_25220821_3 WHERE tues_1_june = "20' 59.60 107.834mph"
If Tuesday 1 June is 20' 59.60 107.834mph, what is the rank maximum?
CREATE TABLE table_25220821_3 (rank INTEGER, tues_1_june VARCHAR)
SELECT series FROM table_29471472_1 WHERE races = 7
What is the series for race 7
CREATE TABLE table_29471472_1 (series VARCHAR, races VARCHAR)
SELECT score FROM table_27756572_10 WHERE date = "March 26"
What was the score in the game on March 26?
CREATE TABLE table_27756572_10 ( score VARCHAR, date VARCHAR )
SELECT fri_4_june FROM table_25220821_3 WHERE wed_2_june = "20' 50.62 108.608mph"
What is the Friday 4 June if the Wednesday 2 June is 20' 50.62 108.608mph?
CREATE TABLE table_25220821_3 (fri_4_june VARCHAR, wed_2_june VARCHAR)
SELECT MIN(season) FROM table_29471472_1 WHERE podiums = 7
What season shows podium 7?
CREATE TABLE table_29471472_1 (season INTEGER, podiums VARCHAR)
SELECT date FROM table_name_59 WHERE opponents_in_the_final = "valeria casillo lilly raffa"
Which Date has Opponents in the final of valeria casillo lilly raffa?
CREATE TABLE table_name_59 ( date VARCHAR, opponents_in_the_final VARCHAR )
SELECT wed_2_june FROM table_25220821_4 WHERE thurs_3_june = "17' 48.58 127.111mph"
What is the 2 June time for the rider with time of 17' 48.58 127.111mph on 3 June?
CREATE TABLE table_25220821_4 (wed_2_june VARCHAR, thurs_3_june VARCHAR)
SELECT COUNT(french_head_of_state) FROM table_29474481_4 WHERE head_of_mission = "Xavier Daufresne de la Chevalerie"
How many French heads of state have a head of mission of Xavier Daufresne de la Chevalerie?
CREATE TABLE table_29474481_4 (french_head_of_state VARCHAR, head_of_mission VARCHAR)
SELECT "Place" FROM table_59954 WHERE "Money ( $ )" = '150' AND "Player" = 'bobby cruickshank'
Which Place that has Money of 150, and a Player of bobby cruickshank?
CREATE TABLE table_59954 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
SELECT COUNT(mon_31_may) FROM table_25220821_4 WHERE rank = 5
How many times are listed for 31 May for the rider ranked 5?
CREATE TABLE table_25220821_4 (mon_31_may VARCHAR, rank VARCHAR)
SELECT location___city FROM table_29483673_1 WHERE institution = "Tiffin University"
What city is Tiffin University located in?
CREATE TABLE table_29483673_1 (location___city VARCHAR, institution VARCHAR)
SELECT SUM(end_term) FROM table_name_88 WHERE title = "prince regent of bavaria"
What is the total End term with a Title of prince regent of bavaria?
CREATE TABLE table_name_88 ( end_term INTEGER, title VARCHAR )
SELECT thurs_3_june FROM table_25220821_4 WHERE wed_2_june = "17' 45.11 127.525mph"
What is the 3 June time for the rider with 2 June time of 17' 45.11 127.525mph?
CREATE TABLE table_25220821_4 (thurs_3_june VARCHAR, wed_2_june VARCHAR)
SELECT enrollment FROM table_29483673_1 WHERE affiliation = "Private"
What is the enrollment at the private university?
CREATE TABLE table_29483673_1 (enrollment VARCHAR, affiliation VARCHAR)
SELECT visitor FROM table_name_43 WHERE decision = "leclaire" AND date = "november 14"
Who was the visitor on november 14 with leclaire recording the decision?
CREATE TABLE table_name_43 ( visitor VARCHAR, decision VARCHAR, date VARCHAR )
SELECT rider FROM table_25220821_4 WHERE rank = 2
Who is ranked 2?
CREATE TABLE table_25220821_4 (rider VARCHAR, rank VARCHAR)
SELECT originalair_date FROM table_29494395_3 WHERE director = "Rowan Woods" AND writer = "Peter Duncan"
What is the original air date when the director is Rowan Woods and the writer is Peter Duncan?
CREATE TABLE table_29494395_3 (originalair_date VARCHAR, director VARCHAR, writer VARCHAR)
SELECT abbr FROM table_name_70 WHERE votes__2011_ = "11.2%"
WHAT IS THE ABBR WITH VOTES OF 11.2% IN 2011?
CREATE TABLE table_name_70 ( abbr VARCHAR, votes__2011_ VARCHAR )
SELECT COUNT(november_3) FROM table_25235489_2 WHERE january_15_16 = "January 15, 1991"
How many times does November 3rd occur when January 15, 1991 does?
CREATE TABLE table_25235489_2 (november_3 VARCHAR, january_15_16 VARCHAR)
SELECT COUNT(source_s_) FROM table_29487895_2 WHERE country___region = "South Africa"
How many sources are there for south africa?
CREATE TABLE table_29487895_2 (source_s_ VARCHAR, country___region VARCHAR)
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '007-849') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '007-849') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day')
what are the new prescriptions of patient 007-849 today compared with the prescriptions yesterday?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT march_27_29 FROM table_25235489_2 WHERE november_3 = "153"
When November is 153 what is the March number?
CREATE TABLE table_25235489_2 (march_27_29 VARCHAR, november_3 VARCHAR)
SELECT series_premiere FROM table_29487895_2 WHERE source_s_ = "American Disney XD Tron Uprising Site"
What is the premiere date of the american disney xd tron uprising site?
CREATE TABLE table_29487895_2 (series_premiere VARCHAR, source_s_ VARCHAR)
SELECT COUNT(laps) FROM table_name_25 WHERE start = "1"
How many laps have 1 as the start?
CREATE TABLE table_name_25 ( laps VARCHAR, start VARCHAR )
SELECT COUNT(june_10_11) FROM table_25235489_2 WHERE november_3 = "november_3, 1975"
How many times does an occurance happen in June when it happens on NOvember 3, 1975?
CREATE TABLE table_25235489_2 (june_10_11 VARCHAR, november_3 VARCHAR)
SELECT title_in_country FROM table_29487895_2 WHERE country___region = "France"
What country is in the region of France?
CREATE TABLE table_29487895_2 (title_in_country VARCHAR, country___region VARCHAR)
SELECT "Record" FROM table_10794 WHERE "Loss" = 'johnson (5-6)'
What is the record for the game that has a loss of Johnson (5-6)?
CREATE TABLE table_10794 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT august_21_22 FROM table_25235489_2 WHERE march_27_29 = "129"
When march is 129 what is the August number?
CREATE TABLE table_25235489_2 (august_21_22 VARCHAR, march_27_29 VARCHAR)
SELECT title_in_country FROM table_29487895_2 WHERE country___region = "Canada"
What is the title in Canada?
CREATE TABLE table_29487895_2 (title_in_country VARCHAR, country___region VARCHAR)
SELECT "Original Team" FROM table_14782 WHERE "Result" = 'hired by trump (5-19-2005)'
What is the original team that was Hired by Trump (5-19-2005)?
CREATE TABLE table_14782 ( "Candidate" text, "Background" text, "Original Team" text, "Hometown" text, "Result" text )
SELECT COUNT(august_21_22) FROM table_25235489_2 WHERE march_27_29 = "139"
How many numbers are there for August when March is 139?
CREATE TABLE table_25235489_2 (august_21_22 VARCHAR, march_27_29 VARCHAR)
SELECT best_finish FROM table_29499399_2 WHERE money_list_rank = "206"
What was the best finish for 206 on the money list?
CREATE TABLE table_29499399_2 (best_finish VARCHAR, money_list_rank VARCHAR)
SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "29961"
what is age and religion of subject id 29961?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
SELECT COUNT(team) FROM table_2522473_1 WHERE seasons = 8
How many teams have been in Topperserien for 8 seasons?
CREATE TABLE table_2522473_1 (team VARCHAR, seasons VARCHAR)
SELECT COUNT(money_list_rank) FROM table_29499399_2 WHERE best_finish = "T10"
How many ranks on the money list had a best finish of t10?
CREATE TABLE table_29499399_2 (money_list_rank VARCHAR, best_finish VARCHAR)
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name)
Compare the total number of different product names, show y axis in asc order.
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Agreements ( Document_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Finances ( Finance_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID INTEGER, Product_Type_Code CHAR(15), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4) ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Assets ( Asset_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) )
SELECT MAX(seasons) FROM table_2522473_1
What is the maximum number of seasons for any team?
CREATE TABLE table_2522473_1 (seasons INTEGER)
SELECT COUNT(money_list_rank) FROM table_29499399_2 WHERE best_finish = "2"
Which money list ranks had a best finish of 2?
CREATE TABLE table_29499399_2 (money_list_rank VARCHAR, best_finish VARCHAR)
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 = "Abnormal loss of weight" AND lab.fluid = "Pleural"
calculate the number of patients with abnormal loss of weight who had a lab test for pleural fluid.
CREATE TABLE procedures ( 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 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 )
SELECT team FROM table_2522473_1 WHERE home_ground = "Stemmemyren"
Which teams homeeground is Stemmemyren?
CREATE TABLE table_2522473_1 (team VARCHAR, home_ground VARCHAR)
SELECT COUNT(money_list_rank) FROM table_29499399_2 WHERE player = "Jonathan Kaye"
What is Jonathan Kaye's money list ranking?
CREATE TABLE table_29499399_2 (money_list_rank VARCHAR, player VARCHAR)
SELECT record FROM table_27755784_6 WHERE date = "November 10"
What was the record after the game on November 10?
CREATE TABLE table_27755784_6 ( record VARCHAR, date VARCHAR )
SELECT home_ground FROM table_2522473_1 WHERE seasons = 27 AND home_city = "Trondheim"
What is the home ground for the team whose home city is Trondheim with 27 seasons?
CREATE TABLE table_2522473_1 (home_ground VARCHAR, seasons VARCHAR, home_city VARCHAR)
SELECT money_list_rank FROM table_29499399_2 WHERE player = "Cameron Beckman"
Where is Cameron Beckman's rank on the money list?
CREATE TABLE table_29499399_2 (money_list_rank VARCHAR, player VARCHAR)