instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
when did patient 002-39247 get admitted to the hospital via the hospital operating room for the last time during the last year?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmen...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-39247' AND patient.hospitaladmitsource = 'operating room' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
Which state contains the University of Iowa in the mideast region?
CREATE TABLE table_name_67 (state VARCHAR,region VARCHAR,host VARCHAR)
SELECT state FROM table_name_67 WHERE region = "mideast" AND host = "university of iowa"
What was the score for the game on February 29?
CREATE TABLE table_name_10 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_10 WHERE date = "february 29"
What date was Montreal the visitor?
CREATE TABLE table_name_50 (date VARCHAR,visitor VARCHAR)
SELECT date FROM table_name_50 WHERE visitor = "montreal"
Which district has the incumbent Wilbur Mills and a re-elected result?
CREATE TABLE table_18557 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "District" FROM table_18557 WHERE "Result" = 'Re-elected' AND "Incumbent" = 'Wilbur Mills'
What is the lowest pick with fewer than 3 rounds and more than 4 overall?
CREATE TABLE table_47961 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MIN("Pick") FROM table_47961 WHERE "Round" < '3' AND "Overall" > '4'
when patient 002-4486 was prescribed albuterol sulfate (proventil) (2.5 mg/3ml) 0.083% inhalation solution 2.5 mg for the first time since 05/2105?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND medication.drugname = 'albuterol sulfate (prov...
what were the three most common lab tests that patients were given in the same hospital encounter after being diagnosed with dmii circ nt st uncntrld in 2101?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 d_labitems ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
isbn 0-441-01400-3 is book number?
CREATE TABLE table_72832 ("#" real,"Title" text,"Publisher" text,"Release" text,"Length" text,"Hardcover" text,"Paperback" text)
SELECT "#" FROM table_72832 WHERE "Hardcover" = 'ISBN 0-441-01400-3'
How many patients with coronary artery disease or coronary artery bypass graft myomectomy (sda) as their primary disease stayed at hospital for more than a day?
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.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.days_stay > "0"
What's the abbreviation for the month whose transcription is Kumphaphan?
CREATE TABLE table_20354_5 (abbr VARCHAR,transcription VARCHAR)
SELECT abbr FROM table_20354_5 WHERE transcription = "kumphaphan"
what is the number of urgent hospital admission patients who have medicare health insurance?
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 WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Medicare"
When Embry-Riddle made it to the first semi finalist slot, list all the runners up.
CREATE TABLE table_72168 ("Year" real,"Champion" text,"Score" text,"Runner-Up" text,"Location" text,"Semi-Finalist #1" text,"Semi-Finalist #2" text)
SELECT "Runner-Up" FROM table_72168 WHERE "Semi-Finalist #1" = 'Embry-Riddle'
Who is the partner with a score of 6 1, 6 4?
CREATE TABLE table_68121 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Partner" FROM table_68121 WHERE "Score" = '6–1, 6–4'
Whcih Date has an Event of 3000 m?
CREATE TABLE table_name_6 (date VARCHAR,event VARCHAR)
SELECT date FROM table_name_6 WHERE event = "3000 m"
What is the smallest number of tries with conversions more than 0?
CREATE TABLE table_75623 ("Team" text,"Games" real,"Tries" real,"Conversions" real,"Total Points" real)
SELECT MIN("Tries") FROM table_75623 WHERE "Conversions" > '0'
What is the date for the catalog CDZAP22 in the United Kingdom?
CREATE TABLE table_59721 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Date" FROM table_59721 WHERE "Country" = 'united kingdom' AND "Catalog" = 'cdzap22'
What is the 1998 value with A in 1995, A in 1993, and 1r in 1996?
CREATE TABLE table_name_4 (Id VARCHAR)
SELECT 1998 FROM table_name_4 WHERE 1995 = "a" AND 1993 = "a" AND 1996 = "1r"
What is the fewest number of occ championships for the team that last won an outright occ championship in 2006?
CREATE TABLE table_21684 ("School" text,"Years of Participation" text,"OCC Championships" real,"Last OCC Championship" text,"Last Outright OCC Championship" text)
SELECT MIN("OCC Championships") FROM table_21684 WHERE "Last Outright OCC Championship" = '2006'
What are the names and average salaries for departments with average salary higher than 42000 Plot them as bar chart, and sort by the X-axis from low to high.
CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),grade varchar(2))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),bui...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
Name the score with opponent of javier genaro-martinez
CREATE TABLE table_name_44 (score VARCHAR,opponent VARCHAR)
SELECT score FROM table_name_44 WHERE opponent = "javier genaro-martinez"
What won the Best Female Artist if Best Lyrical Record won the Best Male Artist?
CREATE TABLE table_22546460_4 (best_female_artist VARCHAR,best_male_artist VARCHAR)
SELECT best_female_artist FROM table_22546460_4 WHERE best_male_artist = "Best Lyrical Record"
Who was the home team when the opposition was Buller?
CREATE TABLE table_29087 ("Round #" text,"Home Team" text,"Win/Loss" text,"Score" text,"Opposition" text,"Location" text)
SELECT "Home Team" FROM table_29087 WHERE "Opposition" = 'Buller'
What finish has +21 as the to par?
CREATE TABLE table_name_35 (finish VARCHAR,to_par VARCHAR)
SELECT finish FROM table_name_35 WHERE to_par = "+21"
What is the Element when the Nuclide is 55 mn?
CREATE TABLE table_42764 ("Element" text,"Nuclide" text,"Z (p)" real,"N (n)" real,"isotopic mass (u)" text)
SELECT "Element" FROM table_42764 WHERE "Nuclide" = '55 mn'
When was the first performance with a replacement cast?
CREATE TABLE table_name_80 (first_performance VARCHAR,status VARCHAR)
SELECT first_performance FROM table_name_80 WHERE status = "replacement cast"
What is the mark for the runner in lanes under 2 and heats under 5?
CREATE TABLE table_name_83 (mark VARCHAR,lane VARCHAR,heat VARCHAR)
SELECT mark FROM table_name_83 WHERE lane < 2 AND heat < 5
What are the coreceptors of the chromosomes in that location 11q22.2-q22.3?
CREATE TABLE table_4254 ("Name" text,"Family name" text,"Receptor" text,"Coreceptor" text,"Property" text,"Chromosomal location" text)
SELECT "Coreceptor" FROM table_4254 WHERE "Chromosomal location" = '11q22.2-q22.3'
Name the tfl-yds for no-yds 1-0
CREATE TABLE table_1186 ("Name" text,"GP" real,"Solo" real,"Ast" real,"Total" real,"TFL-Yds" text,"No-Yds" text,"BrUp" real,"QBH" real,"No.-Yds" text,"Avg" text,"TD" real,"Rcv-Yds" text,"FF" real,"Blkd Kick" real)
SELECT "TFL-Yds" FROM table_1186 WHERE "No-Yds" = '1-0'
What is the % of annual production of solar?
CREATE TABLE table_238 ("Power Source" text,"Number of Generators" real,"Power Capacity (GW)" text,"% of total Capacity" text,"Capacity factor" text,"Annual Energy (billion kWh)" text,"% of annual production" text)
SELECT "% of annual production" FROM table_238 WHERE "Power Source" = 'Solar'
Show sum transaction amount from each transaction type, and list by the total number in asc.
CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other_order_item_details VARCHAR(255))CREATE TABLE Orders (order_id INTEGER,customer_id INTEGER,date_order_placed DATETIME,order_details VARCHAR(255))CREATE TABLE Invoices (invoice_number INTEGER,order_id IN...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount)
Which Medal had a Games of 2008 beijing, and a Sport of taekwondo?
CREATE TABLE table_75001 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text)
SELECT "Medal" FROM table_75001 WHERE "Games" = '2008 beijing' AND "Sport" = 'taekwondo'
What is the Tournament with a 3r 2011 and A 2010?
CREATE TABLE table_43074 ("Tournament" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "Tournament" FROM table_43074 WHERE "2011" = '3r' AND "2010" = 'a'
Show me how many destination by destination in a histogram, sort y-axis in ascending order.
CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),dep...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination)
How many golden tickets for the georgia international convention center?
CREATE TABLE table_77702 ("Episode Air Date" text,"Audition City" text,"Date" text,"First Audition Venue" text,"Callback Date" text,"Callback Venue" text,"Golden Tickets" real)
SELECT SUM("Golden Tickets") FROM table_77702 WHERE "Callback Venue" = 'georgia international convention center'
Who had the high assists @ Dallas?
CREATE TABLE table_11964154_11 (high_assists VARCHAR,team VARCHAR)
SELECT high_assists FROM table_11964154_11 WHERE team = "@ Dallas"
who is the away team when played at junction oval?
CREATE TABLE table_52264 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Date" text)
SELECT "Away team" FROM table_52264 WHERE "Venue" = 'junction oval'
What is Fastest Lap, when Winning Team is Team BRM, when Race is 1, when Pole Position is Leanne Tander, and when Circuit is Phillip Island?
CREATE TABLE table_name_8 (fastest_lap VARCHAR,circuit VARCHAR,pole_position VARCHAR,winning_team VARCHAR,race VARCHAR)
SELECT fastest_lap FROM table_name_8 WHERE winning_team = "team brm" AND race = 1 AND pole_position = "leanne tander" AND circuit = "phillip island"
Find the last names of all the authors that have written a paper with title containing the word 'Monadic'.
CREATE TABLE authors (authid number,lname text,fname text)CREATE TABLE inst (instid number,name text,country text)CREATE TABLE papers (paperid number,title text)CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Monadic%"
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday, list y axis in asc order.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COU...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID)
What is the name of the venue when the home team is Richmond?
CREATE TABLE table_name_26 (venue VARCHAR,home_team VARCHAR)
SELECT venue FROM table_name_26 WHERE home_team = "richmond"
What are the ids of all songs that are available on mp4 or have a higher resolution than 720?
CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre text)CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE file...
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
Name the candidates for texas 20
CREATE TABLE table_1341690_43 (candidates VARCHAR,district VARCHAR)
SELECT candidates FROM table_1341690_43 WHERE district = "Texas 20"
Which Affected area codes have an Effective date of august 30, 2014?
CREATE TABLE table_66524 ("New area code" real,"Where" text,"Affected area codes" text,"Format" text,"Effective date" text)
SELECT "Affected area codes" FROM table_66524 WHERE "Effective date" = 'august 30, 2014'
What is the highest number of points that Justin Hodges earned with 0 field goals and 0 regular goals?
CREATE TABLE table_60107 ("Player" text,"Tries" real,"Goals" text,"Field Goals" real,"Points" real)
SELECT MAX("Points") FROM table_60107 WHERE "Field Goals" = '0' AND "Goals" = '0' AND "Player" = 'justin hodges'
how many hours have passed since the first prescribing of furosemide 80 mg po tabs in patient 013-38992 on the current hospital visit?
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38...
how many patients are diagnosed with malignant carcinoid tumour of the rectum and tested under category hematology in lab?
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Malignant carcinoid tumor of the rectum" AND lab."CATEGORY" = "Hematology"
Who was nominated for outstanding director of a musical?
CREATE TABLE table_11942 ("Year" real,"Award" text,"Category" text,"Nominee" text,"Result" text)
SELECT "Nominee" FROM table_11942 WHERE "Category" = 'outstanding director of a musical'
Which home town was the high school Catholic University located in?
CREATE TABLE table_407 ("Name" text,"#" real,"Position" text,"Height" text,"Weight" real,"Year" text,"Home Town" text,"High School" text)
SELECT "Home Town" FROM table_407 WHERE "High School" = 'Catholic University'
what were the top three most frequent diagnosis that patients received within 2 months after they were diagnosed with intra-abdominal abscess - intestinal?
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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intra-abdominal abscess - intestinal') A...
What is the amount of assists when mins is 744:27?
CREATE TABLE table_23532 ("Year" text,"Team" text,"Games" real,"Mins" text,"FG%" text,"3P%" text,"FT%" text,"Rebounds" text,"Assists" text,"Steals" text,"Blocks" text,"Points" text)
SELECT "Assists" FROM table_23532 WHERE "Mins" = '744:27'
Get User Info and Tags (Total answers and Accepted Answers). Returns the URL with the user's original inputted URL, the users reputation, number of answers posted, number of answers accepted and stats for supplied tags. For https://www.codersclan.net/ticket/671
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id ...
SELECT answer.OwnerUserId AS "user_link", 'http://stackoverflow.com/users/' + CAST(answer.OwnerUserId AS TEXT(10)) AS "permalink", Users.Reputation, question.Tags, COUNT(answer.Id) AS "total_answers", COUNT(question.Id) AS "accepted_answers" FROM Posts AS answer LEFT OUTER JOIN Posts AS question ON question.AcceptedAns...
what was the result where the candidates are sam m. gibbons (d) unopposed?
CREATE TABLE table_1341663_10 (result VARCHAR,candidates VARCHAR)
SELECT result FROM table_1341663_10 WHERE candidates = "Sam M. Gibbons (D) Unopposed"
Name the outcome for opponent of micha lla krajicek eleni daniilidou
CREATE TABLE table_6501 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponent" text,"Score" text)
SELECT "Outcome" FROM table_6501 WHERE "Opponent" = 'michaëlla krajicek eleni daniilidou'
How many more accepted answers do I need until Tenacious/Unsung Hero. Variation of Eric's query 'How unsung am I?' Zero and non-zero accepted count. Self-accepted answers do not count. How many more accepted answers with a score of zero are needed, assuming no more accepted answers with a score greater than 0, to recei...
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,...
SELECT COUNT(a.Id) AS "accepted_answers", SUM(CASE WHEN a.Score = 0 THEN 0 ELSE 1 END) AS "scored_answers", SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS "unscored_answers", SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) * 1000 / COUNT(a.Id) / 10.0 AS "percentage_unscored", (COUNT(a.Id) / 5 - SUM(CASE WHEN a.Score = 0 ...
count the number of patients whose gender is m and diagnoses long title is atherosclerosis of native arteries of the extremities, unspecified?
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.gender = "M" AND diagnoses.long_title = "Atherosclerosis of native arteries of the extremities, unspecified"
Who did the Red Sox play against on July 8?
CREATE TABLE table_11876 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Opponent" FROM table_11876 WHERE "Date" = 'july 8'
What is the number for Chauchilla Cemetery Battle with less than 511 pieces?
CREATE TABLE table_14484 ("Name" text,"Number" real,"Released" real,"Film" text,"Pieces" real)
SELECT AVG("Number") FROM table_14484 WHERE "Pieces" < '511' AND "Name" = 'chauchilla cemetery battle'
Top users of SO in India.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,R...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IN' ORDER BY Reputation DESC
Who was the opponent when the Phillies played on April 28?
CREATE TABLE table_name_77 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_77 WHERE date = "april 28"
Just compare the number of journal committees of each editor using a histogram, and list in desc by the bar.
CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)
SELECT Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID ORDER BY Name DESC
Which Game has a November of 22?
CREATE TABLE table_37534 ("Game" real,"November" real,"Opponent" text,"Score" text,"Record" text)
SELECT SUM("Game") FROM table_37534 WHERE "November" = '22'
Whas is the released date of the memory type ddr2-667?
CREATE TABLE table_11909 ("Model" text,"Released" text,"Form factor" text,"Chipset" text,"Memory Type" text,"Max. Memory" text)
SELECT "Released" FROM table_11909 WHERE "Memory Type" = 'ddr2-667'
Who was the color commentator for Andrea Kremer and Tiki Barber?
CREATE TABLE table_name_22 (color_commentator_s_ VARCHAR,sideline_reporter_s_ VARCHAR)
SELECT color_commentator_s_ FROM table_name_22 WHERE sideline_reporter_s_ = "andrea kremer and tiki barber"
Name the Rank of Rank Mountain Peak of crested butte pb?
CREATE TABLE table_name_43 (rank VARCHAR,mountain_peak VARCHAR)
SELECT rank FROM table_name_43 WHERE mountain_peak = "crested butte pb"
Name the 2010 for 2011 of a and 2008 of 1r
CREATE TABLE table_80360 ("Tournament" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2010" FROM table_80360 WHERE "2011" = 'a' AND "2008" = '1r'
what are the five most commonly used procedures for patients who had received intraop cardiac pacemak previously within 2 months,?
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,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom te...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
Papers authored by Daniel S. Weld in 2011
CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE dataset (datasetid int,datasetname varchar)C...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Daniel S. Weld' AND paper.year = 2011 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
What is the fewest Points that has Willie Heston as Player and less than 3 as Touchdowns?
CREATE TABLE table_5086 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Safeties" real,"Points" real)
SELECT MIN("Points") FROM table_5086 WHERE "Player" = 'willie heston' AND "Touchdowns" < '3'
What was the lineup for match 12 that had a competition of Group Stage?
CREATE TABLE table_47983 ("Match" text,"Date" text,"Location" text,"Lineup" text,"Result" text,"Competition" text)
SELECT "Lineup" FROM table_47983 WHERE "Competition" = 'group stage' AND "Match" = '12'
What is the name of the person from series bb1 with a hometown of Bolton?
CREATE TABLE table_name_69 (name VARCHAR,series VARCHAR,hometown VARCHAR)
SELECT name FROM table_name_69 WHERE series = "bb1" AND hometown = "bolton"
what is the venue of neman
CREATE TABLE table_name_23 (venue VARCHAR,team VARCHAR)
SELECT venue FROM table_name_23 WHERE team = "neman"
what is the week there were 41,604 people in attendance?
CREATE TABLE table_33523 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT AVG("Week") FROM table_33523 WHERE "Attendance" = '41,604'
What was the race for the world championship formula 1 at a venue of hungaroring?
CREATE TABLE table_name_4 (race VARCHAR,notes VARCHAR,venue VARCHAR)
SELECT race FROM table_name_4 WHERE notes = "world championship formula 1" AND venue = "hungaroring"
is there a microbiological test result for the rapid respiratory viral screen & culture of patient 458 in 2105?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime t...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 458) AND microbiologyevents.spec_type_desc = 'rapid respiratory viral screen & culture' AND STRFTIME('%y', microbiologyevents.charttime) = '2105'
How many square miles of water does the township at latitude 48.064751 have?
CREATE TABLE table_18600760_9 (water__sqmi_ VARCHAR,latitude VARCHAR)
SELECT water__sqmi_ FROM table_18600760_9 WHERE latitude = "48.064751"
What is the IHSAA class of the county that is less than 228?
CREATE TABLE table_name_71 (ihsaa_class VARCHAR,county INTEGER)
SELECT ihsaa_class FROM table_name_71 WHERE county < 228
Name the Region with a Mountain Peak of dillingham high point?
CREATE TABLE table_77146 ("Rank" real,"Mountain Peak" text,"Region" text,"Mountain Range" text,"Location" text)
SELECT "Region" FROM table_77146 WHERE "Mountain Peak" = 'dillingham high point'
What are the records when Elzbieta Urbanczik competed?
CREATE TABLE table_14884844_2 (record VARCHAR,athletes VARCHAR)
SELECT record FROM table_14884844_2 WHERE athletes = "Elzbieta Urbanczik"
get me the time of admission and primary disease of patient michael witt.
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, demographic.admittime FROM demographic WHERE demographic.name = "Michael Witt"
What is Result, when Opponent is Cincinnati Bengals?
CREATE TABLE table_name_32 (result VARCHAR,opponent VARCHAR)
SELECT result FROM table_name_32 WHERE opponent = "cincinnati bengals"
See all posts from someone.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskType...
SELECT Id AS "post_link", OwnerDisplayName FROM Posts WHERE OwnerDisplayName = '##UserDisplayname##'
WHAT IS THE RESULT WHEN THE OPPONENT WAS CHICAGO BEARS?
CREATE TABLE table_76432 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" text)
SELECT "Result" FROM table_76432 WHERE "Opponent" = 'chicago bears'
Show the product type codes which have at least two products.
CREATE TABLE order_items (order_item_id number,order_id number,product_id number,order_quantity text)CREATE TABLE customer_orders (order_id number,customer_id number,order_date time,order_status_code text)CREATE TABLE customer_address_history (customer_id number,address_id number,date_from time,date_to time)CREATE TABL...
SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2
Date of november 29, 1959 had what lowest attendance?
CREATE TABLE table_name_7 (attendance INTEGER,date VARCHAR)
SELECT MIN(attendance) FROM table_name_7 WHERE date = "november 29, 1959"
what was the amount of inputs patient 26286 had received on this month/12?
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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id numb...
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 = 26286)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME()...
how many patients are admitted under phys referral/normal deli and tested with lab item id 51005?
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.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51005"
What family has the name of eastern cottontail?
CREATE TABLE table_name_57 (family VARCHAR,name VARCHAR)
SELECT family FROM table_name_57 WHERE name = "eastern cottontail"
Find the number of stores in each city.
CREATE TABLE store_district (store_id VARCHAR,district_id VARCHAR)CREATE TABLE store (store_id VARCHAR)CREATE TABLE district (headquartered_city VARCHAR,district_id VARCHAR)
SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city
Who's the player that was eliminated on episode 4?
CREATE TABLE table_64424 ("Player" text,"Original Season" text,"Gender" text,"Eliminated" text,"Placing" text)
SELECT "Player" FROM table_64424 WHERE "Eliminated" = 'episode 4'
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Home.
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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Home
Compute the number of services by services and then split by local authorities Show the result with a stacked bar graph, and I want to show by the y-axis from high to low.
CREATE TABLE route (train_id int,station_id int)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE station (id ...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority) DESC
Name the ICAO for julius nyerere international airport
CREATE TABLE table_38638 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "ICAO" FROM table_38638 WHERE "Airport" = 'julius nyerere international airport'
What is the 2005 value with 1r in 2013 and q2 in 2011?
CREATE TABLE table_71450 ("Tournament" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text)
SELECT "2005" FROM table_71450 WHERE "2013" = '1r' AND "2011" = 'q2'
Which Zone is the lowest when Managed By Southern and has Platforms under 2?
CREATE TABLE table_name_88 (zone INTEGER,managed_by VARCHAR,platforms VARCHAR)
SELECT MIN(zone) FROM table_name_88 WHERE managed_by = "southern" AND platforms < 2
How many steals did Tamika Williams have?
CREATE TABLE table_24908692_5 (steals VARCHAR,player VARCHAR)
SELECT steals FROM table_24908692_5 WHERE player = "Tamika Williams"
What date was the match played where Amy Frazier was the opponent?
CREATE TABLE table_name_80 (date VARCHAR,opponent_in_the_final VARCHAR)
SELECT date FROM table_name_80 WHERE opponent_in_the_final = "amy frazier"
Where was game 62 played?
CREATE TABLE table_21139 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Location" FROM table_21139 WHERE "Game" = '62'
Name the position of glenn goldup
CREATE TABLE table_1965650_2 (position VARCHAR,player VARCHAR)
SELECT position FROM table_1965650_2 WHERE player = "Glenn Goldup"
What's the most jim colbert got paid?
CREATE TABLE table_10369 ("Rank" real,"Player" text,"Country" text,"Earnings($)" real,"Wins" real)
SELECT MAX("Earnings( $ )") FROM table_10369 WHERE "Player" = 'jim colbert'