instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what's the former province with area (km 2 ) being 12,245.9
CREATE TABLE table_19085 ("Code" real,"County" text,"Former Province" text,"Area (km 2)" text,"Population Census 2009" real,"Capital" text)
SELECT "Former Province" FROM table_19085 WHERE "Area (km 2 )" = '12,245.9'
Which course of Study of Literature have 18 credits ?
CREATE TABLE area (course_id int,area 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_fe...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Study of Literature%' OR name LIKE '%Study of Literature%') AND credits = 18
What is the Away team of Tie no 1?
CREATE TABLE table_name_68 (away_team VARCHAR,tie_no VARCHAR)
SELECT away_team FROM table_name_68 WHERE tie_no = "1"
What country had a 100% cut?
CREATE TABLE table_24568 ("Country" text,"% of imports from Russia" text,"% cut" text,"Diversification" text,"Gas storage" text,"Alternative fuel" text)
SELECT "Country" FROM table_24568 WHERE "% cut" = '100%'
What was the status of the series that was run by tv channel Mediacorp tv12 Suria?
CREATE TABLE table_27469019_2 (status VARCHAR,television_channel VARCHAR)
SELECT status FROM table_27469019_2 WHERE television_channel = "MediaCorp TV12 Suria"
How many series had the chipset of the Intel Centrino Ultimate-N 6300 wireless LAN with the codename Arrandale?
CREATE TABLE table_199666_1 (chipset VARCHAR,codename VARCHAR,wireless_lan VARCHAR)
SELECT chipset FROM table_199666_1 WHERE codename = "Arrandale" AND wireless_lan = "Intel centrino Ultimate-N 6300"
Which player had a To par of 13?
CREATE TABLE table_46673 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" text)
SELECT "Player" FROM table_46673 WHERE "To par" = '13'
what is the sspec number when the part number is cw8064701470802?
CREATE TABLE table_name_2 (sspec_number VARCHAR,part_number_s_ VARCHAR)
SELECT sspec_number FROM table_name_2 WHERE part_number_s_ = "cw8064701470802"
How many runners-up did Espartanos de Margarita have?
CREATE TABLE table_34266 ("Team" text,"Winners" text,"Runners-Up" text,"Third Place" text,"Fourth Place" text)
SELECT "Runners-Up" FROM table_34266 WHERE "Team" = 'espartanos de margarita'
Get the name of tags used in 2011. Query for luckydonald http://stackoverflow.com/questions/34485255/get-each-tag-in-string-stackexchange-database?noredirect
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score ...
SELECT DISTINCT TagName AS Tag FROM PostHistory JOIN Tags ON PostHistory.Text LIKE ('%<' + Tags.TagName + '>%') WHERE YEAR(CreationDate) = 2011 AND PostHistoryTypeId IN (3, 6, 9)
what's the name of the test that patient 87733 first had until 05/2104.
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-05' ORDER BY labevents.charttime LIMIT 1)
which role is the most common from all the titles ?
CREATE TABLE table_201_21 (id number,"year" number,"title" text,"role" text,"notes" text)
SELECT "role" FROM table_201_21 GROUP BY "role" ORDER BY COUNT(*) DESC LIMIT 1
What are the names of the songs that have a lower rating than at least one blues song?
CREATE TABLE files (f_id number,artist_name text,file_size text,duration text,formats text)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 genre (g_name text,rating text,most_popular_in text)CREATE TAB...
SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues")
What was the biggest draws, for wins under 4, and points of 20-18?
CREATE TABLE table_name_29 (draws INTEGER,points VARCHAR,wins VARCHAR)
SELECT MAX(draws) FROM table_name_29 WHERE points = "20-18" AND wins < 4
Can one access the Faroe Islands using a Croatian identity card?
CREATE TABLE table_25965003_3 (access_using_a_croatian_identity_card VARCHAR,countries_and_territories VARCHAR)
SELECT access_using_a_croatian_identity_card FROM table_25965003_3 WHERE countries_and_territories = "Faroe Islands"
Where did the song by Michael Ball, which placed 2nd in Eurovision prior to 1961, place on the UK charts?
CREATE TABLE table_name_33 (uk_chart VARCHAR,artist VARCHAR,year VARCHAR,at_eurovision VARCHAR)
SELECT uk_chart FROM table_name_33 WHERE year > 1961 AND at_eurovision = "2nd" AND artist = "michael ball"
Find the cell mobile number of the candidates whose assessment code is 'Fail'?
CREATE TABLE candidates (candidate_id VARCHAR)CREATE TABLE candidate_assessments (candidate_id VARCHAR,asessment_outcome_code VARCHAR)CREATE TABLE people (cell_mobile_number VARCHAR,person_id VARCHAR)
SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"
How many Q1 figures are given for Alexander Wurz?
CREATE TABLE table_21252 ("Pos" text,"No" real,"Driver" text,"Constructor" text,"Q1 order" real,"Q1 time" text,"Q1 pos" real,"Q1+Q2 time" text)
SELECT COUNT("Q1 order") FROM table_21252 WHERE "Driver" = 'Alexander Wurz'
How many losses have draw values under 1?
CREATE TABLE table_36184 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real)
SELECT COUNT("Lost") FROM table_36184 WHERE "Drawn" < '1'
Which governor had William Henry Ashley as lieutenant governor?
CREATE TABLE table_64975 ("Governor" text,"Took office" text,"Left office" text,"Party" text,"Lieutenant Governor" text,"Terms" text)
SELECT "Governor" FROM table_64975 WHERE "Lieutenant Governor" = 'william henry ashley'
What is the before for the score of 63-67-66-71=267?
CREATE TABLE table_30546 ("#" text,"Player" text,"Country" text,"Score" text,"To par" text,"Winnings ($)" real,"After" real,"Before" real)
SELECT MIN("Before") FROM table_30546 WHERE "Score" = '63-67-66-71=267'
How many episodes in the series are from season 12?
CREATE TABLE table_24883 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT "No. in series" FROM table_24883 WHERE "No. in season" = '12'
What is the territory with 17 screens?
CREATE TABLE table_35577 ("Date" text,"Territory" text,"Screens" real,"Rank" real,"Gross" text)
SELECT "Territory" FROM table_35577 WHERE "Screens" = '17'
what is the english translation when the Language is english, Draw is smaller than 16, and the Artist is aysel and arash?
CREATE TABLE table_77002 ("Draw" real,"Language" text,"Artist" text,"Song" text,"English translation" text,"Place" real,"Points" real)
SELECT "English translation" FROM table_77002 WHERE "Language" = 'english' AND "Draw" < '16' AND "Artist" = 'aysel and arash'
Which Position has a Player of patrick macdonald?
CREATE TABLE table_name_35 (position VARCHAR,player VARCHAR)
SELECT position FROM table_name_35 WHERE player = "patrick macdonald"
What was the low number of draws for Levante Ud when their goal difference was smaller than 6?
CREATE TABLE table_59312 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MIN("Draws") FROM table_59312 WHERE "Club" = 'levante ud' AND "Goal Difference" < '6'
Who is week 3 if week 1 is Amanda Batt?
CREATE TABLE table_name_47 (week_3 VARCHAR,week_1 VARCHAR)
SELECT week_3 FROM table_name_47 WHERE week_1 = "amanda batt"
When did the Chiefs have their first bye?
CREATE TABLE table_69141 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT MIN("Week") FROM table_69141 WHERE "Attendance" = 'bye'
What lane did Bronte Barratt, who had a rank larger than 4, swim in?
CREATE TABLE table_name_79 (lane INTEGER,name VARCHAR,rank VARCHAR)
SELECT AVG(lane) FROM table_name_79 WHERE name = "bronte barratt" AND rank > 4
whats the name of the organism found in the last blood, venipuncture test of patient 031-3355 in this month?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunits...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME...
What is the largest silver value associated with 0 golds?
CREATE TABLE table_40368 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Silver") FROM table_40368 WHERE "Gold" < '0'
How many games played have 4.7 points per game?
CREATE TABLE table_2387461_1 (games_played VARCHAR,points_per_game VARCHAR)
SELECT COUNT(games_played) FROM table_2387461_1 WHERE points_per_game = "4.7"
What season has a Games listed of 10?
CREATE TABLE table_13925 ("SEASON" text,"TEAM" text,"LEAGUE" text,"GAMES" text,"GOALS" text)
SELECT "SEASON" FROM table_13925 WHERE "GAMES" = '10'
new javascript frameworks, Questions per month. How do Scala web frameworks compare to each other? I'm restricting the questions to those tagged Scala, to avoid polluting Playframework's result. It might be unfair, but I can't think of any other way to do it. At least all frameworks are being equally discriminated a...
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE T...
SELECT *, COUNT(*) FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId) AS pp JOIN PostTags AS pt ON ...
Give me the number of the dates when the max temperature was higher than 85, and display from low to high by the Y.
CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INTEGER,mean_humidity INTEGER,min_humidity INTEGER,max_sea_level_pressure_inches NUMERIC,mean_sea_level_pressure_inches NUM...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date)
how many patients whose insurance is medicaid and diagnoses short title is k. pneumoniae pneumonia?
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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "K. pneumoniae pneumonia"
which township has the largest population ?
CREATE TABLE table_203_510 (id number,"township" text,"fips" number,"population\ncenter" text,"population" number,"population\ndensity\n(/mi2)" number,"population\ndensity\n(/km2)" number,"land area\n(mi2)" number,"land area\n(km2)" number,"water area\n(mi2)" number,"water area\n(km2)" number,"geographic coordinates" t...
SELECT "township" FROM table_203_510 ORDER BY "population" DESC LIMIT 1
What is Colorado College's lowest pick number?
CREATE TABLE table_name_9 (pick__number INTEGER,college VARCHAR)
SELECT MIN(pick__number) FROM table_name_9 WHERE college = "colorado"
What shows for traditional when the population was 44,803?
CREATE TABLE table_60876 ("English Name" text,"Simplified" text,"Traditional" text,"Pinyin" text,"Area" text,"Population" text,"Density" text)
SELECT "Traditional" FROM table_60876 WHERE "Population" = '44,803'
What is every value for cores if TDP is 17 W?
CREATE TABLE table_2467150_2 (cores VARCHAR,tdp VARCHAR)
SELECT cores FROM table_2467150_2 WHERE tdp = "17 W"
Who were the candidates for election that had a result of a retired jacksonian gain?
CREATE TABLE table_28884 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "Candidates" FROM table_28884 WHERE "Result" = 'Retired Jacksonian gain'
The Away High Park Demons was which Ground?
CREATE TABLE table_75787 ("Date" text,"Time" text,"Home" text,"Away" text,"Score" text,"Ground" text)
SELECT "Ground" FROM table_75787 WHERE "Away" = 'high park demons'
What was the lowest attendance in round r1 at H venue?
CREATE TABLE table_name_13 (attendance INTEGER,round VARCHAR,venue VARCHAR)
SELECT MIN(attendance) FROM table_name_13 WHERE round = "r1" AND venue = "h"
count the number of patients whose discharge location is rehab/distinct part hosp and diagnoses short title is septic shock?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.short_title = "Septic shock"
count the number of patients whose admission location is clinic referral/premature and procedure icd9 code is 4233?
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 te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4233"
how many total players withdrew from the 2010 french open tennis competition ?
CREATE TABLE table_204_188 (id number,"rank" number,"player" text,"points" number,"points defending" number,"points won" number,"new points" number,"withdrew due to" text)
SELECT COUNT("player") FROM table_204_188
What is the Opponent with a Round with 3, and a Venue of home?
CREATE TABLE table_77995 ("Round" text,"Date" text,"Opponent" text,"Venue" text,"Result" text)
SELECT "Opponent" FROM table_77995 WHERE "Round" = '3' AND "Venue" = 'home'
What was the Premiership Years that had in the Competition of 1983-1992?
CREATE TABLE table_34194 ("Club" text,"Nickname" text,"Years in Competition" text,"No. of Premierships" real,"Premiership Years" text)
SELECT "Premiership Years" FROM table_34194 WHERE "Years in Competition" = '1983-1992'
What Region is the MHCL-20004 Catalog?
CREATE TABLE table_71460 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Region" FROM table_71460 WHERE "Catalog" = 'mhcl-20004'
What position does the 5-8 player from Grottoes, VA play?
CREATE TABLE table_name_10 (position VARCHAR,height VARCHAR,home_town VARCHAR)
SELECT position FROM table_name_10 WHERE height = "5-8" AND home_town = "grottoes, va"
What is the headphone model which was succeeded by sr325?
CREATE TABLE table_41551 ("Headphone Model" text,"Headphone Class" text,"Sensitivity (dB)" text,"Impedance (Ohms)" real,"Driver-matched dB" text,"Construction" text,"Earpads" text,"Termination" text,"Succeeded by" text)
SELECT "Headphone Model" FROM table_41551 WHERE "Succeeded by" = 'sr325'
What rider went under 22 laps with grid number 2?
CREATE TABLE table_name_11 (rider VARCHAR,laps VARCHAR,grid VARCHAR)
SELECT rider FROM table_name_11 WHERE laps < 22 AND grid = 2
What is the first and last name of the student participating in the most activities?
CREATE TABLE activity (actid number,activity_name text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE participates_in (stuid number,actid number)CREATE TABLE student (stuid numb...
SELECT T1.fname, T1.lname FROM student AS T1 JOIN participates_in AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid ORDER BY COUNT(*) DESC LIMIT 1
Which titles have 18.73 u.s. viewers.
CREATE TABLE table_1130632_1 (title VARCHAR,us_viewers__million_ VARCHAR)
SELECT title FROM table_1130632_1 WHERE us_viewers__million_ = "18.73"
what's the goals for/against with w-l-d being 3-1-1
CREATE TABLE table_14181578_1 (goals_for_against VARCHAR,w_l_d VARCHAR)
SELECT goals_for_against FROM table_14181578_1 WHERE w_l_d = "3-1-1"
What is the best when the qual 2 is 1:47.042?
CREATE TABLE table_name_5 (best VARCHAR,qual_2 VARCHAR)
SELECT best FROM table_name_5 WHERE qual_2 = "1:47.042"
what are the new prescriptions of patient 30826 today compared to what they were yesterday?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 t...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
who is the player when the country is united states and the score is 71-73=144?
CREATE TABLE table_name_93 (player VARCHAR,country VARCHAR,score VARCHAR)
SELECT player FROM table_name_93 WHERE country = "united states" AND score = 71 - 73 = 144
Which opponent has a score of 84-88 (ot)?
CREATE TABLE table_name_79 (opponent VARCHAR,score VARCHAR)
SELECT opponent FROM table_name_79 WHERE score = "84-88 (ot)"
What is the sum of laps of the honda cbr1000rr bike, which has a time of +16.569?
CREATE TABLE table_13235 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real)
SELECT SUM("Laps") FROM table_13235 WHERE "Bike" = 'honda cbr1000rr' AND "Time" = '+16.569'
Which Games have Years at club of 1977, and Goals of 17, and a Debut year smaller than 1977?
CREATE TABLE table_66244 ("Debut year" real,"Player" text,"Games" real,"Goals" real,"Years at club" text)
SELECT AVG("Games") FROM table_66244 WHERE "Years at club" = '1977' AND "Goals" = '17' AND "Debut year" < '1977'
did patient 031-4987 have the results of the microbiological tests during a month before?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND DATETIME(microlab.culturetakentime, 'start of month') = DATETI...
What episode number in the series had 2.77 million U.S. viewers?
CREATE TABLE table_26764 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"U.S. viewers (million)" text,"Original air date" text,"Production code" text)
SELECT MAX("No. in series") FROM table_26764 WHERE "U.S. viewers (million)" = '2.77'
what was the last competition they took place in ?
CREATE TABLE table_203_5 (id number,"season" text,"competition" text,"round" text,"opponent" text,"home" text,"away" text,"aggregate" text)
SELECT "competition" FROM table_203_5 ORDER BY id DESC LIMIT 1
Which Away has a Season of 2001 02, and an Opponent of dinaburg?
CREATE TABLE table_name_69 (away VARCHAR,season VARCHAR,opponent VARCHAR)
SELECT away FROM table_name_69 WHERE season = "2001–02" AND opponent = "dinaburg"
What is the cat no for the label mute and the standard cd format?
CREATE TABLE table_57925 ("Release format" text,"Country" text,"Label(s)" text,"Cat. no." text,"Release date" text)
SELECT "Cat. no." FROM table_57925 WHERE "Label(s)" = 'mute' AND "Release format" = 'standard cd'
what is the number of patients whose year of death is less than or equal to 2138 and diagnoses long title is acute on chronic systolic heart failure?
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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2138.0" AND diagnoses.long_title = "Acute on chronic systolic heart failure"
i would like to fly from DALLAS to DENVER on the morning of 8 27 leaving at 650
CREATE TABLE month (month_number int,month_name text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type t...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
How many points did the bills score when their opponent had 14
CREATE TABLE table_16028459_2 (bills_points VARCHAR,opponents VARCHAR)
SELECT bills_points FROM table_16028459_2 WHERE opponents = 14
What is 320 's size ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction 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,locati...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 320
What is the College with a Round # that is 290?
CREATE TABLE table_75862 ("Round #" real,"Pick #" text,"Player" text,"Position" text,"College" text)
SELECT "College" FROM table_75862 WHERE "Round #" = '290'
what is the number of the premiere for the 34 peak
CREATE TABLE table_31278 ("Rank" real,"English title" text,"Chinese title" text,"Average" real,"Peak" real,"Premiere" real,"Finale" real,"HK viewers" text)
SELECT "Premiere" FROM table_31278 WHERE "Peak" = '34'
give the number of patients whose admission type is urgent and primary disease is pneumonia.
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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "PNEUMONIA"
How many students have a food allergy?
CREATE TABLE Allergy_type (allergy VARCHAR,allergytype VARCHAR)CREATE TABLE Has_allergy (allergy VARCHAR)
SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"
what is the number of patients whose religion is christian scientist and admission year is less than 2190?
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 demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CHRISTIAN SCIENTIST" AND demographic.admityear < "2190"
what is the subject name and death status of subject id 2560?
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,la...
SELECT demographic.name, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560"
Name the % asian american for 23526
CREATE TABLE table_18963843_1 (_percentage_asian_american VARCHAR,indian_american_population__2010_ VARCHAR)
SELECT _percentage_asian_american FROM table_18963843_1 WHERE indian_american_population__2010_ = 23526
What is the number of interregnum for duration 3 months, 6 days?
CREATE TABLE table_16441 ("Interregnum began" text,"Interregnum ended" text,"Duration" text,"Count Palatine of Saxony" text,"Count Palatine of the Rhine" text)
SELECT COUNT("Interregnum ended") FROM table_16441 WHERE "Duration" = '3 months, 6 days'
What are the average ages for male and female students Plot them as bar chart, display by the y-axis in descending.
CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC
provide the number of patients whose drug type is additive.
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug_type = "ADDITIVE"
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of department_id bin hire_date by time in a bar chart, and I want to display from high to low by the y-axis.
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 regions (REGIO...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC
What is the number in season of the episode titled 'Cadaver'?
CREATE TABLE table_30979 ("Season no." real,"Series no." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text)
SELECT "Season no." FROM table_30979 WHERE "Title" = 'Cadaver'
Name the location of the church for berle kyrkje
CREATE TABLE table_178408_1 (location_of_the_church VARCHAR,church_name VARCHAR)
SELECT location_of_the_church FROM table_178408_1 WHERE church_name = "Berle kyrkje"
what is the number of patients whose days of hospital stay is greater than 11 and lab test name is alveolar-arterial gradient?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.label = "Alveolar-arterial Gradient"
Which segment A item that has a Segment D of wigs?
CREATE TABLE table_36076 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Segment A" FROM table_36076 WHERE "Segment D" = 'wigs'
How many people were at the match on July 13/
CREATE TABLE table_name_66 (attendance VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_66 WHERE date = "july 13"
Manager of spencer abbott, and a Year of 1919 involves what playoffs?
CREATE TABLE table_35654 ("Year" real,"League" text,"Class" text,"Record" text,"Finish" text,"Manager" text,"Playoffs" text)
SELECT "Playoffs" FROM table_35654 WHERE "Manager" = 'spencer abbott' AND "Year" = '1919'
What is the Place of the Player from Zimbabwe?
CREATE TABLE table_name_75 (place VARCHAR,country VARCHAR)
SELECT place FROM table_name_75 WHERE country = "zimbabwe"
How many patients born before the year 2043 had a lab test for cerebrospinal fluid (csf)?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
Which Athlete is from the United Kingdom?
CREATE TABLE table_name_14 (athlete VARCHAR,country_state VARCHAR)
SELECT athlete FROM table_name_14 WHERE country_state = "united kingdom"
What was the team the Suns played against in game number 4?
CREATE TABLE table_27312918_5 (team VARCHAR,game VARCHAR)
SELECT team FROM table_27312918_5 WHERE game = 4
What is Category, when Result is 'Won', and when Nominee is 'Bebe Neuwirth'?
CREATE TABLE table_name_95 (category VARCHAR,result VARCHAR,nominee VARCHAR)
SELECT category FROM table_name_95 WHERE result = "won" AND nominee = "bebe neuwirth"
What is the sum of Pick #, when Position is Guard, and when Round is greater than 2?
CREATE TABLE table_name_36 (pick__number INTEGER,position VARCHAR,round VARCHAR)
SELECT SUM(pick__number) FROM table_name_36 WHERE position = "guard" AND round > 2
what are the top four most frequent medications that followed within 2 months for patients who were given ssri administration - citalopram (celexa) since 5 years ago?
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 nu...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ssri administration - citalopram (celexa)' AND DAT...
What game number was played on March 4?
CREATE TABLE table_52180 ("Game #" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text,"Points" real)
SELECT AVG("Game #") FROM table_52180 WHERE "Date" = 'march 4'
Which company in the oil and gas industry has assets (billion $) under 235.45, sales (billion $) larger than 159.29 and brings in profits (billion $) of 19.28?
CREATE TABLE table_name_86 (company VARCHAR,profits__billion_$_ VARCHAR,industry VARCHAR,assets__billion_$_ VARCHAR,sales__billion_$_ VARCHAR)
SELECT company FROM table_name_86 WHERE assets__billion_$_ < 235.45 AND sales__billion_$_ > 159.29 AND industry = "oil and gas" AND profits__billion_$_ = 19.28
give me the top five most often prescribed drugs for patients 50s in 2101?
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 TABL...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND STRFTIME('%y', prescriptions.startdate) = '2101' GROUP BY prescriptions.drug) AS t1 WH...
Show the price ranges of hotels with 5 star ratings.
CREATE TABLE HOTELS (price_range VARCHAR,star_rating_code VARCHAR)
SELECT price_range FROM HOTELS WHERE star_rating_code = "5"
What wss the average round drafted for xavier players?
CREATE TABLE table_name_5 (round INTEGER,school VARCHAR)
SELECT AVG(round) FROM table_name_5 WHERE school = "xavier"
Which record has a time of 0:13?
CREATE TABLE table_78354 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" real,"Time" text,"Location" text)
SELECT "Record" FROM table_78354 WHERE "Time" = '0:13'