answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT barony FROM table_30120619_1 WHERE townland = "Ballintaggart"
What is the barony for the Ballintaggart townland?
CREATE TABLE table_30120619_1 (barony VARCHAR, townland VARCHAR)
SELECT "Outcome" FROM table_7321 WHERE "Surface" = 'hard (i)'
What was the Outcome of the match played on Hard (i) Surface?
CREATE TABLE table_7321 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
SELECT MIN(attendance) FROM table_25331766_3
What is the lowest attendance?
CREATE TABLE table_25331766_3 (attendance INTEGER)
SELECT poor_law_union FROM table_30120619_1 WHERE townland = "Barnahely"
What is the poor law union for the Barnahely towland?
CREATE TABLE table_30120619_1 (poor_law_union VARCHAR, townland VARCHAR)
SELECT circuit FROM table_name_97 WHERE pole_position = "andré ribeiro"
Which Circuit has a Pole position of andr ribeiro?
CREATE TABLE table_name_97 ( circuit VARCHAR, pole_position VARCHAR )
SELECT steals FROM table_25342713_5 WHERE rebounds = 87
If the rebounds are at 87, what are the amount of steals?
CREATE TABLE table_25342713_5 (steals VARCHAR, rebounds VARCHAR)
SELECT barony FROM table_30120619_1 WHERE area__acres__ = 150
What is the barony of the townland whose area is 150 acres?
CREATE TABLE table_30120619_1 (barony VARCHAR, area__acres__ VARCHAR)
SELECT "Surface" FROM table_55199 WHERE "Opponents" = 'iryna bremond valeria savinykh'
What is the surface of the match when the opponent was iryna bremond valeria savinykh?
CREATE TABLE table_55199 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
SELECT COUNT(blocks) FROM table_25342713_5 WHERE points = 89
How many players 89 points?
CREATE TABLE table_25342713_5 (blocks VARCHAR, points VARCHAR)
SELECT townland FROM table_30120619_1 WHERE civil_parish = "Monkstown"
In which townlands is the civil parish Monkstown?
CREATE TABLE table_30120619_1 (townland VARCHAR, civil_parish VARCHAR)
SELECT "Date" FROM table_52354 WHERE "Region" = 'japan'
Which date had a Japan region?
CREATE TABLE table_52354 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
SELECT MAX(blocks) FROM table_25342713_5 WHERE steals = 20
If the Steals are 20, what are the blocks?
CREATE TABLE table_25342713_5 (blocks INTEGER, steals VARCHAR)
SELECT townland FROM table_30120619_1 WHERE area__acres__ = 165
Which townland has an area of 165 acres?
CREATE TABLE table_30120619_1 (townland VARCHAR, area__acres__ VARCHAR)
SELECT 2007 FROM table_name_32 WHERE 2006 = "grand slam tournaments"
What is the 2007 that has a grand slam tournaments in 2006.
CREATE TABLE table_name_32 ( Id VARCHAR )
SELECT us_viewers__million_ FROM table_25341765_1 WHERE directed_by = "Jeffrey Blitz"
How many millions of viewers did the episode directed by Jeffrey Blitz have?
CREATE TABLE table_25341765_1 (us_viewers__million_ VARCHAR, directed_by VARCHAR)
SELECT COUNT(barony) FROM table_30120559_1 WHERE townland = "Kilmore"
Name the total number of barony for kilmore
CREATE TABLE table_30120559_1 (barony VARCHAR, townland VARCHAR)
SELECT * FROM table_train_66 WHERE body_weight > 200
weight > 200 kg
CREATE TABLE table_train_66 ( "id" int, "pregnancy_or_lactation" bool, "white_blood_cell_count_wbc" int, "acute_pyelonephritis" bool, "intrabdominal_infection" bool, "body_weight" float, "oxygen_therapy_by_face_mask" bool, "temperature" float, "heart_rate" int, "paco2" float, "band_form" int, "respiratory_rate" int, "bacteremia_by_gram_negative_bacteria" bool, "NOUSE" float )
SELECT directed_by FROM table_25341765_1 WHERE us_viewers__million_ = "5.92"
Who directed the episode that had 5.92 million viewers?
CREATE TABLE table_25341765_1 (directed_by VARCHAR, us_viewers__million_ VARCHAR)
SELECT COUNT(poor_law_union) FROM table_30120559_1 WHERE area__acres__ = 332
Name the poor law union for area being 332
CREATE TABLE table_30120559_1 (poor_law_union VARCHAR, area__acres__ VARCHAR)
SELECT "Name" FROM table_55939 WHERE "Rank" > '3' AND "Placings" = '64'
Who has a rank great than 3 and a placing of 64?
CREATE TABLE table_55939 ( "Rank" real, "Name" text, "Nation" text, "Placings" text, "Total" real )
SELECT title FROM table_25341765_1 WHERE written_by = "Alan Yang"
What was the name of the episode Alan Yang wrote?
CREATE TABLE table_25341765_1 (title VARCHAR, written_by VARCHAR)
SELECT COUNT(townland) FROM table_30121096_1 WHERE civil_parish = "Caheragh" AND area__acres__ = 270
How many townlands are there for caheragh and is larger than 270 acres?
CREATE TABLE table_30121096_1 (townland VARCHAR, civil_parish VARCHAR, area__acres__ VARCHAR)
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acc poison-cns stimulant')) AS t1 GROUP BY t1.subject_id HAVING MIN(t1.charttime) = t1.charttime AND DATETIME(t1.charttime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 JOIN (SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions JOIN patients ON patients.subject_id = admissions.subject_id WHERE NOT patients.dod IS NULL AND DATETIME(patients.dod) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t3 ON t2.subject_id = t3.subject_id WHERE DATETIME(t2.charttime, 'start of month') = DATETIME(t3.dod, 'start of month')
how many patient have died after they were diagnosed with acc poison-cns stimulant during the same month until 4 years ago?
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_items ( row_id number, itemid number, label text, linksto 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 )
SELECT COUNT(original_air_date) FROM table_25341765_1 WHERE directed_by = "Michael McCullers"
How many episodes were directed by Michael McCullers?
CREATE TABLE table_25341765_1 (original_air_date VARCHAR, directed_by VARCHAR)
SELECT civil_parish FROM table_30121096_1 WHERE townland = "Clooncugger"
Which civil parish is for the townland clooncugger?
CREATE TABLE table_30121096_1 (civil_parish VARCHAR, townland VARCHAR)
SELECT T3.Festival_Name, T1.Festival_ID FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Festival_Name
Show the ids and names of festivals that have at least two nominations for artworks by a bar chart, display names in asc order.
CREATE TABLE nomination ( Artwork_ID int, Festival_ID int, Result text ) CREATE TABLE artwork ( Artwork_ID int, Type text, Name text ) CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int )
SELECT MIN(points) FROM table_25352318_1 WHERE position = "3rd"
When 3rd is the position what is the lowest amount of points?
CREATE TABLE table_25352318_1 (points INTEGER, position VARCHAR)
SELECT COUNT(poor_law_union) FROM table_30121096_1 WHERE area__acres__ = 262 AND civil_parish = "Drinagh"
How many poor law unions have an area of 262 acres and is in drinagh civil parish?
CREATE TABLE table_30121096_1 (poor_law_union VARCHAR, area__acres__ VARCHAR, civil_parish VARCHAR)
SELECT t3.drug FROM (SELECT t2.drug, 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 = 'temporary colostomy') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3
what were the three most frequently prescribed drugs to patients who previously received temporary colostomy within 2 months until 1 year ago?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 d_icd_procedures ( 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 )
SELECT COUNT(wins) FROM table_25352318_1 WHERE season = 2010 AND team = "ART Grand Prix"
When art grand prix is the team and 2010 is the season how many wins are there?
CREATE TABLE table_25352318_1 (wins VARCHAR, season VARCHAR, team VARCHAR)
SELECT COUNT(current_account_balance__percent_of_gdp_) FROM table_30133_1 WHERE gdp_at_constant_prices_growth_rate__percent_change_ = "4.6"
How many current account balances are associated with GDP at constant prices growth rates of 4.6?
CREATE TABLE table_30133_1 (current_account_balance__percent_of_gdp_ VARCHAR, gdp_at_constant_prices_growth_rate__percent_change_ VARCHAR)
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-101426')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-9 month') ORDER BY medication.drugstarttime LIMIT 1
what was the first drug prescribed until 9 months ago to patient 017-101426?
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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
SELECT team FROM table_25352318_1 WHERE races = 15 AND position = "7th"
When 7th is the position and 15 is the race who is the team?
CREATE TABLE table_25352318_1 (team VARCHAR, races VARCHAR, position VARCHAR)
SELECT COUNT(export_volume_of_goods_and_services__percent_change_) FROM table_30133_1 WHERE gdp_at_constant_prices__thb_trillions_ = "3.072"
How many export volume of goods/services values are associated with GDP at constant prices values of 3.072?
CREATE TABLE table_30133_1 (export_volume_of_goods_and_services__percent_change_ VARCHAR, gdp_at_constant_prices__thb_trillions_ VARCHAR)
SELECT SUM("Change") FROM table_59446 WHERE "% votes" < '4.7' AND "Seats" > '0'
What is the change number with fewer than 4.7% votes and more than 0 seats?
CREATE TABLE table_59446 ( "Party" text, "% votes" real, "% change" real, "Seats" real, "Change" real )
SELECT MIN(poles) FROM table_25352318_1
What is the lowest overall amount of poles?
CREATE TABLE table_25352318_1 (poles INTEGER)
SELECT COUNT(export_volume_of_goods_and_services__percent_change_) FROM table_30133_1 WHERE gdp_at_current_prices__usd_billions_ = "161.340"
How many export volume of goods and services values are associated with GDP at current prices of 161.340?
CREATE TABLE table_30133_1 (export_volume_of_goods_and_services__percent_change_ VARCHAR, gdp_at_current_prices__usd_billions_ VARCHAR)
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
List the name for storms and the number of affected regions for each storm with a pie chart.
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int )
SELECT position FROM table_25352318_1 WHERE season = 2012 AND team = "Racing Engineering"
When racing engineering is the team and 2012 is the team what is the position?
CREATE TABLE table_25352318_1 (position VARCHAR, season VARCHAR, team VARCHAR)
SELECT current_account_balance__percent_of_gdp_ FROM table_30133_1 WHERE export_volume_of_goods_and_services__percent_change_ = "-4.2"
What is the current account balance for an export volume of goods and service value of -4.2?
CREATE TABLE table_30133_1 (current_account_balance__percent_of_gdp_ VARCHAR, export_volume_of_goods_and_services__percent_change_ VARCHAR)
SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id ORDER BY COUNT(date_moved_in)
What is the proportion of each customer's move in date? You can show me a bar chart that bins move in date into Year interval, and sort by the y axis in ascending.
CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Services ( service_id INTEGER, organization_id INTEGER, service_type_code CHAR(15), service_details VARCHAR(255) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER ) CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thing_Code CHAR(15) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME ) CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) ) CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) )
SELECT Major AS facility FROM table_25346763_1 WHERE year_opened = "1968"
Is the facility opened in 1968 a major facility?
CREATE TABLE table_25346763_1 (Major VARCHAR, year_opened VARCHAR)
SELECT current_account_balance__percent_of_gdp_ FROM table_30133_1 WHERE gdp_at_current_prices__usd_billions_ = "142.640"
What is the current account balance for a GDP at current prices of 142.640?
CREATE TABLE table_30133_1 (current_account_balance__percent_of_gdp_ VARCHAR, gdp_at_current_prices__usd_billions_ VARCHAR)
SELECT "Europe" FROM table_68720 WHERE "League Cup" = '0 40 0 (6)'
The League Cup of 0 40 0 (6) also has what listed in the Europe column?
CREATE TABLE table_68720 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other [C ]" text, "Total" text )
SELECT custody_level_s_ FROM table_25346763_1 WHERE location = "Shelton"
What is the custody level of the facility in Shelton?
CREATE TABLE table_25346763_1 (custody_level_s_ VARCHAR, location VARCHAR)
SELECT gdp_at_constant_prices__thb_trillions_ FROM table_30133_1 WHERE current_account_balance__percent_of_gdp_ = "12.8"
What is the GDP at constant prices for a current account balance of 12.8?
CREATE TABLE table_30133_1 (gdp_at_constant_prices__thb_trillions_ VARCHAR, current_account_balance__percent_of_gdp_ VARCHAR)
SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "internl.\ntourism\narrivals\n2010\n(x 1000)" DESC LIMIT 1
which latin american country had the largest number of tourism arrivals in 2010 ?
CREATE TABLE table_203_54 ( id number, "selected\nlatin american\ncountries" text, "internl.\ntourism\narrivals\n2010\n(x 1000)" number, "internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number, "average\nreceipt\nper visitor\n2009\n(usd/turista)" number, "tourist\narrivals\nper\n1000 inhab\n(estimated)\n2007" number, "receipts\nper\ncapita\n2005\nusd" number, "revenues\nas %\nexports of\ngoods and\nservices\n2003" number, "tourism\nincome\n%\ngdp\n2003" number, "% direct and\nindirect\nemployment\nin tourism\n2005" number, "world\nranking\ntourism\ncompetitiv.\nttci\n2011" number, "2011\nttci\nindex" number )
SELECT Major AS facility FROM table_25346763_1 WHERE facility = "Washington Corrections Center for Women (WCCW)"
Is the Washington Corrections Center for Women (WCCW) a major facility?
CREATE TABLE table_25346763_1 (Major VARCHAR, facility VARCHAR)
SELECT games FROM table_name_87 WHERE total < 4 AND sport = "swimming" AND years = "1968"
Tell me the games for total less than 4 for swimming 1968
CREATE TABLE table_name_87 (games VARCHAR, years VARCHAR, total VARCHAR, sport VARCHAR)
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'spinal cord injury - thoracic' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxatives - doss (colace)' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 WHERE t1.diagnosistime < t2.treatmenttime AND DATETIME(t2.treatmenttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')
count the number of patients who received a laxatives - doss (colace) treatment within 2 months after they were diagnosed with spinal cord injury - thoracic since 3 years ago.
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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 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 )
SELECT COUNT(capacity) FROM table_25346763_1 WHERE year_opened = "1956"
What is the capacity for a facility opened in 1956?
CREATE TABLE table_25346763_1 (capacity VARCHAR, year_opened VARCHAR)
SELECT COUNT(bronze) FROM table_name_16 WHERE silver = 0 AND sport = "wrestling" AND total > 3
Tell me the total number of bronze for silver being 0 and sport of wrestling and total more than 3
CREATE TABLE table_name_16 (bronze VARCHAR, total VARCHAR, silver VARCHAR, sport VARCHAR)
SELECT MAX(crowd) FROM table_name_75 WHERE venue = "brunswick street oval"
What was the largest crowd at the Brunswick Street Oval?
CREATE TABLE table_name_75 ( crowd INTEGER, venue VARCHAR )
SELECT facility FROM table_25346763_1 WHERE year_opened = "1954"
What facility opening in 1954?
CREATE TABLE table_25346763_1 (facility VARCHAR, year_opened VARCHAR)
SELECT MIN(bronze) FROM table_name_56 WHERE gold = 3 AND games = "winter" AND sport = "cross-country skiing" AND silver < 0
Tell me the lowest Bronze for gold of 3 in the winter for cross-country skiing and silver less than 0
CREATE TABLE table_name_56 (bronze INTEGER, silver VARCHAR, sport VARCHAR, gold VARCHAR, games VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3897" AND prescriptions.route = "BUCCAL"
how many patients whose procedure icd9 code is 3897 and drug route is buccal?
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 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 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 )
SELECT player FROM table_25353861_5 WHERE assists = 6
Which player had 6 assists?
CREATE TABLE table_25353861_5 (player VARCHAR, assists VARCHAR)
SELECT MIN(round) FROM table_name_59 WHERE overall < 150 AND position = "offensive guard"
What is the lowest round for an offensive guard when the overall is smaller than 150?
CREATE TABLE table_name_59 (round INTEGER, overall VARCHAR, position VARCHAR)
SELECT MIN("Attendance") FROM table_37944 WHERE "Record" = '34–51'
Which Attendance has a Record of 34 51?
CREATE TABLE table_37944 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT MIN(steals) FROM table_25353861_5
What is the fewest steals any player had?
CREATE TABLE table_25353861_5 (steals INTEGER)
SELECT college FROM table_name_43 WHERE round = 1
Which college was the player selected from in round 1?
CREATE TABLE table_name_43 (college VARCHAR, round VARCHAR)
SELECT "sport" FROM table_204_435 WHERE "gold" < (SELECT MAX("gold") FROM table_204_435) ORDER BY "gold" DESC LIMIT 1
what sport has the second most number of gold medals won ?
CREATE TABLE table_204_435 ( id number, "sport" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT MIN(steals) FROM table_25353861_5 WHERE player = "Kelly Miller"
How many steals did Kelly Miller have?
CREATE TABLE table_25353861_5 (steals INTEGER, player VARCHAR)
SELECT district_attorney FROM table_name_22 WHERE position = "bureau chief ada"
Tell me the DA for bureau chief ada
CREATE TABLE table_name_22 (district_attorney VARCHAR, position VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Acute vascular insufficiency of intestine"
give me the number of patients whose age is less than 50 and diagnoses long title is acute vascular insufficiency of intestine?
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 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 ) 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 player FROM table_25353861_5 WHERE blocks = 9
Which player had 9 blocks?
CREATE TABLE table_25353861_5 (player VARCHAR, blocks VARCHAR)
SELECT left_office FROM table_name_83 WHERE minister = "enrico la loggia"
Tell me the left office for enrico la loggia
CREATE TABLE table_name_83 (left_office VARCHAR, minister VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PR"
how many patients whose drug route is pr?
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 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 )
SELECT rebounds FROM table_25353861_5 WHERE player = "Tammy Sutton-Brown"
How many rebounds did Tammy Sutton-Brown have?
CREATE TABLE table_25353861_5 (rebounds VARCHAR, player VARCHAR)
SELECT portfolio FROM table_name_77 WHERE minister = "carlo giovanardi"
Tell me the portfolio of minister of carlo giovanardi
CREATE TABLE table_name_77 (portfolio VARCHAR, minister VARCHAR)
SELECT record FROM table_name_1 WHERE date = "april 22"
What was the record on April 22?
CREATE TABLE table_name_1 ( record VARCHAR, date VARCHAR )
SELECT science FROM table_2534578_1 WHERE social_studies = "93.56"
What was the science score in the year there was a social studies score of 93.56?
CREATE TABLE table_2534578_1 (science VARCHAR, social_studies VARCHAR)
SELECT left_office FROM table_name_20 WHERE minister = "mirko tremaglia"
Tell me the left office for mirko tremaglia
CREATE TABLE table_name_20 (left_office VARCHAR, minister VARCHAR)
SELECT event FROM table_name_18 WHERE record = "18–5 (1)"
Which event had the record of 18 5 (1)?
CREATE TABLE table_name_18 ( event VARCHAR, record VARCHAR )
SELECT COUNT(science) FROM table_2534578_1 WHERE mathematics = "98.02"
How many years did the school have a mathetmatics score of 98.02?
CREATE TABLE table_2534578_1 (science VARCHAR, mathematics VARCHAR)
SELECT school_club_team FROM table_name_58 WHERE position = "guard" AND player = "juan dixon"
What School/Club Team has a Player named Juan Dixon and a Position of guard?
CREATE TABLE table_name_58 (school_club_team VARCHAR, position VARCHAR, player VARCHAR)
SELECT "Circuit" FROM table_45417 WHERE "Date" = '4 june'
what is the circuit when the date is 4 june?
CREATE TABLE table_45417 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text )
SELECT reading FROM table_2534578_1 WHERE science = "96.13"
What was the reading score in the year the science score was 96.13?
CREATE TABLE table_2534578_1 (reading VARCHAR, science VARCHAR)
SELECT player FROM table_name_16 WHERE position = "guard" AND years_in_toronto = "2007-08"
Which Player's Position is guard and played in Toronto during the Years 2007-08?
CREATE TABLE table_name_16 (player VARCHAR, position VARCHAR, years_in_toronto VARCHAR)
SELECT "January 15-16" FROM table_27523 WHERE "November 3" = 'November 3, 2013'
What January 15-16 is is that corresponds to November 3, 2013?
CREATE TABLE table_27523 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text )
SELECT language FROM table_2534578_1 WHERE reading = "94.47"
What was the language score when the reading score was 94.47?
CREATE TABLE table_2534578_1 (language VARCHAR, reading VARCHAR)
SELECT player FROM table_name_9 WHERE position = "guard-forward" AND nationality = "argentina"
What Player is from Argentina and whose position is a guard-forward?
CREATE TABLE table_name_9 (player VARCHAR, position VARCHAR, nationality VARCHAR)
SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal"
Which committees have delegates from both democratic party and liberal party?
CREATE TABLE party ( Party_ID VARCHAR, Party VARCHAR ) CREATE TABLE election ( Committee VARCHAR, Party VARCHAR )
SELECT COUNT(points) FROM table_25352324_5 WHERE player = "Sophia Witherspoon"
How many values for points have Sophia Witherspoon as the player?
CREATE TABLE table_25352324_5 (points VARCHAR, player VARCHAR)
SELECT school_club_team FROM table_name_43 WHERE years_in_toronto = "2012"
What School/Club Team played in Toronto during 2012?
CREATE TABLE table_name_43 (school_club_team VARCHAR, years_in_toronto VARCHAR)
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC
Return the number of the completion date for all the tests that have 'Fail' result, and rank total number from high to low order please.
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) )
SELECT MAX(points) FROM table_25352324_5
What is the highest value for points?
CREATE TABLE table_25352324_5 (points INTEGER)
SELECT result FROM table_name_80 WHERE event = "syracuse grand prix"
What was the result of the syracuse grand prix?
CREATE TABLE table_name_80 (result VARCHAR, event VARCHAR)
SELECT "Height (cm)" FROM table_1932 WHERE "Country" = 'Bahamas'
When bahamas is the country what is the height in centimeters?
CREATE TABLE table_1932 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text )
SELECT rebounds FROM table_25352324_5 WHERE steals = 19
What is every value for rebounds when steals is 19?
CREATE TABLE table_25352324_5 (rebounds VARCHAR, steals VARCHAR)
SELECT MIN(year) FROM table_name_25 WHERE result = "3" AND venue = "jarama"
What year has a result of 3 in the venue of Jarama.
CREATE TABLE table_name_25 (year INTEGER, result VARCHAR, venue VARCHAR)
SELECT firstname FROM teachers WHERE classroom = 110
Which teachers teach in classroom 110? Give me their first names.
CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) CREATE TABLE teachers ( lastname text, firstname text, classroom number )
SELECT points FROM table_25352324_5 WHERE rebounds = 6 AND blocks = 0
What is every value for points if rebounds is 6 and blocks is 0?
CREATE TABLE table_25352324_5 (points VARCHAR, rebounds VARCHAR, blocks VARCHAR)
SELECT MAX(opponents) FROM table_name_97 WHERE record = "7-3" AND vikings_points > 7
Tell me the highest opponents for record of 7-3 and vikings points more than 7
CREATE TABLE table_name_97 (opponents INTEGER, record VARCHAR, vikings_points VARCHAR)
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2177"
what is maximum days of hospital stay of patients whose admission year is greater than or equal to 2177?
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 ) 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 )
SELECT assists FROM table_25352324_5 WHERE player = "Lynn Pride"
What is every entry for assists if the player is Lynn Pride?
CREATE TABLE table_25352324_5 (assists VARCHAR, player VARCHAR)
SELECT MAX(attendance) FROM table_name_15 WHERE game < 1
Tell me the most attendance for game less than 1
CREATE TABLE table_name_15 (attendance INTEGER, game INTEGER)
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY SUM(Weight)
Give me a bar chart for sum weight of each sex, and rank Y-axis from low to high order.
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real )
SELECT original_air_date FROM table_25356350_3 WHERE written_by = "Itamar Moses"
What is the air date of the episode written by Itamar Moses?
CREATE TABLE table_25356350_3 (original_air_date VARCHAR, written_by VARCHAR)
SELECT surface FROM table_name_58 WHERE date = "2 december 1974"
Tell me the surface of 2 december 1974
CREATE TABLE table_name_58 (surface VARCHAR, date VARCHAR)