answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT players FROM table_27533947_1 WHERE grand_average = "12.76-202"
If the grand average is 12.76-202, who is the player?
CREATE TABLE table_27533947_1 (players VARCHAR, grand_average VARCHAR)
SELECT MAX(total) FROM table_name_25 WHERE gold = 0 AND bronze > 1
What is the total when the gold of 0, and a bronze larger than 1?
CREATE TABLE table_name_25 (total INTEGER, gold VARCHAR, bronze VARCHAR)
SELECT "Residential Monthly usage: 1000 kWh" FROM table_23947 WHERE "Large power Power demand: 50,000 kW; Consumption: 30,600,000 kWh, load factor: 85%." = '6.86'
What is every residential monthly usage if large power demand is 6.86?
CREATE TABLE table_23947 ( "City (Utility)" text, "Residential Monthly usage: 1000 kWh" text, "Small power Power demand: 40 kW; Consumption 10,000 kWh, load factor: 35%." text, "Medium power Power demand: 1,000 kW; Consumption: 400,000 kWh, load factor: 56 %." text, "Large power Power demand: 50,000 kW; Consumption: 30,600,000 kWh, load factor: 85%." text )
SELECT COUNT(games_won) FROM table_27533947_1 WHERE best_winning_average = "20"
How many players had a best winning average of 20?
CREATE TABLE table_27533947_1 (games_won VARCHAR, best_winning_average VARCHAR)
SELECT COUNT(bronze) FROM table_name_12 WHERE silver > 2
What is the total when bronze has a silver larger than 2?
CREATE TABLE table_name_12 (bronze VARCHAR, silver INTEGER)
SELECT COUNT("title") FROM table_203_353 WHERE "producer(s)" = 'mike "punch" harper'
how many tracks have their producer as mike punch harper ?
CREATE TABLE table_203_353 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "time" text )
SELECT record FROM table_27537518_4 WHERE date = "October 22"
What was the October 22 record?
CREATE TABLE table_27537518_4 (record VARCHAR, date VARCHAR)
SELECT SUM(silver) FROM table_name_14 WHERE total > 14 AND gold > 16
What is the sum of silver medals for teams with more than 14 total medals and more than 16 golds?
CREATE TABLE table_name_14 (silver INTEGER, total VARCHAR, gold VARCHAR)
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE
For employees without the letter M in their first name, give me a line chart to show the salary change over their hire date using a line chart, order from low to high by the X.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
SELECT MAX(attendance) FROM table_27537518_4 WHERE score = "6-4"
What was the 6-4 score's maximum attendance?
CREATE TABLE table_27537518_4 (attendance INTEGER, score VARCHAR)
SELECT rank FROM table_name_79 WHERE bronze = 3 AND silver = 0
What is the rank of the team having 3 bronzes and 0 silver?
CREATE TABLE table_name_79 (rank VARCHAR, bronze VARCHAR, silver VARCHAR)
SELECT AVG(total) FROM table_name_56 WHERE player = "craig stadler"
What is the Total of Player Craig Stadler?
CREATE TABLE table_name_56 ( total INTEGER, player VARCHAR )
SELECT score FROM table_27537518_4 WHERE game = 1
What was the score for game #1?
CREATE TABLE table_27537518_4 (score VARCHAR, game VARCHAR)
SELECT tries_against FROM table_name_39 WHERE points_against = "383"
How many tries against did the club with 383 points against have?
CREATE TABLE table_name_39 (tries_against VARCHAR, points_against VARCHAR)
SELECT MIN(won) FROM table_13018091_1 WHERE club = "Whitehaven"
How many games did whitehaven win?
CREATE TABLE table_13018091_1 ( won INTEGER, club VARCHAR )
SELECT record FROM table_27537518_4 WHERE date = "October 16"
What was the record for the October 16 game?
CREATE TABLE table_27537518_4 (record VARCHAR, date VARCHAR)
SELECT tries_against FROM table_name_90 WHERE tries_for = "48"
How many tries against did the club with 48 tries for have?
CREATE TABLE table_name_90 (tries_against VARCHAR, tries_for VARCHAR)
SELECT result FROM table_19753079_13 WHERE district = "Georgia 8"
What was the result of the Georgia 8 district?
CREATE TABLE table_19753079_13 ( result VARCHAR, district VARCHAR )
SELECT record FROM table_27537518_6 WHERE first_star = "J. Oduya"
What was the record in the game whose first star was J. Oduya?
CREATE TABLE table_27537518_6 (record VARCHAR, first_star VARCHAR)
SELECT points FROM table_name_59 WHERE lost = "13" AND points_against = "461"
How many points did the club with 13 losses and 461 points against have?
CREATE TABLE table_name_59 (points VARCHAR, lost VARCHAR, points_against VARCHAR)
SELECT lead FROM table_name_25 WHERE left_bloc = "8.4%"
Name the lead with left bloc of 8.4%
CREATE TABLE table_name_25 ( lead VARCHAR, left_bloc VARCHAR )
SELECT score FROM table_27537518_6 WHERE first_star = "O. Pavelec"
What was the score of the game whose first star was O. Pavelec?
CREATE TABLE table_27537518_6 (score VARCHAR, first_star VARCHAR)
SELECT tries_against FROM table_name_92 WHERE club = "pentyrch rfc"
How many tries against did Pentyrch RFC have?
CREATE TABLE table_name_92 (tries_against VARCHAR, club VARCHAR)
SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "6983"
what is admission time of subject id 6983?
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 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 )
SELECT decision FROM table_27537518_6 WHERE date = "December 26"
Who made the decision in the game played on December 26?
CREATE TABLE table_27537518_6 (decision VARCHAR, date VARCHAR)
SELECT MIN(drawn) FROM table_name_83 WHERE games < 7
What is the lowest drawn that has games less than 7?
CREATE TABLE table_name_83 (drawn INTEGER, games INTEGER)
SELECT date FROM table_name_48 WHERE leading_scorer = "ricky davis (20)"
When has a Leading scorer of ricky davis (20)?
CREATE TABLE table_name_48 ( date VARCHAR, leading_scorer VARCHAR )
SELECT location FROM table_27537518_6 WHERE attendance = 10056
Where was the game seen by 10056 people played?
CREATE TABLE table_27537518_6 (location VARCHAR, attendance VARCHAR)
SELECT COUNT(lost) FROM table_name_50 WHERE points > 14
Hoe many of lost have points greater than 14?
CREATE TABLE table_name_50 (lost VARCHAR, points INTEGER)
SELECT MIN("To par") FROM table_58996 WHERE "Country" = 'australia' AND "Score" = '76-70-75-72=293'
What is the lowest to par of a player from australia with a score of 76-70-75-72=293?
CREATE TABLE table_58996 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( \u00a3 )" text )
SELECT first_star FROM table_27537518_6 WHERE record = "17-11-5"
Who was the first star of the game with record of 17-11-5?
CREATE TABLE table_27537518_6 (first_star VARCHAR, record VARCHAR)
SELECT COUNT(lost) FROM table_name_81 WHERE points = 11 AND drawn > 1
How many of lost have 11 as the points, and a drawn greater than 1?
CREATE TABLE table_name_81 (lost VARCHAR, points VARCHAR, drawn VARCHAR)
SELECT rules FROM table_name_2 WHERE event = "n/a" AND result = "loss" AND location = "winsford england"
Which rule has The Event of n/a, The Result of loss, and The Location of winsford england?
CREATE TABLE table_name_2 ( rules VARCHAR, location VARCHAR, event VARCHAR, result VARCHAR )
SELECT decision FROM table_27537518_6 WHERE first_star = "V. Lecavalier"
Who made the decisions in the game whose first star was V. Lecavalier?
CREATE TABLE table_27537518_6 (decision VARCHAR, first_star VARCHAR)
SELECT MIN(games) FROM table_name_26 WHERE drawn < 0
What is the lowest game that has a drawn less than 0?
CREATE TABLE table_name_26 (games INTEGER, drawn INTEGER)
SELECT "First publisher" FROM table_64833 WHERE "Year" < '1999'
What is the First Publisher prior to 1999?
CREATE TABLE table_64833 ( "Japanese Title" text, "English Title" text, "Year" real, "First publisher" text, "ISBN" text )
SELECT score FROM table_27537518_7 WHERE record = "22-16-6"
What was the final score the game where the Thrashers over-all record went to 22-16-6?
CREATE TABLE table_27537518_7 (score VARCHAR, record VARCHAR)
SELECT MIN(total) FROM table_name_51 WHERE bronze = 0 AND silver > 0 AND rank = 5
Which Total is the lowest one that has a Bronze of 0, and a Silver larger than 0, and a Rank of 5?
CREATE TABLE table_name_51 (total INTEGER, rank VARCHAR, bronze VARCHAR, silver VARCHAR)
SELECT bowl_game FROM table_23718905_6 WHERE matchup_results = "Oklahoma 31, Stanford 27"
In what bowl game was the result Oklahoma 31, Stanford 27?
CREATE TABLE table_23718905_6 ( bowl_game VARCHAR, matchup_results VARCHAR )
SELECT decision FROM table_27537518_7 WHERE score = "1-7"
Who got the decision in the game, when the final score was 1-7?
CREATE TABLE table_27537518_7 (decision VARCHAR, score VARCHAR)
SELECT SUM(bronze) FROM table_name_69 WHERE total < 2 AND silver > 0 AND gold < 0
Which Bronze has a Total smaller than 2, and a Silver larger than 0, and a Gold smaller than 0?
CREATE TABLE table_name_69 (bronze INTEGER, gold VARCHAR, total VARCHAR, silver VARCHAR)
SELECT loss FROM table_name_98 WHERE date = "august 7"
Who recorded the loss on august 7?
CREATE TABLE table_name_98 ( loss VARCHAR, date VARCHAR )
SELECT date FROM table_27537518_7 WHERE first_star = "M. Grabovski"
What date was M. Grabovski the first start of the game?
CREATE TABLE table_27537518_7 (date VARCHAR, first_star VARCHAR)
SELECT MIN(rank) FROM table_name_38 WHERE nation = "switzerland" AND bronze < 0
Which Rank is the lowest one that has a Nation of switzerland, and a Bronze smaller than 0?
CREATE TABLE table_name_38 (rank INTEGER, nation VARCHAR, bronze VARCHAR)
SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000
What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?
CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text )
SELECT record FROM table_27537518_9 WHERE opponent = "Carolina Hurricanes"
What was the record for the game where the opponent was the Carolina Hurricanes?
CREATE TABLE table_27537518_9 (record VARCHAR, opponent VARCHAR)
SELECT MAX(total) FROM table_name_87 WHERE bronze = 0 AND nation = "poland" AND gold < 0
Which Total is the highest one that has a Bronze of 0, and a Nation of poland, and a Gold smaller than 0?
CREATE TABLE table_name_87 (total INTEGER, gold VARCHAR, bronze VARCHAR, nation VARCHAR)
SELECT "Revised" FROM table_31729 WHERE "McCune-Reischauer" = 'yŏn (s) ryŏn (n)'
Tell me the revised of mccune reischauer of y n (s) ry n (n)
CREATE TABLE table_31729 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "Estimated distribution (2000)*" real )
SELECT date FROM table_27537518_9 WHERE record = "27-28-11"
On which date was the record of 27-28-11 set?
CREATE TABLE table_27537518_9 (date VARCHAR, record VARCHAR)
SELECT save FROM table_name_49 WHERE attendance = "23,394"
What is the save of the game that 23,394 people attended?
CREATE TABLE table_name_49 (save VARCHAR, attendance VARCHAR)
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
what was the top four most frequent diagnosis in a year before?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 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 )
SELECT decision FROM table_27537518_9 WHERE record = "29-28-12"
Who made the decision on the game where the record was 29-28-12?
CREATE TABLE table_27537518_9 (decision VARCHAR, record VARCHAR)
SELECT MIN(date) FROM table_name_51 WHERE competition = "league" AND venue = "away" AND opponent = "swindon wildcats" AND attendance > 1 OFFSET 201
Whihc Date is the lowest one that has a Competition of league, and a Venue of away, and an Opponent of swindon wildcats, and an Attendance larger than 1,201?
CREATE TABLE table_name_51 (date INTEGER, attendance VARCHAR, opponent VARCHAR, competition VARCHAR, venue 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 decision FROM table_27537518_9 WHERE record = "27-28-11"
Who made the decision on the game where the record was 27-28-11?
CREATE TABLE table_27537518_9 (decision VARCHAR, record VARCHAR)
SELECT COUNT(date) FROM table_name_24 WHERE opponent = "romford raiders" AND result = "won 7-3" AND attendance > 1 OFFSET 769
How many Dates have an Opponent of romford raiders, and a Result of won 7-3, and an Attendance larger than 1,769?
CREATE TABLE table_name_24 (date VARCHAR, attendance VARCHAR, opponent VARCHAR, result VARCHAR)
SELECT "Gregorian Months" FROM table_7922 WHERE "Season in Tamil" = 'குளிர்'
What are the gregorian months for the season in Tamil?
CREATE TABLE table_7922 ( "Season in Tamil" text, "English Transliteration" text, "English Translation" text, "Season in Sanskrit" text, "Season in English" text, "Tamil Months" text, "Gregorian Months" text )
SELECT score FROM table_27539272_4 WHERE game = 5
Name the score for game 5
CREATE TABLE table_27539272_4 (score VARCHAR, game VARCHAR)
SELECT AVG(date) FROM table_name_96 WHERE opponent = "milton keynes lightning" AND attendance < 1 OFFSET 771
Which Date has an Opponent of milton keynes lightning, and an Attendance smaller than 1,771?
CREATE TABLE table_name_96 (date INTEGER, opponent VARCHAR, attendance VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2148"
Specify the number of elective admissions before the year 2148
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 ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT MAX(points) FROM table_27539272_4 WHERE record = "1-3-1"
Name the most points for 1-3-1 record
CREATE TABLE table_27539272_4 (points INTEGER, record VARCHAR)
SELECT MAX(attendance) FROM table_name_43 WHERE date = "october 25"
Which Attendance has a Date of october 25?
CREATE TABLE table_name_43 (attendance INTEGER, date VARCHAR)
SELECT tries_against FROM table_13564702_4 WHERE tries_for = "62"
How many tries against got the club with 62 tries for?
CREATE TABLE table_13564702_4 ( tries_against VARCHAR, tries_for VARCHAR )
SELECT record FROM table_27539272_4 WHERE location_attendance = "Prudential Center - 12,880"
Name the record for prudential center - 12,880
CREATE TABLE table_27539272_4 (record VARCHAR, location_attendance VARCHAR)
SELECT score FROM table_name_72 WHERE visitor = "atlanta"
Which Score has a Visitor of atlanta?
CREATE TABLE table_name_72 (score VARCHAR, visitor VARCHAR)
SELECT COUNT(no) FROM table_11545282_7 WHERE years_for_jazz = "2010"
How many players only played for the Jazz in only 2010?
CREATE TABLE table_11545282_7 ( no VARCHAR, years_for_jazz VARCHAR )
SELECT COUNT(record) FROM table_27539272_4 WHERE location_attendance = "HP Pavilion - 17,562"
Name the number of record for hp pavilion - 17,562
CREATE TABLE table_27539272_4 (record VARCHAR, location_attendance VARCHAR)
SELECT yards FROM table_name_74 WHERE attempts = "247"
Which Yards has a Attempts of 247
CREATE TABLE table_name_74 (yards VARCHAR, attempts 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 = "3799" AND prescriptions.drug_type = "ADDITIVE"
count the number of patients whose procedure icd9 code is 3799 and drug type is additive?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT COUNT(october) FROM table_27537870_3 WHERE score = "6-1"
On how many days in October was the score 6-1?
CREATE TABLE table_27537870_3 (october VARCHAR, score VARCHAR)
SELECT yards FROM table_name_26 WHERE completion__percentage = "64.9%"
Which yard has a Completion of 64.9%?
CREATE TABLE table_name_26 (yards VARCHAR, completion__percentage 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, admissions.hadm_id 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 = 'ac posthemorrhag anemia') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.age >= 60 AND STRFTIME('%y', prescriptions.startdate) <= '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4
what are the four most frequent drugs that were prescribed in the same hospital encounter to patients aged 60 or above after they had been diagnosed with ac posthemorrhag anemia, until 2104?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE 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 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 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 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE 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 )
SELECT location_attendance FROM table_27537870_3 WHERE record = "3-5-1"
What is the location and what was the attendance on those days when the score was 3-5-1?
CREATE TABLE table_27537870_3 (location_attendance VARCHAR, record VARCHAR)
SELECT completions FROM table_name_36 WHERE yards = "10,098"
Which Completions has Yards of 10,098?
CREATE TABLE table_name_36 (completions VARCHAR, yards VARCHAR)
SELECT opponent FROM table_1341522_38 WHERE district = "Ohio12"
who is the the opponent with district being ohio12
CREATE TABLE table_1341522_38 ( opponent VARCHAR, district VARCHAR )
SELECT COUNT(location_attendance) FROM table_27537870_3 WHERE record = "2-5-1"
How many times was the sabres record 2-5-1?
CREATE TABLE table_27537870_3 (location_attendance VARCHAR, record VARCHAR)
SELECT year FROM table_name_3 WHERE attempts = "282"
When has Attempts of 282 ?
CREATE TABLE table_name_3 (year VARCHAR, attempts VARCHAR)
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination) DESC
How many flights in each destination city? Return a bar chart, and list in descending by the y axis please.
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) )
SELECT location_attendance FROM table_27539272_7 WHERE game = 41
What was the location and attendance for game 41?
CREATE TABLE table_27539272_7 (location_attendance VARCHAR, game VARCHAR)
SELECT completions FROM table_name_89 WHERE attempts = "1,271"
Which Completions has Attempts of 1,271?
CREATE TABLE table_name_89 (completions VARCHAR, attempts VARCHAR)
SELECT "Player" FROM table_58531 WHERE "Round" = '11' AND "Pick" = '302'
What player is picked 302 in round 11?
CREATE TABLE table_58531 ( "Pick" real, "Round" real, "Player" text, "Position" text, "School" text )
SELECT MAX(january) FROM table_27539272_7 WHERE record = "10-29-2"
On what day of January was the record 10-29-2?
CREATE TABLE table_27539272_7 (january INTEGER, record VARCHAR)
SELECT completion__percentage FROM table_name_57 WHERE yards = "2,175"
which Completion % has a Yards of 2,175?
CREATE TABLE table_name_57 (completion__percentage VARCHAR, yards VARCHAR)
SELECT "athlete" FROM table_204_155 WHERE "nationality" = 'poland' ORDER BY "time" LIMIT 1
which athlete from poland had the lowest time ?
CREATE TABLE table_204_155 ( id number, "rank" number, "heat" number, "athlete" text, "nationality" text, "time" number, "notes" text )
SELECT MAX(points) FROM table_27539272_7 WHERE score = "1-2"
What are the most points scored in a game where the score was 1-2?
CREATE TABLE table_27539272_7 (points INTEGER, score VARCHAR)
SELECT surface FROM table_name_86 WHERE opponent = "adrian ungur"
What was the surface for Adrian Ungur as an opponent?
CREATE TABLE table_name_86 (surface VARCHAR, opponent VARCHAR)
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4
among patients of age 50s during the previous year, what were the top four most frequent lab tests?
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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
SELECT MAX(january) FROM table_27539272_7 WHERE record = "15-29-3"
On what day in January was the record 15-29-3?
CREATE TABLE table_27539272_7 (january INTEGER, record VARCHAR)
SELECT score FROM table_name_5 WHERE surface = "clay" AND date = "may 29, 2006"
What was the score on a clay surface on May 29, 2006?
CREATE TABLE table_name_5 (score VARCHAR, surface VARCHAR, date VARCHAR)
SELECT compression_ratio FROM table_name_41 WHERE engine = "302-2v windsor v8"
What is the compression ratio for the 302-2v Windsor v8 engine?
CREATE TABLE table_name_41 ( compression_ratio VARCHAR, engine VARCHAR )
SELECT opponent FROM table_27539535_5 WHERE record = "5-18-5"
Against what team did the Islanders have a 5-18-5 record?
CREATE TABLE table_27539535_5 (opponent VARCHAR, record VARCHAR)
SELECT tournament FROM table_name_75 WHERE score = "6–3, 7–6"
Which tournament had a score of 6–3, 7–6?
CREATE TABLE table_name_75 (tournament VARCHAR, score VARCHAR)
SELECT "Date" FROM table_5055 WHERE "Road Team" = 'portland' AND "Game" = 'game 2'
On what date was Portland on the road for Game 2?
CREATE TABLE table_5055 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
SELECT opponent FROM table_27539535_5 WHERE score = "5-4"
Against what opponent did the game end 5-4?
CREATE TABLE table_27539535_5 (opponent VARCHAR, score VARCHAR)
SELECT surface FROM table_name_15 WHERE opponent = "michael berrer"
On what surface was the opponent Michael Berrer?
CREATE TABLE table_name_15 (surface VARCHAR, opponent VARCHAR)
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2016
What is on the list of the Spring MKT upper-level classes ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int )
SELECT COUNT(december) FROM table_27539535_5 WHERE record = "9-19-6"
How many games were played against a team with a 9-19-6 record against the Islanders?
CREATE TABLE table_27539535_5 (december VARCHAR, record VARCHAR)
SELECT MAX(games) FROM table_name_58 WHERE points = 2
What game has 2 points?
CREATE TABLE table_name_58 (games INTEGER, points VARCHAR)
SELECT COUNT("Year") FROM table_18004 WHERE "Champion" = 'Jiyai Shin'
What year is Jiyai Shin the champion?
CREATE TABLE table_18004 ( "Year" real, "Dates" text, "Champion" text, "Score" real, "To par" text, "Margin of victory" text, "Purse ( $ )" real, "Winners share ($)" real )
SELECT COUNT(opponent) FROM table_27539808_3 WHERE october = 9
How many games did they play on october 9?
CREATE TABLE table_27539808_3 (opponent VARCHAR, october VARCHAR)