instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What's the unit of measure for sample 3879?
CREATE TABLE sampledata15 (sample_pk number,state text,year text,month text,day text,site text,commod text,source_id text,variety text,origin text,country text,disttype text,commtype text,claim text,quantity number,growst text,packst text,distst text)CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype tex...
SELECT conunit FROM resultsdata15 WHERE sample_pk = 3879
What is the total sum of 50m splits for josefin lillhage in lanes above 8?
CREATE TABLE table_74580 ("Lane" real,"Name" text,"Nationality" text,"Split (50m)" real,"Time" real)
SELECT SUM("Split (50m)") FROM table_74580 WHERE "Name" = 'josefin lillhage' AND "Lane" > '8'
Bar chart x axis job y axis the average of age, list by the y-axis in desc.
CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC
Return the name of each physician and the number of patients he or she treats in a bar chart, and sort total number from high to low order.
CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEXT)CREATE TABLE Patient (SSN INTEGER,Name VARCHAR(30),Address VARCHAR(30),Phone ...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) DESC
what was the first value of an mch lab test in patient 17953?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,ite...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17953) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') ORDER BY labevents.charttime LIMIT 1
What was the emission rating in California for the vehicle that was rated 80 g/mi (50 g/km) in Alaska and 250 g/mi (155 g/km) in the Southeast ?
CREATE TABLE table_20555 ("Vehicle" text,"EPA rated All-electric range" text,"EPA rated combined fuel economy" text,"Alaska (Juneau)" text,"California (San Francisco)" text,"Mid-Atlantic South (Washington,D.C.)" text,"U.S. national average electric mix" text,"Southeast (Atlanta)" text,"Midwest (Des Moines)" text,"Rocky...
SELECT "California (San Francisco)" FROM table_20555 WHERE "Alaska ( Juneau )" = '80 g/mi (50 g/km)' AND "Southeast (Atlanta)" = '250 g/mi (155 g/km)'
Name the number of pictorials for 5-85
CREATE TABLE table_1302 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text)
SELECT COUNT("Pictorials") FROM table_1302 WHERE "Date" = '5-85'
what flights from CHICAGO to KANSAS CITY
CREATE TABLE airline (airline_code varchar,airline_name text,note 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,stop...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS...
Instances of 'sudo gedit'. 'sudo gedit' instead of 'gksudo gedit' or similar (common misadvice, can make root own dotfiles in home dir)
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score num...
SELECT Id AS "post_link", Score, ViewCount AS Views FROM Posts WHERE PostTypeId = 2 AND Body LIKE '%sudo gedit%' AND NOT Body LIKE '%gksudo gedit%' ORDER BY Views DESC
I want the driver for Laps more than 8 and ferrari with Grid of 8
CREATE TABLE table_54794 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Driver" FROM table_54794 WHERE "Laps" > '8' AND "Constructor" = 'ferrari' AND "Grid" = '8'
what did patient 17286 receive for his or her first procedure?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17286) ORDER BY procedures_icd.charttime LIMIT 1)
give me the number of patients whose item id is 51214?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51214"
in 07/this year, is patient 19096's arterial bp [diastolic] ever greater than 58.0?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,even...
SELECT COUNT(*) > 0 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 = 19096)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias...
Name the total number of first elected for sol bloom
CREATE TABLE table_1342233_32 (first_elected VARCHAR,incumbent VARCHAR)
SELECT COUNT(first_elected) FROM table_1342233_32 WHERE incumbent = "Sol Bloom"
What's the 2013 result for the grand slam tournaments?
CREATE TABLE table_61497 ("Tournament" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text)
SELECT "2013" FROM table_61497 WHERE "Tournament" = 'grand slam tournaments'
What manufacturer has a year made of 1923?
CREATE TABLE table_44342 ("Class" text,"Wheel arrangement" text,"Fleet number(s)" text,"Manufacturer" text,"Year made" text,"Quantity made" text,"Quantity preserved" text)
SELECT "Manufacturer" FROM table_44342 WHERE "Year made" = '1923'
what is the difference between the number of affiliates galavision has and the number of affiliates azteca 13 has ?
CREATE TABLE table_204_779 (id number,"network name" text,"flagship" text,"programming type" text,"owner" text,"affiliates" number)
SELECT ABS((SELECT "affiliates" FROM table_204_779 WHERE "network name" = 'galavision') - (SELECT "affiliates" FROM table_204_779 WHERE "network name" = 'azteca 13'))
What is the total lane number for the United States when the mark is 6.62 and the heat is greater than 8?
CREATE TABLE table_name_16 (lane VARCHAR,heat VARCHAR,country VARCHAR,mark VARCHAR)
SELECT COUNT(lane) FROM table_name_16 WHERE country = "united states" AND mark = "6.62" AND heat > 8
Name the date for s. valentino alla muta , italia
CREATE TABLE table_30073089_2 (date VARCHAR,location VARCHAR)
SELECT date FROM table_30073089_2 WHERE location = "S. Valentino Alla Muta , Italia"
Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
CREATE TABLE Aircraft (aid VARCHAR,name VARCHAR)CREATE TABLE Certificate (eid VARCHAR,aid VARCHAR)CREATE TABLE Employee (name VARCHAR,eid VARCHAR)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"
what was galina chistyakova 's last competition ?
CREATE TABLE table_203_651 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT "competition" FROM table_203_651 ORDER BY "year" DESC LIMIT 1
How close am I to the Self-learner badge? All self-answers to my own questions. For each answer to my own questions I have question score and answer score. To get the Self-learner badge I need at least 3 votes on an answer among these.
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 q.Id AS QuestionId, a.Id AS AnswerId, q.Id AS "post_link", q.Score AS QuestionScore, a.Score AS MyAnswerScore FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id INNER JOIN Users ON Users.Id = q.OwnerUserId WHERE q.OwnerUserId = a.OwnerUserId AND Users.Id = '##UserId##'
count the number of patients whose year of birth is less than 2035 and drug name is oxycodone (immediate release) ?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2035" AND prescriptions.drug = "OxycoDONE (Immediate Release) "
What is the first name of each student enrolled in class ACCT-211?
CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_num number)CREATE TABLE department (dept_code text,dept_name text,school_code text,emp_num number,dept_address text,dept_exten...
SELECT T3.stu_fname FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'
How many production codes were in series 39?
CREATE TABLE table_26542 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT COUNT("Production code") FROM table_26542 WHERE "No. in series" = '39'
Who is the original artist of 'Let's Dance'?
CREATE TABLE table_63570 ("Song" text,"Performer" text,"Original artist" text,"Length" text,"Recorded" text)
SELECT "Original artist" FROM table_63570 WHERE "Song" = 'let''s dance'
Who was the opponent for game 30?
CREATE TABLE table_64471 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location" text,"Record" text)
SELECT "Opponent" FROM table_64471 WHERE "Game" = '30'
What is on at 1:30PM with 12:30 local programs, and Pinky and the Brain shows at 4:00pm?
CREATE TABLE table_59914 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"4:00 pm" text,"5:00 pm" text,"6:30 pm" text)
SELECT "1:30 pm" FROM table_59914 WHERE "12:30 pm" = 'local programs' AND "4:00 pm" = 'pinky and the brain'
What is the sum of the scottish cup of the forward player with less than 2 league cups and a total greater than 6?
CREATE TABLE table_name_47 (scottish_cup INTEGER,position VARCHAR,league_cup VARCHAR,total VARCHAR)
SELECT SUM(scottish_cup) FROM table_name_47 WHERE league_cup < 2 AND total > 6 AND position = "forward"
tell me the total amount of chest tubes left pleural 1 output for patient 97330 in the previous day.
CREATE TABLE d_icd_diagnoses (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 transfers (row_id number...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che...
what is the number of patients whose marital status is married and procedure icd9 code is 3607?
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,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3607"
How many yards for the player with 1 solo tackle and over 0 sacks?
CREATE TABLE table_52380 ("Player" text,"Tackles" real,"Solo" real,"Assisted" real,"Sack" real,"Yards" real,"TD's" real)
SELECT MAX("Yards") FROM table_52380 WHERE "Solo" = '1' AND "Sack" > '0'
Which player was active in Jazz in 1975-79?
CREATE TABLE table_name_36 (player VARCHAR,years_for_jazz VARCHAR)
SELECT player FROM table_name_36 WHERE years_for_jazz = "1975-79"
For those products with a price between 60 and 120, draw a bar chart about the distribution of name and manufacturer , display by the X from low to high.
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 Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
select Id from Posts.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskStates (Id number,Name text,D...
SELECT Id FROM Posts
count the number of patients whose admission location is emergency room admit and diagnoses icd9 code is v5416?
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "V5416"
what is the difference between the number times the result was won and the number of times the result was nominated ?
CREATE TABLE table_204_948 (id number,"year" number,"award" text,"category" text,"film" text,"result" text)
SELECT ABS((SELECT COUNT(*) FROM table_204_948 WHERE "result" = 'won') - (SELECT COUNT(*) FROM table_204_948 WHERE "result" = 'nominated'))
Name the largest ethnic group for 24112
CREATE TABLE table_2562572_20 (largest_ethnic_group__2002_ VARCHAR,population__2011_ VARCHAR)
SELECT largest_ethnic_group__2002_ FROM table_2562572_20 WHERE population__2011_ = 24112
for the drumset name td-15k how many snare pads are
CREATE TABLE table_30830 ("DrumSet Name" text,"Product Line" text,"Years Available" text,"Drum Module" text,"KickDrum Pad" text,"Snare Pad" text,"Tom-Tom Pads" text,"Hi-HatPad/ Controller" text,"CrashandRide CymbalPads" text,"DrumStand (oftenoptional)" text)
SELECT COUNT("Snare Pad") FROM table_30830 WHERE "DrumSet Name" = 'TD-15K'
Who was the runner-up after season 2 when the total prize money was $108,000?
CREATE TABLE table_59555 ("Season" real,"Year" real,"Mole" text,"Winner" text,"Runner-up" text,"Total prize money" text,"Potential prize money" text,"Destination" text)
SELECT "Runner-up" FROM table_59555 WHERE "Season" > '2' AND "Total prize money" = '$108,000'
What was the race when the winner of 2nd was Voleuse?
CREATE TABLE table_76971 ("Result" text,"Race" text,"Distance" text,"Weight" real,"Winner or 2nd" text,"Pos'n" text)
SELECT "Race" FROM table_76971 WHERE "Winner or 2nd" = 'voleuse'
how mant different day names in old English were coined from the Latin day name 'dies iovis'?
CREATE TABLE table_2624098_1 (old_english_day_name VARCHAR,glossed_from_latin_day_name VARCHAR)
SELECT COUNT(old_english_day_name) FROM table_2624098_1 WHERE glossed_from_latin_day_name = "Dies Iovis"
Which Mascot has an Enrollment of 640?
CREATE TABLE table_name_63 (mascot VARCHAR,enrollment VARCHAR)
SELECT mascot FROM table_name_63 WHERE enrollment = 640
Which city contains the KPIX station?
CREATE TABLE table_name_96 (city_of_license__market VARCHAR,station VARCHAR)
SELECT city_of_license__market FROM table_name_96 WHERE station = "kpix"
provide the number of patients whose days of hospital stay is greater than 11 and lab test fluid is ascites?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.fluid = "Ascites"
how many patients received a hemodialysis after the procedure of the hypothermia in the previous year within 2 months?
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,ob...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hypothermia' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of yea...
What is the Finish of 28 Wins?
CREATE TABLE table_name_49 (finish VARCHAR,wins VARCHAR)
SELECT finish FROM table_name_49 WHERE wins = "28"
What is the name of the Player that shows the NHL team of new york rangers, and a Pick # of 31?
CREATE TABLE table_name_22 (player VARCHAR,nhl_team VARCHAR,pick__number VARCHAR)
SELECT player FROM table_name_22 WHERE nhl_team = "new york rangers" AND pick__number = "31"
What year was the composition by Mejo Joseph?
CREATE TABLE table_9989 ("Year" real,"Film" text,"Song" text,"Composer" text,"Language" text)
SELECT COUNT("Year") FROM table_9989 WHERE "Composer" = 'mejo joseph'
what's the total dose of d10nss that patient 24547 had received since 1446 days ago?
CREATE TABLE d_icd_diagnoses (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 transfers (row_id number...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
count how many times patient 19412 has gone to hospital in this year.
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREA...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 19412 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
Who's the Socialist ticket with a Democratic ticket of herbert h. lehman?
CREATE TABLE table_name_5 (socialist_ticket VARCHAR,democratic_ticket VARCHAR)
SELECT socialist_ticket FROM table_name_5 WHERE democratic_ticket = "herbert h. lehman"
What is the lowest 2013 population estimate of south africa, which has a percentage greater than 19.8 and a 2011 population greater than 51,770,561?
CREATE TABLE table_64744 ("Rank" text,"Province" text,"Population (2011)" real,"Percentage" real,"Population Estimate (2013)" real)
SELECT MIN("Population Estimate (2013)") FROM table_64744 WHERE "Percentage" > '19.8' AND "Province" = 'south africa' AND "Population (2011)" > '51,770,561'
list the patient identifications of those patients who were diagnosed with nasal bone fx-closed during the previous year.
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate t...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nasal bone fx-closed') AND DATETIME(diagnoses_icd.charttime, 'start of yea...
What is Date of Appointment, when Outgoing Manager is 'Hakan Kutlu'?
CREATE TABLE table_name_42 (date_of_appointment VARCHAR,outgoing_manager VARCHAR)
SELECT date_of_appointment FROM table_name_42 WHERE outgoing_manager = "hakan kutlu"
What is the series minimum if the season number is 2.08?
CREATE TABLE table_73689 ("Series #" real,"Season #" text,"Episode" text,"Directed by" text,"Written by" text,"Original air date" text,"Viewers (in millions)" text)
SELECT MIN("Series #") FROM table_73689 WHERE "Season #" = '2.08'
Bar chart x axis role code y axis the total number
CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Employees (Employee_ID INTEGER,Role_Code...
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code
what is the number of patients whose diagnoses icd9 code is 25040 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 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 tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "25040" AND prescriptions.drug_type = "ADDITIVE"
What is the capacity in use of the airport in Rio de Janeiro with an annual change of 40.53%?
CREATE TABLE table_41453 ("Rank" real,"Location" text,"Total Passengers" real,"Annual change" text,"Capacity" real,"Capacity in use" text)
SELECT "Capacity in use" FROM table_41453 WHERE "Location" = 'rio de janeiro' AND "Annual change" = '40.53%'
what is the number of patients whose admission type is urgent and insurance is medicaid?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Medicaid"
What were the high points on september 9?
CREATE TABLE table_45635 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text)
SELECT "High points" FROM table_45635 WHERE "Date" = 'september 9'
provide the number of elective hospital admission patients who have been diagnosed with other staphylococcus pneumonia.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Other Staphylococcus pneumonia"
How many providers are there where the resale category is yes and bandwith is up is 1024?
CREATE TABLE table_1773908_3 (provider VARCHAR,resale VARCHAR,up__up_to_kbit_s_ VARCHAR)
SELECT COUNT(provider) FROM table_1773908_3 WHERE resale = "yes" AND up__up_to_kbit_s_ = 1024
Most popular tags during the last quarter.
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostNotices (Id numb...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS LastQuarterRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsLastQuarter, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts....
In what city is RJSN located?
CREATE TABLE table_67883 ("City" text,"Province/Region" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "City" FROM table_67883 WHERE "ICAO" = 'rjsn'
What score has wynne prakusya as the opponent in the final?
CREATE TABLE table_name_15 (score VARCHAR,opponent_in_the_final VARCHAR)
SELECT score FROM table_name_15 WHERE opponent_in_the_final = "wynne prakusya"
count the number of patients who have been diagnosed with acute coronary syndrome and did not come back to the hospital within 2 months since 3 years ago.
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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender ...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year'...
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, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and show total number in descending order.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LO...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
What are the names and years of the movies that has the top 3 highest rating star?
CREATE TABLE rating (rid number,mid number,stars number,ratingdate time)CREATE TABLE reviewer (rid number,name text)CREATE TABLE movie (mid number,title text,year number,director text)
SELECT T2.title, T2.year FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid ORDER BY T1.stars DESC LIMIT 3
How many class AA in the year 2002-03
CREATE TABLE table_19561 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text)
SELECT COUNT("Class AA") FROM table_19561 WHERE "School Year" = '2002-03'
What ward was she nominated at for her work, Flare Path for the category of best featured actress in a play?
CREATE TABLE table_47075 ("Year" real,"Award" text,"Category" text,"Nominated Work" text,"Result" text)
SELECT "Award" FROM table_47075 WHERE "Nominated Work" = 'flare path' AND "Category" = 'best featured actress in a play'
how many patients whose age is less than 86 and procedure short title is rt & lt heart angiocard?
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "86" AND procedures.short_title = "Rt & lt heart angiocard"
who was the only contestant from switzerland to place in the top 50 ?
CREATE TABLE table_204_669 (id number,"rank" number,"athlete" text,"nationality" text,"time" text)
SELECT "athlete" FROM table_204_669 WHERE "nationality" = 'switzerland' AND "rank" <= 50
when did patient 5142 receive a prescription for the last time in the previous month, via po route?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime tim...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142) AND prescriptions.route = 'po' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescri...
Top User Of a Perticular Tag in India.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", TagName, COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ...
What are the notes of the number 1 rank?
CREATE TABLE table_name_52 (notes VARCHAR,rank VARCHAR)
SELECT notes FROM table_name_52 WHERE rank = 1
What is the average cash on hand of a candidate with receipts w/o loans of 19,951,290 and less than 17,556,672 spent?
CREATE TABLE table_10363 ("Candidate" text,"Total Receipts" real,"Loans Received" real,"Receipts w/o Loans" real,"Money Spent" real,"Cash On Hand" real,"Total Debt" real,"Cash on Hand Minus Debt" real)
SELECT AVG("Cash On Hand") FROM table_10363 WHERE "Receipts w/o Loans" = '19,951,290' AND "Money Spent" < '17,556,672'
Tags used in conjunction with [tag:harry-potter].
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT t.TagName AS TagName, t.Count AS TagCountTotal, COUNT(p.Id) OVER (PARTITION BY t.Id) AS TagCount, p.Id AS "post_link", p.Tags AS Tags, exc.Body AS Excerpt FROM Tags AS target JOIN PostTags AS pt ON (target.Id = pt.TagId) JOIN Posts AS p ON (pt.PostId = p.Id) JOIN PostTags AS tp ON (p.Id = tp.PostId) JOIN Tags AS...
What is the Position of the Player with a Height of 2.11?
CREATE TABLE table_name_11 (position VARCHAR,height VARCHAR)
SELECT position FROM table_name_11 WHERE height = 2.11
Other than Prof. Brian Kennedy , name the professor who teaches 301 .
CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_pre...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 301 AND NOT instructor.name LIKE '%Brian Kennedy%' AND offering_instructor.instructor_id = instructor.instructor_id AND offe...
List the clubs having 'Davis Steven' as a member.
CREATE TABLE club (clubname VARCHAR,clubid VARCHAR)CREATE TABLE student (stuid VARCHAR,fname VARCHAR,lname VARCHAR)CREATE TABLE member_of_club (clubid VARCHAR,stuid VARCHAR)
SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Davis" AND t3.lname = "Steven"
What is the point total for the Formula Renault 2.0 Italy series?
CREATE TABLE table_2496 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text)
SELECT COUNT("Points") FROM table_2496 WHERE "Series" = 'Formula Renault 2.0 Italy'
When did Louise, Princess royal get married?
CREATE TABLE table_name_87 (date_married VARCHAR,name_dates VARCHAR)
SELECT date_married FROM table_name_87 WHERE name_dates = "louise, princess royal"
what is the course at midlothian, illinois for a year before 1934?
CREATE TABLE table_name_98 (course VARCHAR,year VARCHAR,location VARCHAR)
SELECT course FROM table_name_98 WHERE year < 1934 AND location = "midlothian, illinois"
how many patients were diagnosed with cabg < 7days and did not come back to hospital within 2 months since 4 years ago?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatment...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cabg < 7days' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1) -...
What was the voting order when the commentator was renato tagliani?
CREATE TABLE table_name_95 (voting_order VARCHAR,commentator VARCHAR)
SELECT voting_order FROM table_name_95 WHERE commentator = "renato tagliani"
what come after rex f.
CREATE TABLE table_204_834 (id number,"rank" number,"name" text,"nationality" text,"time" text)
SELECT "name" FROM table_204_834 WHERE id = (SELECT id FROM table_204_834 WHERE "name" = 'rex favero') + 1
Among patients discharged on short term hospital, calculate the total number of those born before 1837
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_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "1837"
What is the Open 1st VIII for the 2012 crew?
CREATE TABLE table_11575 ("Crew" real,"Open 1st VIII" text,"Open 2nd VIII" text,"Open 3rd VIII" text,"Year 11 1st VIII" text,"Year 11 2nd VIII" text,"Year 11 3rd VIII" text,"Year 10 1st Quad" text,"Year 10 2nd Quad" text,"Year 10 3rd Quad" text,"Year 10 4th Quad" text,"Year 10 5th Quad" text,"Year 10 6th Quad" text)
SELECT "Open 1st VIII" FROM table_11575 WHERE "Crew" = '2012'
Name the number of districts for december 1799
CREATE TABLE table_1275 ("Con- gress" text,"District" text,"Vacator" text,"Election date" text,"Successor" text,"Took seat" text)
SELECT COUNT("District") FROM table_1275 WHERE "Election date" = 'December 1799'
what is the name of the drug that was prescribed during the same hospital encounter to patient 007-1517 after having received a therapeutic antibacterials - vancomycin procedure until 70 months ago?
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 t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
Which Event has a 2007 08 of n/a?
CREATE TABLE table_7524 ("Event" text,"2006\u201307" text,"2007\u201308" text,"2008\u201309" text,"2010\u201311" text)
SELECT "Event" FROM table_7524 WHERE "2007\u201308" = 'n/a'
What is the number of Population 2001 Census that has jharsuguda District Headquarters with an Area smaller than 2,081?
CREATE TABLE table_37838 ("District" text,"District Headquarters" text,"Area (km 2 .)" real,"Population 1991 Census" real,"Population 2001 Census" real)
SELECT COUNT("Population 2001 Census") FROM table_37838 WHERE "District Headquarters" = 'jharsuguda' AND "Area (km 2 .)" < '2,081'
What is the Score for Set 2 of 24 26?
CREATE TABLE table_name_71 (score VARCHAR,set_2 VARCHAR)
SELECT score FROM table_name_71 WHERE set_2 = "24–26"
i was wondering what patient 15754's average value of temperature c (calc) on 09/05/2104 was?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code tex...
SELECT AVG(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 = 15754)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temp...
What are the names and ids of the different categories, and how many films are in each?
CREATE TABLE country (country_id number,country text,last_update time)CREATE TABLE payment (payment_id number,customer_id number,staff_id number,rental_id number,amount number,payment_date time,last_update time)CREATE TABLE actor (actor_id number,first_name text,last_name text,last_update time)CREATE TABLE address (add...
SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id
How much tonnage has a Fate of sunk, and a Flag of great britain, and a Date of 26 september 1940, and Deaths of 2?
CREATE TABLE table_name_83 (tonnage___grt__ INTEGER,deaths VARCHAR,date VARCHAR,fate VARCHAR,flag VARCHAR)
SELECT SUM(tonnage___grt__) FROM table_name_83 WHERE fate = "sunk" AND flag = "great britain" AND date = "26 september 1940" AND deaths = 2
what is the number of patients whose marital status is single and lab test name is potassium, whole blood?
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Potassium, Whole Blood"
Show the product type and name for the products with price higher than 1000 or lower than 500.
CREATE TABLE contacts (contact_id number,customer_id number,gender text,first_name text,last_name text,contact_phone text)CREATE TABLE customer_orders (order_id number,customer_id number,order_date time,order_status_code text)CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode t...
SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of price , and group by attribute name, and list by the y axis from low to high.
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.Price