instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
get me the number of patients with *lit language who had creatine kinase, mb isoenzyme lab test.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "*LIT" AND lab.label = "Creatine Kinase, MB Isoenzyme"
count of popular questions with an accepted answer which is outvoted and not authored by the OP.
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTy...
SELECT COUNT(q.Id) FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.PostTypeId = 1 AND q.ViewCount > 100000 AND (SELECT MAX(Score) FROM Posts AS q2 WHERE q.Id = q2.ParentId) > a.Score AND q.OwnerUserId != a.OwnerUserId
What is the total number of laps that were completed in 1949?
CREATE TABLE table_14659 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT COUNT("Laps") FROM table_14659 WHERE "Year" = '1949'
Name the league for conference finals
CREATE TABLE table_27752 ("Year" real,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "League" FROM table_27752 WHERE "Playoffs" = 'Conference Finals'
what is the average number of monthly diagnosed cases of spleen disruption-clos this year?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id ...
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'spleen disruption-clos') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIM...
Which nation has a gold less than 2 and a bronze less than 5?
CREATE TABLE table_14333 ("Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT "Nation" FROM table_14333 WHERE "Gold" < '2' AND "Bronze" < '5'
how many hours has passed since the first time patient 95892 got a base excess lab test in their current hospital encounter?
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 patients (row_id number,...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admiss...
What is the location code for the country 'Canada'?
CREATE TABLE Ref_locations (location_code VARCHAR,location_name VARCHAR)
SELECT location_code FROM Ref_locations WHERE location_name = "Canada"
What was the result against opponent Amanda Lucas?
CREATE TABLE table_12629 ("Result" text,"Opponent" text,"Method" text,"Event" text,"Notes" text)
SELECT "Result" FROM table_12629 WHERE "Opponent" = 'amanda lucas'
what is admission location and discharge location of subject name marilyn norvell?
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 demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Marilyn Norvell"
Which gymnast had a b score of 8.95 and an a score less than 6.9
CREATE TABLE table_79242 ("Position" text,"Gymnast" text,"A Score" real,"B Score" real,"Total" real)
SELECT "Gymnast" FROM table_79242 WHERE "B Score" = '8.95' AND "A Score" < '6.9'
When the Away team was hawthorn, what's the Home team?
CREATE TABLE table_56016 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_56016 WHERE "Away team" = 'hawthorn'
What is the lowest Ofsted number for a primary with a CE faith, intake of 30 and a DCSF number lower than 3349?
CREATE TABLE table_name_72 (ofsted_number INTEGER,dcsf_number VARCHAR,intake VARCHAR,type VARCHAR,faith VARCHAR)
SELECT MIN(ofsted_number) FROM table_name_72 WHERE type = "primary" AND faith = "ce" AND intake = 30 AND dcsf_number < 3349
How many networks are listed when the year is 2008?
CREATE TABLE table_2941848_10 (network VARCHAR,year VARCHAR)
SELECT COUNT(network) FROM table_2941848_10 WHERE year = 2008
Which Memory (GB) has a Number of CPUs of 1 6?
CREATE TABLE table_66348 ("Model" text,"Year Introduced" real,"Number of CPUs" text,"Performance (MIPS)" text,"Memory (GB)" text)
SELECT "Memory (GB)" FROM table_66348 WHERE "Number of CPUs" = '1–6'
Which Game has a Team of at san antonio, and a Record of 3-3?
CREATE TABLE table_42527 ("Game" real,"Date" text,"Team" text,"Score" text,"Location Attendance" text,"Record" text)
SELECT "Game" FROM table_42527 WHERE "Team" = 'at san antonio' AND "Record" = '3-3'
What is Tournament, when Margin Of Victory is 1 Stroke, and when Date is 18 Jan 2009?
CREATE TABLE table_name_5 (tournament VARCHAR,margin_of_victory VARCHAR,date VARCHAR)
SELECT tournament FROM table_name_5 WHERE margin_of_victory = "1 stroke" AND date = "18 jan 2009"
provide the admission location and discharge location of subject id 84129.
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 demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "84129"
Which station has a license in Fort Collins, Colorado?
CREATE TABLE table_1353096_2 (station VARCHAR,city_of_license_market VARCHAR)
SELECT station FROM table_1353096_2 WHERE city_of_license_market = "Fort Collins, Colorado"
Show all product names and the number of customers having an order on each product.
CREATE TABLE invoices (invoice_number number,order_id number,invoice_date time)CREATE TABLE accounts (account_id number,customer_id number,date_account_opened time,account_name text,other_account_details text)CREATE TABLE order_items (order_item_id number,order_id number,product_id number,product_quantity text,other_or...
SELECT T2.product_name, COUNT(*) FROM order_items AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id JOIN orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name
Show employee_id from each email, and display from high to low by the total number.
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE va...
SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID DESC
What is the name of department where has the largest number of professors with a Ph.D. degree?
CREATE TABLE department (dept_name VARCHAR,dept_code VARCHAR)CREATE TABLE professor (dept_code VARCHAR,prof_high_degree VARCHAR)
SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1
Name the most 11-12 enrollment for columbia city
CREATE TABLE table_72923 ("School" text,"Est. Denotes original date of establishment of the school,changes in name and/or location noted in corresponding ootnote" real,"Location Denotes location of school by Seattle neighborhood,does not necessary correspond with attendance area" text,"Nickname" text,"11-12 Enrollment"...
SELECT MAX("11-12 Enrollment") FROM table_72923 WHERE "Location Denotes location of school by Seattle neighborhood, does not necessary correspond with attendance area" = 'Columbia City'
In what year did the winner of the FIS championship in 1982 win the Winter Olympics?
CREATE TABLE table_21692 ("Winner" text,"Country" text,"Winter Olympics" text,"FIS Nordic World Ski Championships" text,"Holmenkollen" text)
SELECT "Winter Olympics" FROM table_21692 WHERE "FIS Nordic World Ski Championships" = '1982'
Which Streak has a Game larger than 49?
CREATE TABLE table_45765 ("Game" real,"Date" text,"Team" text,"Score" text,"Record" text,"Streak" text)
SELECT "Streak" FROM table_45765 WHERE "Game" > '49'
how many patients whose age is less than 27 and lab test name is creatine kinase (ck)?
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 demographic.age < "27" AND lab.label = "Creatine Kinase (CK)"
Users by location, reputation and tags sorted by reputation.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation AS Tags FROM Users WHERE LOWER(Location) LIKE LOWER('%##Location##%') ORDER BY Reputation DESC
All code history for a PostId.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score n...
SELECT Id, Text FROM PostHistory WHERE PostId = 111102
What year was Frank Annunzio elected
CREATE TABLE table_726 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT MIN("First elected") FROM table_726 WHERE "Incumbent" = 'Frank Annunzio'
What is the Political group for p. maelius capitolinus?
CREATE TABLE table_7461 ("Type" text,"Name" text,"Title" text,"Political group" text,"From" text)
SELECT "Political group" FROM table_7461 WHERE "Name" = 'p. maelius capitolinus'
Show the names of products and the number of events they are in by a bar chart.
CREATE TABLE Locations (Location_ID INTEGER,Other_Details VARCHAR(255))CREATE TABLE Parties_in_Events (Party_ID INTEGER,Event_ID INTEGER,Role_Code CHAR(15))CREATE TABLE Events (Event_ID INTEGER,Address_ID INTEGER,Channel_ID INTEGER,Event_Type_Code CHAR(15),Finance_ID INTEGER,Location_ID INTEGER)CREATE TABLE Assets (Ass...
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name
What is the average amount of items ordered in each order?
CREATE TABLE customers (customer_id number,payment_method text,customer_name text,date_became_customer time,other_customer_details text)CREATE TABLE products (product_id number,product_details text)CREATE TABLE customer_contact_channels (customer_id number,channel_code text,active_from_date time,active_to_date time,con...
SELECT AVG(order_quantity) FROM order_items
Which To par has a Winning score of 64-68-66-63=261?
CREATE TABLE table_name_22 (to_par VARCHAR,winning_score VARCHAR)
SELECT to_par FROM table_name_22 WHERE winning_score = 64 - 68 - 66 - 63 = 261
How many outcomes occur for score in the final of 6 3, 6 4, 7 6 (13 11)?
CREATE TABLE table_26202940_6 (outcome VARCHAR,score_in_the_final VARCHAR)
SELECT COUNT(outcome) FROM table_26202940_6 WHERE score_in_the_final = "6–3, 6–4, 7–6 (13–11)"
What genre has over 20 episodes, with an English title (Chinese title) of wong fei hung - master of kung fu ?
CREATE TABLE table_name_95 (genre VARCHAR,number_of_episodes VARCHAR,english_title__chinese_title_ VARCHAR)
SELECT genre FROM table_name_95 WHERE number_of_episodes > 20 AND english_title__chinese_title_ = "wong fei hung - master of kung fu 我師傅係黃飛鴻"
How many picks included Kenny Evans?
CREATE TABLE table_name_52 (pick VARCHAR,player VARCHAR)
SELECT COUNT(pick) FROM table_name_52 WHERE player = "kenny evans"
show me all flights arriving to DENVER from OAKLAND
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_spe...
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
what is the lowest position when the name is esv t rkheim, and Drawn more than 0?
CREATE TABLE table_45412 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real)
SELECT MIN("Position") FROM table_45412 WHERE "Name" = 'esv türkheim' AND "Drawn" > '0'
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of price , and group by attribute name.
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
Name the score for yuliya ustyuzhanina
CREATE TABLE table_69263 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Score" FROM table_69263 WHERE "Opponent" = 'yuliya ustyuzhanina'
allergy to beef
CREATE TABLE table_train_228 ("id" int,"ejection_fraction_ef" int,"hiv_infection" bool,"heart_disease" bool,"body_weight" float,"body_mass_index_bmi" float,"allergy_to_beef" bool,"NOUSE" float)
SELECT * FROM table_train_228 WHERE allergy_to_beef = 1
What is Series, when Date is 'June 7'?
CREATE TABLE table_76858 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Series" FROM table_76858 WHERE "Date" = 'june 7'
Up Votes vs Down Votes.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDi...
SELECT (SELECT CAST(COUNT(Votes.Id) AS FLOAT) FROM Votes WHERE VoteTypeId = 2) / (SELECT CAST(COUNT(Votes.Id) AS FLOAT) FROM Votes WHERE VoteTypeId = 3) AS "Up Votes / Down Votes"
What is the title of the program that was originally aired on June 13, 1999?
CREATE TABLE table_11007 ("Episode #" text,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text)
SELECT "Title" FROM table_11007 WHERE "Original airdate" = 'june 13, 1999'
What is the location in 2007?
CREATE TABLE table_74750 ("Year" real,"Date" text,"Location" text,"Theme" text,"Anthem" text)
SELECT "Location" FROM table_74750 WHERE "Year" = '2007'
Which Drawn has a Difference of 14?
CREATE TABLE table_34326 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT AVG("Drawn") FROM table_34326 WHERE "Difference" = '14'
What date was the ship named Manhattan completed?
CREATE TABLE table_69336 ("Ship" text,"Builder" text,"Namesake" text,"Renamed" text,"Laid down" text,"Launched" text,"Commissioned or completed(*)" text)
SELECT "Commissioned or completed(*)" FROM table_69336 WHERE "Ship" = 'manhattan'
Which Decision has a Date of april 25?
CREATE TABLE table_name_85 (decision VARCHAR,date VARCHAR)
SELECT decision FROM table_name_85 WHERE date = "april 25"
What were the Oct. temperatures for the city that had Nov. temperatures of 51/30?
CREATE TABLE table_name_94 (oct VARCHAR,nov VARCHAR)
SELECT oct FROM table_name_94 WHERE nov = "51/30"
Please show the titles of films and the types of market estimations.
CREATE TABLE film (Title VARCHAR,Film_ID VARCHAR)CREATE TABLE film_market_estimation (Type VARCHAR,Film_ID VARCHAR)
SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
What is the Current Club of the PG/SG player with a Height of less than 1.9500000000000002?
CREATE TABLE table_13106 ("Player" text,"Height" real,"Position" text,"Year born (Age)" text,"Current Club" text)
SELECT "Current Club" FROM table_13106 WHERE "Height" < '1.9500000000000002' AND "Position" = 'pg/sg'
count the number of times that patient 015-94542 has had tube fdging form until 44 months ago.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
How many different values of clubs involved were there when the league entering at this round was allsvenskan?
CREATE TABLE table_31237 ("Round" text,"Clubs remaining" real,"Clubs involved" real,"Winners from previous round" real,"New entries this round" text,"Leagues entering at this round" text)
SELECT COUNT("Clubs involved") FROM table_31237 WHERE "Leagues entering at this round" = 'Allsvenskan'
When Cancelable of yes, and a Type of drag, what was the Category?
CREATE TABLE table_name_72 (category VARCHAR,cancelable VARCHAR,type VARCHAR)
SELECT category FROM table_name_72 WHERE cancelable = "yes" AND type = "drag"
tell me the name of the first specimen test patient 031-3355 had received this month?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosi...
SELECT microlab.culturesite 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 DATETIME(microlab.culturetakentime, 'start of month') ...
What is Number Of Episodes, when Status is '2001 - 2003, 2005 - 2009'?
CREATE TABLE table_name_86 (number_of_episodes VARCHAR,status VARCHAR)
SELECT number_of_episodes FROM table_name_86 WHERE status = "2001 - 2003, 2005 - 2009"
What was the attendance at the game played at Moorabbin Oval?
CREATE TABLE table_10549 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Crowd" FROM table_10549 WHERE "Venue" = 'moorabbin oval'
What is the Bulgarian Commander in Autumn 1040 at the Battle of Thessalonica?
CREATE TABLE table_name_41 (bulgarian_commander VARCHAR,battle VARCHAR,date VARCHAR)
SELECT bulgarian_commander FROM table_name_41 WHERE battle = "battle of thessalonica" AND date = "autumn 1040"
what is the total number of publisher where cover date is may 1939
CREATE TABLE table_1217448_1 (publisher VARCHAR,cover_date VARCHAR)
SELECT COUNT(publisher) FROM table_1217448_1 WHERE cover_date = "May 1939"
In the game on or before week 9, who was the opponent when the attendance was 61,626?
CREATE TABLE table_76064 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_76064 WHERE "Week" < '9' AND "Attendance" = '61,626'
what is the top three most frequent drugs that patients were prescribed within 2 months after being prescribed with chlorothiazide sodium until 2 years ago?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE inputevents_cv (row_id number,subject_id numb...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorothiazide sodium' AND DATETIME(prescriptions.startdate) <= D...
Name the most finish for 2006
CREATE TABLE table_68217 ("Year" real,"Manufacturer" text,"Start" real,"Finish" real,"Team" text)
SELECT MAX("Finish") FROM table_68217 WHERE "Year" = '2006'
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.
CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE class (class_code text,crs_code text,class_section text,class_time text,class_room text,prof_num number)CREATE TABLE professor (emp_num number,dept_code text,prof_office text,prof_extension text,prof_high_degree text)CREATE TABLE course ...
SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)
when was the last time patient 28484 had a urine . output until 2078 days ago.
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE prescriptions (row_id number,sub...
SELECT outputevents.charttime 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 = 28484)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
let me know the short title of diagnoses for the patient with patient id 21796.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796"
What is the church made from in Hamburg?
CREATE TABLE table_name_88 (held_record VARCHAR,structural_type VARCHAR,town VARCHAR)
SELECT held_record FROM table_name_88 WHERE structural_type = "church" AND town = "hamburg"
What was the film title used in nomination for Panny Z Wilka?
CREATE TABLE table_14360 ("Country" text,"Film title used in nomination" text,"Language" text,"Original name" text,"Director" text)
SELECT "Film title used in nomination" FROM table_14360 WHERE "Original name" = 'panny z wilka'
What is the highest evening gown number in North Carolina with less than 9.214 interviews?
CREATE TABLE table_name_94 (evening_gown INTEGER,state VARCHAR,interview VARCHAR)
SELECT MAX(evening_gown) FROM table_name_94 WHERE state = "north carolina" AND interview < 9.214
List the popular publications on Object discrimination
CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE venue (venueid int,venuename ...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Object discrimination' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
What were the original teams for the season that was won at-home by Mark Pinkhasovich?
CREATE TABLE table_11868 ("Name" text,"Premiere" text,"Finale" text,"Original teams" text,"The Biggest Loser" text,"At-Home Winner" text)
SELECT "Original teams" FROM table_11868 WHERE "At-Home Winner" = 'mark pinkhasovich'
What is the 1978 Veteran membership with a late 1941 macedonia and a late 1943 less than 10,000?
CREATE TABLE table_54188 ("! Late 1941" text,"Late 1942" real,"Sept. 1943" real,"Late 1943" real,"Late 1944" real,"1978 Veteran membership" real)
SELECT SUM("1978 Veteran membership") FROM table_54188 WHERE "! Late 1941" = 'macedonia' AND "Late 1943" < '10,000'
What is the Visitor on March 31?
CREATE TABLE table_49521 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Visitor" FROM table_49521 WHERE "Date" = 'march 31'
What is the home team of the game on January 22?
CREATE TABLE table_68622 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Home" FROM table_68622 WHERE "Date" = 'january 22'
what is the space where the next one was mike turnesa
CREATE TABLE table_262383_1 (margin VARCHAR,runner_s__up VARCHAR)
SELECT margin FROM table_262383_1 WHERE runner_s__up = "Mike Turnesa"
Name the number of reporters for heywood hale broun
CREATE TABLE table_25086 ("Year" real,"Network" text,"Race caller" text,"s Host" text,"s Analyst" text,"Reporters" text,"Trophy presentation" text)
SELECT COUNT("Reporters") FROM table_25086 WHERE "s Analyst" = 'Heywood Hale Broun'
What is the record of game 26 with beno udrih (4) as the highest assists?
CREATE TABLE table_name_41 (record VARCHAR,high_assists VARCHAR,game VARCHAR)
SELECT record FROM table_name_41 WHERE high_assists = "beno udrih (4)" AND game = 26
Search post where comment text like '...'. Also included Score and text
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoR...
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND CreationDate > '01/01/2019' ORDER BY Score DESC
Find the name of customer who has the highest amount of loans.
CREATE TABLE loan (cust_id VARCHAR,amount INTEGER)CREATE TABLE customer (cust_name VARCHAR,cust_id VARCHAR)
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1
provide the number of patients with death status as 0 and procedure title as endoscopic removal of stone(s) from biliary tract.
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
What is the largest value for Fall 08 when Fall 09 is 792 and Fall 05 is less than 791?
CREATE TABLE table_5189 ("Maryland Counties" text,"Fall 05" real,"Fall 06" real,"Fall 07" real,"Fall 08" real,"Fall 09" real)
SELECT MAX("Fall 08") FROM table_5189 WHERE "Fall 09" = '792' AND "Fall 05" < '791'
Get users that have smileys in their username.
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE T...
SELECT Id, Reputation, DisplayName, Location, Age, CreationDate, WebsiteUrl FROM Users WHERE DisplayName LIKE '%sanchy%' ORDER BY Reputation DESC
provide the number of patients whose drug type is main and lab test name is calculated bicarbonate, whole blood?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Calculated Bicarbonate, Whole Blood"
what are the cost of diagnosis for h zoster complicated nec?
CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_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 = 'h zoster complicated nec'))
A bar chart shows the distribution of meter_700 and ID , I want to sort in ascending by the bar.
CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu...
SELECT meter_700, ID FROM swimmer ORDER BY meter_700
Which tv had the date december 7, 1986?
CREATE TABLE table_16797 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"TV" text,"Attendance" text,"Record" text)
SELECT "TV" FROM table_16797 WHERE "Date" = 'December 7, 1986'
Which Tournament in 2010 also has Grand Slam tournaments in 2011
CREATE TABLE table_name_74 (Id VARCHAR)
SELECT 2010 FROM table_name_74 WHERE 2011 = "grand slam tournaments"
Who won the men's singles in 1958?
CREATE TABLE table_69958 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT "Men's singles" FROM table_69958 WHERE "Year" = '1958'
what is maximum age of patients whose admission location is trsf within this facility and primary disease is liver transplant?
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 MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "LIVER TRANSPLANT"
What club has a tries for count of 19?
CREATE TABLE table_17858 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Club" FROM table_17858 WHERE "Tries for" = '19'
Provide the number of patients who were ordered a potassium urine lab test.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Potassium, Urine"
What are the enrollment dates of all the tests that have result 'Pass'?
CREATE TABLE subjects (subject_id number,subject_name text)CREATE TABLE student_course_enrolment (registration_id number,student_id number,course_id number,date_of_enrolment time,date_of_completion time)CREATE TABLE courses (course_id number,author_id number,subject_id number,course_name text,course_description text)CR...
SELECT T1.date_of_enrolment FROM student_course_enrolment AS T1 JOIN student_tests_taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
How many numbers had Brandon Dean as a name?
CREATE TABLE table_39934 ("Name" text,"Position" text,"Number" real,"Season" text,"Acquisition via" text)
SELECT SUM("Number") FROM table_39934 WHERE "Name" = 'brandon dean'
Name the school/club team/country for the player that is 6-5 ft
CREATE TABLE table_name_11 (school_club_team_country VARCHAR,height_in_ft VARCHAR)
SELECT school_club_team_country FROM table_name_11 WHERE height_in_ft = "6-5"
What is the total number of national titles for the team with doane tigers as the mascot?
CREATE TABLE table_38330 ("School" text,"Mascot" text,"Conference" text,"National Titles" real,"Founded" real)
SELECT COUNT("National Titles") FROM table_38330 WHERE "Mascot" = 'doane tigers'
what is procedure short title of procedure icd9 code 3606?
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 procedures.short_title FROM procedures WHERE procedures.icd9_code = "3606"
What is the Home team at corio oval?
CREATE TABLE table_name_57 (home_team VARCHAR,venue VARCHAR)
SELECT home_team FROM table_name_57 WHERE venue = "corio oval"
how many patients whose insurance is government and procedure short title is percu endosc jejunostomy?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Percu endosc jejunostomy"
is the value of chloride second measured on the first hospital visit of patient 030-40641 less than its value first measured on the first hospital visit?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid ...
SELECT (SELECT 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 = '030-40641' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
Suggested edits but nowt else.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera...
SELECT DATE(ApprovalDate) AS dateonly, u.CreationDate, SUM(COUNT(*) * 2) OVER (ORDER BY DATE(ApprovalDate)) AS score, u.Reputation FROM SuggestedEdits INNER JOIN Users AS u ON u.Id = SuggestedEdits.OwnerUserId WHERE NOT ApprovalDate IS NULL AND u.CreationDate >= '2015-01-01' AND u.Reputation BETWEEN 100 AND 2000 AND u....
Which Brilliance Grade has a Benchmark of practical fine cut?
CREATE TABLE table_name_69 (brilliance_grade VARCHAR,benchmark VARCHAR)
SELECT brilliance_grade FROM table_name_69 WHERE benchmark = "practical fine cut"