instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Name the country that has m ntt
CREATE TABLE table_name_2 (country VARCHAR,place VARCHAR)
SELECT country FROM table_name_2 WHERE place = "mänttä"
which team has the least win percentage ?
CREATE TABLE table_204_905 (id number,"team" text,"wins" number,"losses" number,"win %" number,"gb" number)
SELECT "team" FROM table_204_905 ORDER BY "win %" LIMIT 1
Who was the winner in the competition in which Lyn took third place and Lillestr m was the runner-up?
CREATE TABLE table_52280 ("Years" text,"Winners" text,"Runners-Up" text,"Score" text,"Third" text)
SELECT "Winners" FROM table_52280 WHERE "Runners-Up" = 'lillestrøm' AND "Third" = 'lyn'
what is the number of patients whose insurance is private and admission year is less than 2168?
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,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2168"
What is the sum of the kono with a bonthe greater than 21,238?
CREATE TABLE table_name_38 (kono INTEGER,bonthe INTEGER)
SELECT SUM(kono) FROM table_name_38 WHERE bonthe > 21 OFFSET 238
What is the FIPS code for the municipality that has an area of 114.76 sq mi (297.23 sq km) and had a 2010 population of less than 166,327?
CREATE TABLE table_name_70 (fips_code INTEGER,area VARCHAR,population__2010_ VARCHAR)
SELECT AVG(fips_code) FROM table_name_70 WHERE area = "114.76 sq mi (297.23 sq km)" AND population__2010_ < 166 OFFSET 327
What is the latest year established that had 5 powiats?
CREATE TABLE table_21963 ("Voivodeship after 1569" text,"Capital" text,"Year established" real,"Number of powiats" text,"Area (km\u00b2) in 1590 (Lithuanian) Category:Articles with Lithuanian-language external links" real)
SELECT MAX("Year established") FROM table_21963 WHERE "Number of powiats" = '5 powiats'
what is the daily minimum amount of pt - inr patient 016-5834 has since 2102?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,cellla...
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-5834')) AND lab.labname = 'pt - inr' AND STRFTIME('%y', lab.labresulttime) >= ...
What is the Project Name with a Country that is opec?
CREATE TABLE table_name_36 (project_name VARCHAR,country VARCHAR)
SELECT project_name FROM table_name_36 WHERE country = "opec"
What is KK - 5 if KK - 1 is 1,067?
CREATE TABLE table_54045 ("KK - 1" text,"KK - 2" text,"KK - 3" text,"KK - 4" text,"KK - 5" text,"KK - 6" text,"KK - 7" text)
SELECT "KK - 5" FROM table_54045 WHERE "KK - 1" = '1,067'
If Powershell (alias) is cpi, copy, cp, what are all corresponding descriptions.
CREATE TABLE table_72548 ("PowerShell (Cmdlet)" text,"PowerShell (Alias)" text,"CMD.EXE / COMMAND.COM" text,"Unix shell" text,"Description" text)
SELECT "Description" FROM table_72548 WHERE "PowerShell (Alias)" = 'cpi, copy, cp'
How many different scores are there for the game with 10-3-4 record?
CREATE TABLE table_25950 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT COUNT("Score") FROM table_25950 WHERE "Record" = '10-3-4'
which part on the team does rick schuhwerk play
CREATE TABLE table_29983 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Position" FROM table_29983 WHERE "Player" = 'Rick Schuhwerk'
How many numbers in series were for the number in season of 8?
CREATE TABLE table_28382 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by:" text,"Original air date" text)
SELECT COUNT("No. in series") FROM table_28382 WHERE "No. in season" = '8'
Name the winning constructor for when the fastest lap was mark webber at the malaysian grand prix
CREATE TABLE table_70209 ("Grand Prix" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Winning constructor" text,"Report" text)
SELECT "Winning constructor" FROM table_70209 WHERE "Fastest lap" = 'mark webber' AND "Grand Prix" = 'malaysian grand prix'
Who was the interview subject in the 2-86 issue?
CREATE TABLE table_1566848_7 (interview_subject VARCHAR,date VARCHAR)
SELECT interview_subject FROM table_1566848_7 WHERE date = "2-86"
what is the maximum amount of hospital cost which includes a iron testing lab test until 2 years ago?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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,sp...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'iron')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_id) A...
what is the places when for the soviet union with a rank more than 11?
CREATE TABLE table_58360 ("Rank" real,"Name" text,"Nation" text,"SP+FS" real,"Points" real,"Places" real)
SELECT SUM("Places") FROM table_58360 WHERE "Nation" = 'soviet union' AND "Rank" > '11'
what is the name of the drug that was prescribed to patient 009-5001 in the same day, after having been diagnosed with lower gi bleeding this month?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid num...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001') AND diagnosis.diagnosi...
What are the last year of the parties whose theme is 'Spring' or 'Teqnology'? Bin the last year into weekday interval and count them.
CREATE TABLE party_host (Party_ID int,Host_ID int,Is_Main_in_Charge bool)CREATE TABLE host (Host_ID int,Name text,Nationality text,Age text)CREATE TABLE party (Party_ID int,Party_Theme text,Location text,First_year text,Last_year text,Number_of_hosts int)
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology"
what is the total quantity of output (ml)-ng/og tube orogastric center mouth output patient 005-46456 had on 11/05/last year?
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 tim...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND intakeoutput.celllabel = 'outpu...
Which To par has a Player of emlyn aubrey?
CREATE TABLE table_9375 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "To par" FROM table_9375 WHERE "Player" = 'emlyn aubrey'
how many more goals did he have in 2009 than 2005 ?
CREATE TABLE table_203_34 (id number,"season" text,"appearance" number,"interchange" number,"tries" number,"goals" number,"f/g" number,"points" number)
SELECT (SELECT "goals" FROM table_203_34 WHERE "season" = 2009) - (SELECT "goals" FROM table_203_34 WHERE "season" = 2005)
Show the crime rate of counties with a city having white percentage more than 90.
CREATE TABLE city (County_ID VARCHAR,White INTEGER)CREATE TABLE county_public_safety (Crime_rate VARCHAR,County_ID VARCHAR)
SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90
Which Week has an Opponent of baltimore colts, and an Attendance smaller than 55,137?
CREATE TABLE table_34410 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" real)
SELECT AVG("Week") FROM table_34410 WHERE "Opponent" = 'baltimore colts' AND "Attendance" < '55,137'
what is the highest ngc number when the declination (j2000) is 25 26 ?
CREATE TABLE table_53390 ("NGC number" real,"Object type" text,"Constellation" text,"Right ascension (J2000)" text,"Declination (J2000)" text)
SELECT MAX("NGC number") FROM table_53390 WHERE "Declination ( J2000 )" = '°25′26″'
What season episode is directed by Skipp Sudduth?
CREATE TABLE table_21625 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Season #" FROM table_21625 WHERE "Directed by" = 'Skipp Sudduth'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the average of department_id , and group by attribute job_id, and visualize them by a bar chart, I want to sort by the x-axis in desc.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,J...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
What is the total number with Nov 2012 with a Jun 2013 larger than 542, and a Aug 2011 more than 935?
CREATE TABLE table_51531 ("Feb 2010" text,"Mar 2010" text,"May 2010" real,"Jun 2010" real,"Jul 2010" real,"Aug 2010" real,"Sep 2010" real,"Oct 2010" real,"Nov 2010" real,"Dec 2010" real,"Jan 2011" real,"Feb 2011" real,"Mar 2011" real,"Apr 2011" real,"May 2011" real,"Jun 2011" real,"Jul 2011" real,"Aug 2011" real,"Sep 2...
SELECT COUNT("Nov 2012") FROM table_51531 WHERE "Jun 2013" > '542' AND "Aug 2011" > '935'
What is listed under part 1 for class 3b?
CREATE TABLE table_1745843_2 (part_1 VARCHAR,class VARCHAR)
SELECT part_1 FROM table_1745843_2 WHERE class = "3b"
Name the high reobounds for april 7
CREATE TABLE table_17058178_11 (high_rebounds VARCHAR,date VARCHAR)
SELECT high_rebounds FROM table_17058178_11 WHERE date = "April 7"
Find the name and capacity of the stadium where the event named 'World Junior' happened.
CREATE TABLE stadium (id number,name text,capacity number,city text,country text,opening_year number)CREATE TABLE record (id number,result text,swimmer_id number,event_id number)CREATE TABLE event (id number,name text,stadium_id number,year text)CREATE TABLE swimmer (id number,name text,nationality text,meter_100 numbe...
SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'
What district is the democratic Francis C. Le Blond from?
CREATE TABLE table_39223 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text)
SELECT "District" FROM table_39223 WHERE "Party" = 'democratic' AND "Incumbent" = 'francis c. le blond'
List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.
CREATE TABLE management (department_id VARCHAR,head_id VARCHAR)CREATE TABLE department (department_id VARCHAR,name VARCHAR)CREATE TABLE head (born_state VARCHAR,head_id VARCHAR)
SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Treasury' INTERSECT SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = ...
select * from posts where posts.ViewCount > 15000 and posts.ViewCount < 20000.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE CloseAsOffTopicReasonTy...
SELECT * FROM Posts WHERE Posts.ViewCount > 15000 AND Posts.ViewCount < 20000
how many times did bekele record a 10,000 metre year 's best in brussels ?
CREATE TABLE table_204_576 (id number,"year" number,"best" text,"location" text,"date" text,"world rank" text)
SELECT COUNT(*) FROM table_204_576 WHERE "location" = 'brussels'
What is the highest Super G that had an 11 Downhill and an overall less than 16?
CREATE TABLE table_name_6 (super_g INTEGER,downhill VARCHAR,overall VARCHAR)
SELECT MAX(super_g) FROM table_name_6 WHERE downhill = "11" AND overall < 16
What is Couple, when Choreographer(s) is Nakul Dev Mahajan?
CREATE TABLE table_6863 ("Couple" text,"Style" text,"Music" text,"Choreographer(s)" text,"Chosen by" text)
SELECT "Couple" FROM table_6863 WHERE "Choreographer(s)" = 'nakul dev mahajan'
WHICH State/country that has ray roberts?
CREATE TABLE table_name_43 (state_country VARCHAR,skipper VARCHAR)
SELECT state_country FROM table_name_43 WHERE skipper = "ray roberts"
What is the original title of the film for which Dersu Uzala was nominated?
CREATE TABLE table_71119 ("Country" text,"Film title used in nomination" text,"Language" text,"Original title" text,"Director" text)
SELECT "Original title" FROM table_71119 WHERE "Film title used in nomination" = 'dersu uzala'
Where was the universiade held in 1959?
CREATE TABLE table_58100 ("Year" real,"Tournament" text,"Venue" text,"Result" text,"Extra" text)
SELECT "Venue" FROM table_58100 WHERE "Tournament" = 'universiade' AND "Year" = '1959'
What is the lowest episode number that had a ratings/share (18-49) of 1.1/3?
CREATE TABLE table_28087 ("Episode Number" real,"Episode" text,"Rating" text,"Share" real,"Rating/Share (18-49)" text,"Viewers (millions)" text,"Rank (Timeslot)" real,"Rank (Night)" real)
SELECT MIN("Episode Number") FROM table_28087 WHERE "Rating/Share (18-49)" = '1.1/3'
For those products with a price between 60 and 120, draw a scatter chart about the correlation between code and price , and group by attribute name.
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 Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
what is primary disease and procedure short title of subject name lue white?
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 demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Lue White"
Give me a bar chart for how many name of each name
CREATE TABLE train (Train_ID int,Train_Num text,Name text,From text,Arrival text,Railway_ID int)CREATE TABLE manager (Manager_ID int,Name text,Country text,Working_year_starts text,Age int,Level int)CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE railway (Railway_ID int,Railway te...
SELECT Name, COUNT(Name) FROM train GROUP BY Name
How many military deaths were there when there were 1,615 total casualties?
CREATE TABLE table_name_92 (military_deaths VARCHAR,total_casualties VARCHAR)
SELECT military_deaths FROM table_name_92 WHERE total_casualties = "1,615"
what is the number of countries listed in the table
CREATE TABLE table_203_102 (id number,"event" text,"performance" text,"athlete" text,"nation" text,"place" text,"date" text)
SELECT COUNT(DISTINCT "nation") FROM table_203_102
What was the nationality of the skater with 108.8 points?
CREATE TABLE table_37828 ("Rank" real,"Name" text,"Club" text,"Nation" text,"Points" real)
SELECT "Nation" FROM table_37828 WHERE "Points" = '108.8'
who is the home team when the away team is ipswich town?
CREATE TABLE table_name_34 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_34 WHERE away_team = "ipswich town"
What position did Lee Gilmour play while having more than 4 Tries and 20 points?
CREATE TABLE table_52441 ("Player" text,"Position" text,"Tries" real,"Goals" real,"Points" real)
SELECT "Position" FROM table_52441 WHERE "Tries" > '4' AND "Points" = '20' AND "Player" = 'lee gilmour'
What player scored 70-73-69-72=284?
CREATE TABLE table_48648 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real)
SELECT "Player" FROM table_48648 WHERE "Score" = '70-73-69-72=284'
Draw a bar chart for how many medications are prescribed for each brand?, rank in descending by the y axis.
CREATE TABLE Stay (StayID INTEGER,Patient INTEGER,Room INTEGER,StayStart DATETIME,StayEnd DATETIME)CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEXT)CREATE TABLE Medication (Code INTEGER,Name VARCHAR(30),Brand VARCHAR(30)...
SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY COUNT(*) DESC
What was the date of the victory when the Soviet Unit was 73 giap, and the Enemy Aircraft was bf.109g-? w.nr.?
CREATE TABLE table_name_74 (date__ddmmyyyy_ VARCHAR,soviet_unit VARCHAR,enemy_aircraft VARCHAR)
SELECT date__ddmmyyyy_ FROM table_name_74 WHERE soviet_unit = "73 giap" AND enemy_aircraft = "bf.109g-? w.nr.?"
How many students are not involved in any behavior incident?
CREATE TABLE Behavior_Incident (student_id VARCHAR)CREATE TABLE STUDENTS (student_id VARCHAR)
SELECT COUNT(*) FROM STUDENTS WHERE NOT student_id IN (SELECT student_id FROM Behavior_Incident)
what is average age of patients whose discharge location is home and primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement ?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
what were the four most frequent drugs that were prescribed to patients in their 20s within 2 months after they had been diagnosed with osteoporosis nos until 2104?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id...
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 ...
How much ht does the model with 10x mult. 1 have?
CREATE TABLE table_29395 ("Model Number" text,"Frequency" text,"L2 Cache" text,"HT" text,"Mult. 1" text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Order Part Number" text)
SELECT "HT" FROM table_29395 WHERE "Mult. 1" = '10x'
indicate the daily maximum amount of heart rate for patient 26350 in 06/2104.
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueu...
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 = 26350)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear...
Who is in week 4 if week 5 is [month ended] and week 2 is April Ireland?
CREATE TABLE table_name_8 (week_4 VARCHAR,week_5 VARCHAR,week_2 VARCHAR)
SELECT week_4 FROM table_name_8 WHERE week_5 = "[month ended]" AND week_2 = "april ireland"
what's the minimum species in the peruvian amazon with peru vs. world (percent) value of 7
CREATE TABLE table_72215 ("Taxonomy" text,"Species in the world" real,"Species in Peru" real,"Species in the Peruvian Amazon" real,"Peru Vs. world (Percent)" real,"Peruvian Amazon Vs. Peru (Percent)" real)
SELECT MIN("Species in the Peruvian Amazon") FROM table_72215 WHERE "Peru Vs. world (Percent)" = '7'
How many episodes were released on DVD in the US on October 13, 2009?
CREATE TABLE table_14855908_3 (episodes VARCHAR,region_1__us_ VARCHAR)
SELECT episodes FROM table_14855908_3 WHERE region_1__us_ = "October 13, 2009"
what are the cheapest one way flights from ATLANTA to PITTSBURGH
CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
US 3724 BALTIMORE to PHILADELPHIA what is the round trip fare
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
In what parish is the sub-parish fortun?
CREATE TABLE table_21964 ("Parish (Prestegjeld)" text,"Sub-Parish (Sogn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text)
SELECT "Parish (Prestegjeld)" FROM table_21964 WHERE "Sub-Parish (Sogn)" = 'Fortun'
What is the latest date in March when the opponent was the Boston Bruins and the game number was smaller than 66?
CREATE TABLE table_name_94 (march INTEGER,opponent VARCHAR,game VARCHAR)
SELECT MAX(march) FROM table_name_94 WHERE opponent = "boston bruins" AND game < 66
what is the radio with the most mhz ?
CREATE TABLE table_204_164 (id number,"branding" text,"callsign" text,"frequency" text,"power (kw)" text,"location" text)
SELECT "branding" FROM table_204_164 ORDER BY "frequency" DESC LIMIT 1
What show was played on ABC laster after 2002?
CREATE TABLE table_name_15 (show VARCHAR,network__last_aired_ VARCHAR,last_aired VARCHAR)
SELECT show FROM table_name_15 WHERE network__last_aired_ = "abc" AND last_aired > 2002
What is the average number of students for schools with a pupil to teacher ratio of 25.1?
CREATE TABLE table_39440 ("School Name" text,"City" text,"Students" real,"FTE Teachers" real,"Pupil/Teacher Ratio" real)
SELECT AVG("Students") FROM table_39440 WHERE "Pupil/Teacher Ratio" = '25.1'
What was Chris Hanburger's position?
CREATE TABLE table_44530 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "Position" FROM table_44530 WHERE "Name" = 'chris hanburger'
now i need flights leaving DENVER in the afternoon on wednesday and arriving in SAN FRANCISCO
CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = ...
What barony is Ballycunningham in?
CREATE TABLE table_30120566_1 (barony VARCHAR,townland VARCHAR)
SELECT barony FROM table_30120566_1 WHERE townland = "Ballycunningham"
For all employees who have the letters D or S in their first name, for salary, hire_date, visualize the trend.
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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPART...
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
What is the original name for the song 'Sono Io'?
CREATE TABLE table_8770 ("Song" text,"Original Name" text,"Country" text,"Language" text,"Singer(s)" text)
SELECT "Original Name" FROM table_8770 WHERE "Song" = 'sono io'
What is the first broadcast date for episode 3x10?
CREATE TABLE table_2197 ("Episode" text,"First broadcast" text,"Rufus guest" text,"Marcus guest" text,"Winner" text)
SELECT "First broadcast" FROM table_2197 WHERE "Episode" = '3x10'
how many hours have elapsed since patient 006-123134 received the last pt lab test on this hospital visit?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hos...
What is the most common hometown of gymnasts?
CREATE TABLE gymnast (gymnast_id number,floor_exercise_points number,pommel_horse_points number,rings_points number,vault_points number,parallel_bars_points number,horizontal_bar_points number,total_points number)CREATE TABLE people (people_id number,name text,age number,height number,hometown text)
SELECT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id GROUP BY T2.hometown ORDER BY COUNT(*) DESC LIMIT 1
what is average age of patients whose gender is m and ethnicity is white?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "WHITE"
What was the attendance when they played at Dallas Cowboys?
CREATE TABLE table_9765 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Attendance" FROM table_9765 WHERE "Opponent" = 'at dallas cowboys'
Show me about the correlation between School_ID and ACC_Percent in a scatter chart.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT School_ID, ACC_Percent FROM basketball_match
What is the Total of the 24:26 Set 1?
CREATE TABLE table_59002 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Total" text)
SELECT "Total" FROM table_59002 WHERE "Set 1" = '24:26'
Which Venue has a Result of won 5-4?
CREATE TABLE table_34419 ("Date" real,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text)
SELECT "Venue" FROM table_34419 WHERE "Result" = 'won 5-4'
What is the score of the game where the Rangers record was 16-8-4?
CREATE TABLE table_5772 ("Game" real,"January" real,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_5772 WHERE "Record" = '16-8-4'
Show the company name with the number of gas station Show bar chart, and display Company in asc order.
CREATE TABLE station_company (Station_ID int,Company_ID int,Rank_of_the_Year int)CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_bi...
SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company
Virtual Meta Reputation for User X.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAu...
SELECT SUM(CASE WHEN v.VoteTypeId = 1 THEN 15 WHEN v.VoteTypeId = 2 AND p.PostTypeId = 1 THEN 5 WHEN v.VoteTypeId = 2 AND p.PostTypeId = 2 THEN 10 WHEN v.VoteTypeId = 3 THEN -2 END) AS Reputation, COUNT(CASE v.VoteTypeId WHEN 1 THEN 1 END) AS Accepts, COUNT(CASE WHEN v.VoteTypeId = 2 AND p.PostTypeId = 1 THEN 1 END) AS...
tell me the number of patients diagnosed with gi obstruction / ileus until 2104?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'gi obstruction / ileus' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104')
what exactly does necator americanus mean?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'necator americanus' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'necator americanus'
Name the most overall rank for czech republic
CREATE TABLE table_29256 ("Overall rank" real,"Country" text,"Overall life expectancy" real,"Male life expectancy" real,"Male rank" real,"Female life expectancy" real,"Female rank" real)
SELECT MAX("Overall rank") FROM table_29256 WHERE "Country" = 'Czech Republic'
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to display by the x axis in desc.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
until 2101 what was the five most common specimen test?
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 t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) <= '2101' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
What was the result fot the UFC 85 event?
CREATE TABLE table_46603 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Location" text)
SELECT "Res." FROM table_46603 WHERE "Event" = 'ufc 85'
With a Record of 9-24, what was the Score?
CREATE TABLE table_name_40 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_40 WHERE record = "9-24"
uncontrolled hypertension ( bp > 200 / 110 mmhg )
CREATE TABLE table_train_112 ("id" int,"systolic_blood_pressure_sbp" int,"modified_geriatric_depression_scale_gds" int,"diastolic_blood_pressure_dbp" int,"rosen_modified_hachinski_ischemic_score" int,"body_mass_index_bmi" float,"hypertension" bool,"NOUSE" float)
SELECT * FROM table_train_112 WHERE hypertension = 1 OR systolic_blood_pressure_sbp >= 200 OR diastolic_blood_pressure_dbp >= 110
what is the procedure, which patient 016-9636 underwent two times during this hospital visit?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
Who all had the most assists in game 12?
CREATE TABLE table_17060277_5 (high_assists VARCHAR,game VARCHAR)
SELECT high_assists FROM table_17060277_5 WHERE game = 12
how many patients are admitted under emergency and suggested with drug route via both eyes?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "BOTH EYES"
what was the top three of the most common output events that occurred in 2105?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE labevents (row_id number,subject_id number,hadm_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,...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) = '2105' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 3)
What is the average position of pilot petr krejcirik, who has less than 11 points?
CREATE TABLE table_name_31 (position INTEGER,points VARCHAR,pilot VARCHAR)
SELECT AVG(position) FROM table_name_31 WHERE points < 11 AND pilot = "petr krejcirik"
whats the four most common specimen test in 2104?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosi...
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) = '2104' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4
For those employees who did not have any job in the past, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday by a bar chart, could you list in ascending by the y axis?
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)
what are the five specimen test most frequently ordered for patients who have been diagnosed with lupus erythematosus earlier within 2 months, the last year?
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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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_...