answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT state, MAX(year) FROM ndecoreexcel_math_grade8 GROUP BY state
For each state, when was the last time the average score data was collected?
CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number )
SELECT COUNT(year) FROM table_22597626_6 WHERE score_in_the_final = "6–3, 6–2, 6–4"
Name the number of year for score being 6–3, 6–2, 6–4
CREATE TABLE table_22597626_6 (year VARCHAR, score_in_the_final VARCHAR)
SELECT v_band FROM table_186468_1 WHERE k_band = "5.5"
When 5.5 is the l-band what is the v-band?
CREATE TABLE table_186468_1 (v_band VARCHAR, k_band VARCHAR)
SELECT "Record" FROM table_79632 WHERE "Attendance" > '16,124' AND "Score" = '6–3'
What is the Record of the game with an Attendance of more than 16,124 and a Score of 6 3?
CREATE TABLE table_79632 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
SELECT surface FROM table_22597626_6 WHERE score_in_the_final = "6–0, 6–3"
Name the surface for 6–0, 6–3
CREATE TABLE table_22597626_6 (surface VARCHAR, score_in_the_final VARCHAR)
SELECT v_band FROM table_186468_1 WHERE k_band = "2"
When 2 is the k-band what is the v-band?
CREATE TABLE table_186468_1 (v_band VARCHAR, k_band VARCHAR)
SELECT "Former county" FROM table_30216 WHERE "District" = 'Great Grimsby'
What are the former counties of the Great Grimsby district?
CREATE TABLE table_30216 ( "District" text, "Status" text, "Date abolished" text, "Former county" text, "Successor" text )
SELECT championship FROM table_22597626_6 WHERE opponent_in_the_final = "Peter McNamara"
Name the championship for peter mcnamara
CREATE TABLE table_22597626_6 (championship VARCHAR, opponent_in_the_final VARCHAR)
SELECT COUNT(property) FROM table_186468_1 WHERE ka_band = "2"
When 2 is the ka-band how many properties are there?
CREATE TABLE table_186468_1 (property VARCHAR, ka_band VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Open reduc-int fix femur"
provide the number of patients whose insurance is government and procedure short title is open reduc-int fix femur?
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 ) 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 )
SELECT championship FROM table_22597626_6 WHERE year = 1980 AND surface = "Hard"
Name the championship for 1980 hard surface
CREATE TABLE table_22597626_6 (championship VARCHAR, year VARCHAR, surface VARCHAR)
SELECT secondary_sponsor FROM table_187239_1 WHERE main_sponsor = "Olympikus"
When olympikus is the main sponsor who is the secondary sponsor?
CREATE TABLE table_187239_1 (secondary_sponsor VARCHAR, main_sponsor VARCHAR)
SELECT "Elector" FROM table_78928 WHERE "Elevated" = 'december 18, 1182'
What Elector was Elevated on December 18, 1182?
CREATE TABLE table_78928 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text )
SELECT race_time FROM table_2260452_1 WHERE team = "Billy Ballew Motorsports"
If the team is Billy Ballew Motorsports, what is the race time?
CREATE TABLE table_2260452_1 (race_time VARCHAR, team VARCHAR)
SELECT secondary_sponsor FROM table_187239_1 WHERE main_sponsor = "Ale"
When ale is the main sponsor who is the secondary sponsor?
CREATE TABLE table_187239_1 (secondary_sponsor VARCHAR, main_sponsor VARCHAR)
SELECT MAX("Production in 2010 (1,000 ton)") FROM table_31108 WHERE "Country" = 'Sweden'
When sweden is the country what is the highest production in 2010 (1,000 ton)?
CREATE TABLE table_31108 ( "Rank 2011" real, "Country" text, "Production in 2011 (1,000 ton)" real, "Share 2011" text, "Rank 2010" real, "Production in 2010 (1,000 ton)" real )
SELECT date FROM table_2260452_1 WHERE driver = "Robert Pressley"
What was the date if the driver was Robert Pressley?
CREATE TABLE table_2260452_1 (date VARCHAR, driver VARCHAR)
SELECT kit_manufacturer FROM table_187239_1 WHERE minor_sponsors = "Tim Brasil Brokers"
When tim brasil brokers are the minor sponsors who is the kit manufacturer?
CREATE TABLE table_187239_1 (kit_manufacturer VARCHAR, minor_sponsors VARCHAR)
SELECT MIN(year_of_recording) FROM table_name_63 WHERE orchestra = "royal philharmonic orchestra" AND record_company = "decca records"
What is the oldest year that the Royal Philharmonic Orchestra released a record with Decca Records?
CREATE TABLE table_name_63 ( year_of_recording INTEGER, orchestra VARCHAR, record_company VARCHAR )
SELECT average_speed__mph_ FROM table_2260452_1 WHERE race_time = "2:00:33"
If the race time is 2:00:33, what is the average speed?
CREATE TABLE table_2260452_1 (average_speed__mph_ VARCHAR, race_time VARCHAR)
SELECT minor_sponsors FROM table_187239_1 WHERE kit_manufacturer = "Olympikus" AND main_sponsor = "Batavo"
When batavo is the main sponsor and olympikus is the kit manufacturer who are the minor sponsors?
CREATE TABLE table_187239_1 (minor_sponsors VARCHAR, kit_manufacturer VARCHAR, main_sponsor VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Other Body Fluid"
Among the patients born before the year 2056, how many of them had the lab test for other body fluid?
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 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 1982 AS _83 FROM table_22606461_10 WHERE rank = 1
What is every entry for 1982-83 for rank 1?
CREATE TABLE table_22606461_10 (rank VARCHAR)
SELECT COUNT(minor_sponsors) FROM table_187239_1 WHERE kit_manufacturer = "Olympikus" AND period = "2011"
When 2011 is the period and olympikus is the kit manufacturer how many minor sponsors are there?
CREATE TABLE table_187239_1 (minor_sponsors VARCHAR, kit_manufacturer VARCHAR, period VARCHAR)
SELECT COUNT("County") FROM table_25348 WHERE "Population" = '2266'
How many counties have a population of 2266?
CREATE TABLE table_25348 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text )
SELECT COUNT(height) FROM table_22603701_1 WHERE position = "WR" AND name = "Jesse Holley"
How many heights are listed for Jesse Holley in the WR position?
CREATE TABLE table_22603701_1 (height VARCHAR, position VARCHAR, name VARCHAR)
SELECT MIN(no_in_season) FROM table_1876825_6 WHERE written_by = "Neil Thompson"
What season episode is written by neil thompson?
CREATE TABLE table_1876825_6 (no_in_season INTEGER, written_by VARCHAR)
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND patient.hospitaldischargetime IS NULL))
patient 030-34260 has received a diagnosis in their current hospital encounter?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
SELECT result FROM table_22603701_1 WHERE college = "Wisconsin"
What is the result for Wisconsin?
CREATE TABLE table_22603701_1 (result VARCHAR, college VARCHAR)
SELECT original_air_date FROM table_1876825_6 WHERE production_code = "06-03-521"
What was the original air for the 06-03-521 production code?
CREATE TABLE table_1876825_6 (original_air_date VARCHAR, production_code VARCHAR)
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40116) AND prescriptions.route = 'iv bolus' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', prescriptions.startdate) = '03' ORDER BY prescriptions.startdate LIMIT 1
for the first time in 03/this year, what was the drug that patient 40116 was prescribed via iv bolus route?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
SELECT result FROM table_22603701_1 WHERE name = "Steve Gonzalez"
What is the result for Steve Gonzalez?
CREATE TABLE table_22603701_1 (result VARCHAR, name VARCHAR)
SELECT MAX(no_in_series) FROM table_1876825_6 WHERE original_air_date = "February 8, 2004"
What episode number in the series aired on February 8, 2004?
CREATE TABLE table_1876825_6 (no_in_series INTEGER, original_air_date VARCHAR)
SELECT "Venue" FROM table_11166 WHERE "Away team" = 'south melbourne'
What venue had an away team of south melbourne?
CREATE TABLE table_11166 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT position FROM table_22603701_1 WHERE college = "Menlo college"
What are the positions for Menlo College?
CREATE TABLE table_22603701_1 (position VARCHAR, college VARCHAR)
SELECT COUNT(no_in_season) FROM table_1876825_6 WHERE production_code = "06-03-519"
In season 5 what episode number was production 06-03-519?
CREATE TABLE table_1876825_6 (no_in_season VARCHAR, production_code VARCHAR)
SELECT MAX("Year") FROM table_7804 WHERE "Venue" = 'barcelona, spain'
What was the most recent year the venue was Barcelona, Spain?
CREATE TABLE table_7804 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text )
SELECT features FROM table_2263152_1 WHERE security_issues = "98-004" AND distribution_mechanism = "Microsoft website"
If the distribution mechanism is the Microsoft website and the security issues id 98-004, what are all of the features?
CREATE TABLE table_2263152_1 (features VARCHAR, security_issues VARCHAR, distribution_mechanism VARCHAR)
SELECT MIN(r2) FROM table_18812411_3
What was the minimum score for r2?
CREATE TABLE table_18812411_3 (r2 INTEGER)
SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID ORDER BY JOB_ID DESC
For all employees in the Finance department, compare the total number of different job id using a bar chart, and could you list by the bar in descending?
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) )
SELECT version FROM table_2263152_1 WHERE security_issues = "98-004" AND distribution_mechanism = "Microsoft website"
With the distribution mechanism of Microsoft website and the security issues of 98-004, what is the version?
CREATE TABLE table_2263152_1 (version VARCHAR, security_issues VARCHAR, distribution_mechanism VARCHAR)
SELECT country FROM table_18812411_3 WHERE r3 = 72 AND player = "Larry Mize"
What country had a r3 at 72, by Larry Mize?
CREATE TABLE table_18812411_3 (country VARCHAR, r3 VARCHAR, player VARCHAR)
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of price , and group by attribute name, show in desc by the y axis.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT COUNT(release_date) FROM table_2263152_1 WHERE security_issues = "99-025" AND distribution_mechanism = "Microsoft website"
If the security issues is 99-025 and the distribution mechanism is the Microsoft website, what is the release date total number?
CREATE TABLE table_2263152_1 (release_date VARCHAR, security_issues VARCHAR, distribution_mechanism VARCHAR)
SELECT COUNT(r1) FROM table_18812411_3 WHERE country = "Fiji"
How many times did Fiji win r1?
CREATE TABLE table_18812411_3 (r1 VARCHAR, country VARCHAR)
SELECT "Qual" FROM table_45152 WHERE "Year" = '1961'
What was 1961's qual?
CREATE TABLE table_45152 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
SELECT release_date FROM table_2263152_1 WHERE version = "1.5a"
With the version of 1.5a, what is the release date?
CREATE TABLE table_2263152_1 (release_date VARCHAR, version VARCHAR)
SELECT COUNT(socialist) FROM table_1881642_1 WHERE social_democratic = "42.2%"
How many figures are given for the Socialists in the case where the Social Democrats received 42.2%?
CREATE TABLE table_1881642_1 (socialist VARCHAR, social_democratic VARCHAR)
SELECT "English name" FROM table_19975 WHERE "Old Bulgarian name (Transliteration)" = 'Orach, Zarev'
Name the english name for orach, zarev
CREATE TABLE table_19975 ( "No." real, "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text )
SELECT version FROM table_2263152_1 WHERE features = "Service release" AND distribution_mechanism = "Windows NT 4.0 Option Pack Microsoft Office 97"
If the distribution mechanism is windows nt 4.0 option pack Microsoft office 97 and the features is service release, what is the version?
CREATE TABLE table_2263152_1 (version VARCHAR, features VARCHAR, distribution_mechanism VARCHAR)
SELECT date_released FROM table_1881642_1 WHERE green_communist = "5.7%"
What date did the Green-Communists receive 5.7%?
CREATE TABLE table_1881642_1 (date_released VARCHAR, green_communist VARCHAR)
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 = 'nb obsrv suspct infect') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.age BETWEEN 20 AND 29 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 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 are the three most frequent drugs that were prescribed within 2 months to the patients aged 20s after having been diagnosed with nb obsrv suspct infect, until 2 years ago?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) 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 ) 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 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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) 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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
SELECT distribution_mechanism FROM table_2263152_1 WHERE version = "1.5b"
If the version is 1.5b, what is the distribution mechanism?
CREATE TABLE table_2263152_1 (distribution_mechanism VARCHAR, version VARCHAR)
SELECT MIN(Otl) FROM table_1888165_1 WHERE PCt = 0.514
If the PCT is 0.514, what was the minimum OTL?
CREATE TABLE table_1888165_1 (Otl INTEGER, PCt VARCHAR)
SELECT AVG(year) FROM table_name_84 WHERE date = "december 26"
What is the average year of the games with the date December 26?
CREATE TABLE table_name_84 ( year INTEGER, date VARCHAR )
SELECT COUNT(tournament_venue__city_) FROM table_22645714_5 WHERE tournament_winner = "Temple"
How many locations are listed for the winner Temple?
CREATE TABLE table_22645714_5 (tournament_venue__city_ VARCHAR, tournament_winner VARCHAR)
SELECT MIN(Otl) FROM table_1888165_1
What was the minimum OTL amount?
CREATE TABLE table_1888165_1 (Otl INTEGER)
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY SUM(Revenue)
Display a bar chart for what is the total revenue of companies started by founder?, and could you list in asc by the total number of revenue?
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT COUNT(tournament_venue__city_) FROM table_22645714_5 WHERE conference = "Big 12 conference"
How many locations are listed for the Big 12 Conference?
CREATE TABLE table_22645714_5 (tournament_venue__city_ VARCHAR, conference VARCHAR)
SELECT MIN(events) FROM table_18888159_1 WHERE country = "Japan"
Name the least events for japan
CREATE TABLE table_18888159_1 (events INTEGER, country VARCHAR)
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2102' GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 5)
what are the top five most common procedures in 2102?
CREATE TABLE d_icd_diagnoses ( 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 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 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 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 d_labitems ( row_id number, itemid number, label text ) 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 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) 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 )
SELECT regular_season_winner FROM table_22645714_5 WHERE tournament_winner = "Arkansas-Pine Bluff"
Who had the best regular season in the contest won by Arkansas-Pine Bluff?
CREATE TABLE table_22645714_5 (regular_season_winner VARCHAR, tournament_winner VARCHAR)
SELECT country FROM table_18888159_1 WHERE events = 22
Name the country for 22 events
CREATE TABLE table_18888159_1 (country VARCHAR, events VARCHAR)
SELECT game FROM table_name_74 WHERE score = "122–125"
Which Game has a Score of 122 125?
CREATE TABLE table_name_74 ( game VARCHAR, score VARCHAR )
SELECT age_at_appointment FROM table_2263674_1 WHERE chinese_name = "孫明揚"
How old was the official with Chinese name 孫明揚?
CREATE TABLE table_2263674_1 (age_at_appointment VARCHAR, chinese_name VARCHAR)
SELECT _number FROM table_18888159_1 WHERE country = "Fiji"
Name the number for fiji
CREATE TABLE table_18888159_1 (_number VARCHAR, country VARCHAR)
SELECT "Rookie" FROM table_6044 WHERE "Goalkeeper" = 'rob scherr' AND "Week" < '6'
Who is the rookie goalkeeper Rob Scherr who played before week 6?
CREATE TABLE table_6044 ( "Month" text, "Week" real, "Offensive" text, "Defensive" text, "Goalkeeper" text, "Rookie" text )
SELECT romanised_name FROM table_2263674_1 WHERE chinese_name = "撁愛詩"
What's 撁愛詩's romanised name?
CREATE TABLE table_2263674_1 (romanised_name VARCHAR, chinese_name VARCHAR)
SELECT COUNT(points) FROM table_18888159_1 WHERE _number = 6
Name the total number of points for number 6
CREATE TABLE table_18888159_1 (points VARCHAR, _number VARCHAR)
SELECT "Song title" FROM table_72488 WHERE "Artist" = 'Billy Vaughn'
what is the nme of the song performed by billy vaughn?
CREATE TABLE table_72488 ( "Position" real, "Artist" text, "Song title" text, "Highest position" real, "Points" real )
SELECT romanised_name FROM table_2263674_1 WHERE portfolio = "Secretary for Health, Welfare and Food"
What's the romanised name of the official who was Secretary for health, welfare and food?
CREATE TABLE table_2263674_1 (romanised_name VARCHAR, portfolio VARCHAR)
SELECT location FROM table_18893428_1 WHERE driver = "Pierre de Caters"
What is the location that had a driver named Pierre de Caters?
CREATE TABLE table_18893428_1 (location VARCHAR, driver VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "ASIAN"
how many of the patients belonging to asian ethnic origin were unmarried?
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 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 ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT portfolio FROM table_2263674_1 WHERE romanised_name = "Anthony Leung Kam-chung"
What was Anthony Leung Kam-Chung previous position?
CREATE TABLE table_2263674_1 (portfolio VARCHAR, romanised_name VARCHAR)
SELECT constructor FROM table_18893428_1 WHERE driver = "George Heath"
Who is the constructor for the car driven by George Heath?
CREATE TABLE table_18893428_1 (constructor VARCHAR, driver VARCHAR)
SELECT name FROM table_16799784_2 WHERE latitude = "36.0N"
Name the name of 36.0n
CREATE TABLE table_16799784_2 ( name VARCHAR, latitude VARCHAR )
SELECT high_rebounds FROM table_22654073_13 WHERE date = "May 11"
List all high rebound entries from May 11.
CREATE TABLE table_22654073_13 (high_rebounds VARCHAR, date VARCHAR)
SELECT COUNT(driver) FROM table_18893428_1 WHERE constructor = "Mercedes-Benz"
What is the total number of drivers who have cars constructed by Mercedes-Benz?
CREATE TABLE table_18893428_1 (driver VARCHAR, constructor VARCHAR)
SELECT league_id FROM salary GROUP BY league_id ORDER BY SUM(salary) DESC LIMIT 1
What is the top league that pays the most to their players?
CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, inducted text, category text, needed_note text ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_state text, birth_city text, death_year text, death_month text, death_day text, death_country text, death_state text, death_city text, name_first text, name_last text, name_given text, weight text ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text )
SELECT COUNT(game) FROM table_22654073_13 WHERE date = "May 1"
How many games were there on May 1?
CREATE TABLE table_22654073_13 (game VARCHAR, date VARCHAR)
SELECT location FROM table_18893428_1 WHERE constructor = "Lorraine-Dietrich"
What is the location of the car that has a constructor of Lorraine-Dietrich?
CREATE TABLE table_18893428_1 (location VARCHAR, constructor VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.drug = "Sodium Fluoride (Dental Gel)"
how many of the patients aged below 31 were treated with sodium fluoride (dental gel)?
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 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 )
SELECT high_assists FROM table_22654073_13 WHERE series = "2-3"
List all high assists in series 2-3.
CREATE TABLE table_22654073_13 (high_assists VARCHAR, series VARCHAR)
SELECT COUNT(report) FROM table_18893428_1 WHERE driver = "Charles Jarrott"
How many times did Charles Jarrott report?
CREATE TABLE table_18893428_1 (report VARCHAR, driver VARCHAR)
SELECT COUNT(overall) FROM table_name_38 WHERE pick = 1 AND name = "cecil martin"
With the pick of 1 Cecil Martin has what number as the overall?
CREATE TABLE table_name_38 ( overall VARCHAR, pick VARCHAR, name 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 driver FROM table_18893428_1 WHERE constructor = "Mercedes-Benz"
Who is the driver of the entry constructed by Mercedes-Benz?
CREATE TABLE table_18893428_1 (driver VARCHAR, constructor VARCHAR)
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6215)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m', chartevents.charttime) <= '2103-09' GROUP BY STRFTIME('%y', chartevents.charttime)
get me patient 6215's yearly maximum weight until 09/2103.
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text )
SELECT score FROM table_22654073_7 WHERE team = "Chicago Bulls"
Name the score for chicago bulls
CREATE TABLE table_22654073_7 (score VARCHAR, team VARCHAR)
SELECT MIN(used__kb_) FROM table_18950885_3 WHERE graphics_mode = 4
What is the used (kb) when the graphics mode is 4?
CREATE TABLE table_18950885_3 (used__kb_ INTEGER, graphics_mode VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.admityear < "2184"
What is the number of patients admitted before 2184 who had overdose as their primary disease?
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 ) 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 ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT location_attendance FROM table_22654073_7 WHERE record = "22-8"
Name the location attendance for 22-8
CREATE TABLE table_22654073_7 (location_attendance VARCHAR, record VARCHAR)
SELECT char_cells FROM table_18950885_3 WHERE graphics_mode < 1.0
If graphics mode is less than 1.0, what are the char cells?
CREATE TABLE table_18950885_3 (char_cells VARCHAR, graphics_mode INTEGER)
SELECT "Player" FROM table_4316 WHERE "Position" = 'guard-forward' AND "Nationality" = 'argentina'
What Player is from Argentina and whose position is a guard-forward?
CREATE TABLE table_4316 ( "Player" text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
SELECT COUNT(high_points) FROM table_22654073_7 WHERE high_rebounds = "Mo Williams , LeBron James , J.J. Hickson (6)"
Name the high points for mo williams , lebron james , j.j. hickson (6)
CREATE TABLE table_22654073_7 (high_points VARCHAR, high_rebounds VARCHAR)
SELECT MIN(converted) FROM table_1895522_2 WHERE number = "19"
What is the smallest converted value at number 19?
CREATE TABLE table_1895522_2 (converted INTEGER, number VARCHAR)
SELECT competition FROM table_name_96 WHERE date = "30 december 2005"
What is Competition, when Date is 30 December 2005?
CREATE TABLE table_name_96 ( competition VARCHAR, date VARCHAR )
SELECT high_assists FROM table_22654073_7 WHERE date = "December 13"
Name the high assists for december 13
CREATE TABLE table_22654073_7 (high_assists VARCHAR, date VARCHAR)
SELECT original_title FROM table_18987377_1 WHERE film_title_used_in_nomination = "The Last Metro"
Name the original title for the last metro
CREATE TABLE table_18987377_1 (original_title VARCHAR, film_title_used_in_nomination VARCHAR)
SELECT MAX("Year [A ]") FROM table_47686 WHERE "Position" = 'linebacker' AND "College" = 'georgia tech'
What is the most recent year georgia tech chose a linebacker?
CREATE TABLE table_47686 ( "Year [A ]" real, "Pick" text, "Player" text, "Position" text, "College" text )