instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Count the number of married patients who had a wbc pleural lab test done.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "WBC, Pleural"
What is the name of the linebacker at Illinois college?
CREATE TABLE table_10361625_1 (player_name VARCHAR,position VARCHAR,college VARCHAR)
SELECT player_name FROM table_10361625_1 WHERE position = "Linebacker" AND college = "Illinois"
what was the organism name found since 69 months ago in patient 26612's first urine microbiology test?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE outputevents (row_id...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) >= DATETIM...
What was the date of game with a score of 42-6?
CREATE TABLE table_name_23 (date VARCHAR,score VARCHAR)
SELECT date FROM table_name_23 WHERE score = "42-6"
Which Year(s) won has a Total of 289?
CREATE TABLE table_13142 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "Year(s) won" FROM table_13142 WHERE "Total" = '289'
what number of patients were prescribed thiamine study drug (*ind*) in the same hospital visit after having been diagnosed with ath ext ntv art gngrene?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (r...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
ARTDES 210 is taught by how many professors during Spring-Summer 2017 ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ARTDES' AND course.number = 210 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off...
What Sprints classification has the Points classification, Mark Cavendish and Team classification, Caisse D'epargne?
CREATE TABLE table_55587 ("Stage (Winner)" text,"General Classification" text,"Mountains Classification" text,"Points Classification" text,"Sprints classification" text,"Team Classification" text)
SELECT "Sprints classification" FROM table_55587 WHERE "Points Classification" = 'mark cavendish' AND "Team Classification" = 'caisse d''epargne'
[WIP] Number of answers in a given week over time.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance t...
SELECT 'Six months ago', COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN DATEADD('m', -6, GETDATE()) AND DATEADD('m', -6, DATEADD('w', -1, GETDATE())) UNION ALL SELECT 'Two years ago months ago', COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN DATEADD('y', -2, GETDATE()) AND DATEADD(...
how many patients with lab test item id 51501 were born before 2107?
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.dob_year < "2107" AND lab.itemid = "51501"
Name the aggregate with opponents of tauras
CREATE TABLE table_68560 ("Season" text,"Competition" text,"Round" text,"Opponents" text,"Home leg" text,"Away leg" text,"Aggregate" text)
SELECT "Aggregate" FROM table_68560 WHERE "Opponents" = 'tauras'
What is the CPU speed(s) of the New Plus type hardware?
CREATE TABLE table_13823 ("Brand" text,"Model" text,"Type" text,"Modem" text,"Storage" text,"CPU speed" text,"CPU chip" text)
SELECT "CPU speed" FROM table_13823 WHERE "Type" = 'new plus'
What was the UK broadcast date for the episode presented by Buck Henry?
CREATE TABLE table_1209 ("Episode No." text,"Episode Title" text,"UK Broadcast Date" text,"Presenter" text,"Countries Visited" text)
SELECT "UK Broadcast Date" FROM table_1209 WHERE "Presenter" = 'Buck Henry'
What is the Netflix number having a series episode of 1-01?
CREATE TABLE table_75286 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Netflix" FROM table_75286 WHERE "Series Ep." = '1-01'
The Away High Park Demons was which Ground?
CREATE TABLE table_name_83 (ground VARCHAR,away VARCHAR)
SELECT ground FROM table_name_83 WHERE away = "high park demons"
What is the number of films of each director? Return a bar chart.
CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Locatio...
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by
how many times did patient 76005 in the last year have a cholangiogram nec?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (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 ...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholangiogram nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76005) AND DATETIME(procedures_ic...
What was the language score when the reading score was 94.47?
CREATE TABLE table_27577 ("School Year" text,"Language" text,"Science" text,"Reading" text,"Mathematics" text,"Social Studies" text)
SELECT "Language" FROM table_27577 WHERE "Reading" = '94.47'
tell me patient 029-8147's monthly maximum rbc since 173 months ago.
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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,...
SELECT MAX(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 = '029-8147')) AND lab.labname = 'rbc' AND DATETIME(lab.labresulttime) >= DATETIME(CU...
tell me patient 92788's total foley output on the current icu visit.
CREATE TABLE d_icd_procedures (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 d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)C...
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 = 92788) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_ite...
What is the total amount of money spent by Lucas Mancini?
CREATE TABLE customers (id VARCHAR,first_name VARCHAR,last_name VARCHAR)CREATE TABLE invoices (total INTEGER,customer_id VARCHAR)
SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"
What is 1st Party, when First Member is 'Peter John Locke King', and when Second Member is 'James Watney'?
CREATE TABLE table_name_18 (first_member VARCHAR,second_member VARCHAR)
SELECT 1 AS st_party FROM table_name_18 WHERE first_member = "peter john locke king" AND second_member = "james watney"
What was the winning score for oldsmobile lpga classic?
CREATE TABLE table_name_64 (winning_score VARCHAR,tournament VARCHAR)
SELECT winning_score FROM table_name_64 WHERE tournament = "oldsmobile lpga classic"
What was the crowd number when Hawthorn was the away team?
CREATE TABLE table_55355 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT MAX("Crowd") FROM table_55355 WHERE "Away team" = 'hawthorn'
How many maximum points were there when the left tackle was played and there were 5 extra points?
CREATE TABLE table_19281 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT MAX("Points") FROM table_19281 WHERE "Position" = 'Left tackle' AND "Extra points" = '5'
When there was a bye in the round of 32, what was the result in the round of 16?
CREATE TABLE table_72904 ("Athlete" text,"Event" text,"Round of 32" text,"Round of 16" text,"Quarterfinals" text,"Semifinals" text)
SELECT "Semifinals" FROM table_72904 WHERE "Round of 32" = 'Bye'
count the number of patients whose item id is 50805?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50805"
When by80607002529af is the part number and september 2009 is the release date what is the l2 cache?
CREATE TABLE table_22632 ("Model number" text,"sSpec number" text,"Frequency" text,"Turbo" text,"Cores" real,"L2 cache" text,"L3 cache" text,"I/O bus" text,"Mult." text,"Memory" text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text)
SELECT "L2 cache" FROM table_22632 WHERE "Release date" = 'September 2009' AND "Part number(s)" = 'BY80607002529AF'
What conferences did Yejin Kim submit to in 2015 ?
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE venue (venueid int,venuename va...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Yejin Kim' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
what was the total number of wins in the season ?
CREATE TABLE table_204_73 (id number,"date" text,"opponent" text,"score" text,"result" text,"record" text)
SELECT COUNT(*) FROM table_204_73 WHERE "result" = 'win'
When was a game played where the away team is St Kilda?
CREATE TABLE table_name_63 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_63 WHERE away_team = "st kilda"
User's Tags by Post Count.
CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body ...
SELECT t.TagName, COUNT(*) AS PostCount FROM Posts AS p LEFT JOIN Posts AS q ON p.ParentId = q.Id LEFT JOIN (PostTags AS pt INNER JOIN Tags AS t ON pt.TagId = t.Id) ON pt.PostId = p.Id OR pt.PostId = q.Id WHERE p.OwnerUserId = '##UserId##' GROUP BY t.TagName ORDER BY PostCount DESC, t.TagName
Show the number of transactions for different investors.
CREATE TABLE TRANSACTIONS (investor_id VARCHAR)
SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id
How many attempts for Bobby Layne?
CREATE TABLE table_22984 ("Name" text,"Completions" real,"Attempts" real,"Completion %" text,"Yards" real,"Touchdowns" real,"Interceptions" real,"QB Rating" text)
SELECT MIN("Attempts") FROM table_22984 WHERE "Name" = 'Bobby Layne'
What is the number of locations of the wrestlers? Visualize by a bar chart, I want to list by the bar from low to high.
CREATE TABLE wrestler (Wrestler_ID int,Name text,Reign text,Days_held text,Location text,Event text)CREATE TABLE Elimination (Elimination_ID text,Wrestler_ID text,Team text,Eliminated_By text,Elimination_Move text,Time text)
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location
Who was the runner-up for the mazda senior tournament players championship tournament when the margin of victory was 2 strokes?
CREATE TABLE table_40277 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Runner(s)-up" FROM table_40277 WHERE "Margin of victory" = '2 strokes' AND "Tournament" = 'mazda senior tournament players championship'
What is the Locality of the Penarth Group School for Ages 8-16?
CREATE TABLE table_8417 ("School" text,"Locality" text,"Ages" text,"Report" text,"Website" text)
SELECT "Locality" FROM table_8417 WHERE "Ages" = '8-16' AND "School" = 'penarth group school'
List the names and buildings of all departments sorted by the budget from large to small.
CREATE TABLE department (dept_name VARCHAR,building VARCHAR,budget VARCHAR)
SELECT dept_name, building FROM department ORDER BY budget DESC
papers by linda shapiro in 2016
CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE ...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
Is BIOSTAT 606 a prerequisite for anything ?
CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'BIOSTAT' AND COURSE_0.number = 606 AND COURSE_1.course_id = course_prerequisite.course_id
Which race was at Hockenheim circuit?
CREATE TABLE table_name_74 (race_name VARCHAR,circuit VARCHAR)
SELECT race_name FROM table_name_74 WHERE circuit = "hockenheim"
Show the Color which has a Thai name of ?
CREATE TABLE table_61948 ("English name" text,"Thai name" text,"Transcription" text,"Color" text,"Sanskrit word" text,"Planet" text)
SELECT "Color" FROM table_61948 WHERE "Thai name" = 'วันพฤหัสบดี'
Who are the Rowers with a Time of 5:56.38?
CREATE TABLE table_66354 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Rowers" FROM table_66354 WHERE "Time" = '5:56.38'
What is the Airport when the ICAO shows rpvm?
CREATE TABLE table_38162 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "Airport" FROM table_38162 WHERE "ICAO" = 'rpvm'
what is the total amount of input until 12/28/2105 patient 23061 had received?
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 transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREA...
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 = 23061)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2105-12-28'
Which box score has a Loss of capuano (5 5)?
CREATE TABLE table_name_82 (boxscore VARCHAR,loss VARCHAR)
SELECT boxscore FROM table_name_82 WHERE loss = "capuano (5–5)"
All display names on StackOverflow sorted by frequency.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivileg...
SELECT DisplayName, COUNT(DisplayName) FROM Users GROUP BY DisplayName ORDER BY COUNT(DisplayName) DESC
What are the different district names in order of descending city area?
CREATE TABLE store (store_id number,store_name text,type text,area_size number,number_of_product_category number,ranking number)CREATE TABLE store_district (store_id number,district_id number)CREATE TABLE store_product (store_id number,product_id number)CREATE TABLE district (district_id number,district_name text,headq...
SELECT DISTINCT district_name FROM district ORDER BY city_area DESC
How many employees have certificate.
CREATE TABLE Certificate (eid VARCHAR)
SELECT COUNT(DISTINCT eid) FROM Certificate
Which of the mill names contains the french word 'Moulin'?
CREATE TABLE mill (architect_id number,id number,location text,name text,type text,built_year number,notes text)CREATE TABLE bridge (architect_id number,id number,name text,location text,length_meters number,length_feet number)CREATE TABLE architect (id text,name text,nationality text,gender text)
SELECT name FROM mill WHERE name LIKE '%Moulin%'
when the away team score was 21.11 (137) what was the home team score?
CREATE TABLE table_58231 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_58231 WHERE "Away team score" = '21.11 (137)'
provide the number of patients whose admission type is urgent and procedure long title is laparoscopic lysis of peritoneal adhesions?
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 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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Laparoscopic lysis of peritoneal adhesions"
what is the lowest number of live births when the crude birth rate (per 1000) is more than 22.1, the crude death rate (per 1000) is less than 5.5, the average population (x1000) is 2,401, and the natural change is more than 45,272?
CREATE TABLE table_11429 ("Average population (x 1000)" real,"Live births" real,"Deaths" text,"Natural change" real,"Crude birth rate (per 1000)" real,"Crude death rate (per 1000)" real,"Natural change (per 1000)" real)
SELECT MIN("Live births") FROM table_11429 WHERE "Crude birth rate (per 1000)" > '22.1' AND "Crude death rate (per 1000)" < '5.5' AND "Average population (x 1000)" = '2,401' AND "Natural change" > '45,272'
How tall is the Mountain of jbel ghat?
CREATE TABLE table_79543 ("Mountain" text,"Height (m)" real,"Prominence (m)" real,"Range" text,"Country" text)
SELECT COUNT("Height (m)") FROM table_79543 WHERE "Mountain" = 'jbel ghat'
Who were the Visitor when the Nets were the Home team?
CREATE TABLE table_name_7 (visitor VARCHAR,home VARCHAR)
SELECT visitor FROM table_name_7 WHERE home = "nets"
What was the score on march 11?
CREATE TABLE table_name_50 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_50 WHERE date = "march 11"
Which Series Ep has a Netflix of s08e18?
CREATE TABLE table_name_83 (series_ep VARCHAR,netflix VARCHAR)
SELECT series_ep FROM table_name_83 WHERE netflix = "s08e18"
What are the names of all departments in alphabetical order?
CREATE TABLE employee (emp_num number,emp_lname text,emp_fname text,emp_initial text,emp_jobcode text,emp_hiredate time,emp_dob time)CREATE TABLE professor (emp_num number,dept_code text,prof_office text,prof_extension text,prof_high_degree text)CREATE TABLE course (crs_code text,dept_code text,crs_description text,crs...
SELECT dept_name FROM department ORDER BY dept_name
i want a flight from LOS ANGELES to CHARLOTTE early in the morning
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)C...
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'LOS ANGELES')) AND to_airport IN (SELECT AIRP...
Name the record for 9-4 score
CREATE TABLE table_name_61 (record VARCHAR,score VARCHAR)
SELECT record FROM table_name_61 WHERE score = "9-4"
What is the ICAO for Air Busan?
CREATE TABLE table_40826 ("AIRLINE" text,"ICAO" text,"IATA" text,"CALLSIGN" text,"COMMENCED OPERATIONS" text)
SELECT "ICAO" FROM table_40826 WHERE "CALLSIGN" = 'air busan'
What position was played with a Difference of - 5, and a Played larger than 14?
CREATE TABLE table_35157 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT AVG("Position") FROM table_35157 WHERE "Difference" = '- 5' AND "Played" > '14'
How many different genres appear for the Jimi Hendrix Experience?
CREATE TABLE table_26488540_1 (genre VARCHAR,artist VARCHAR)
SELECT COUNT(genre) FROM table_26488540_1 WHERE artist = "The Jimi Hendrix Experience"
when was the first time that patient 025-51835 was prescribed with dextrose 50% and lidocaine hcl 1% at the same time in 11/last year?
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 microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultu...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dextrose 50%' AND patient.uniquepid = '025-51835' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURR...
What is the average Grid for the honda cbr1000rr, with 18 laps and a time of +1:12.884?
CREATE TABLE table_name_45 (grid INTEGER,time VARCHAR,bike VARCHAR,laps VARCHAR)
SELECT AVG(grid) FROM table_name_45 WHERE bike = "honda cbr1000rr" AND laps = 18 AND time = "+1:12.884"
what is date of birth and drug route of subject name jerry deberry?
CREATE TABLE procedures (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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT demographic.dob, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry"
Name the total number of nicknames for andrew college
CREATE TABLE table_21032 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Enrollment" real,"Joined" real)
SELECT COUNT("Nickname") FROM table_21032 WHERE "Institution" = 'Andrew College'
What year was jerry marion drafted?
CREATE TABLE table_870 ("Draft Year" real,"Player" text,"Position" text,"Round" real,"Overall" real,"NFL Team" text)
SELECT MAX("Draft Year") FROM table_870 WHERE "Player" = 'Jerry Marion'
Good answer vs includes code.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT CASE WHEN a.Score > 0 OR a.Id = q.AcceptedAnswerId THEN 'yes' ELSE 'no' END AS GoodAnswer, CASE WHEN q.Body LIKE '%<code>%' THEN 'yes' ELSE 'no' END AS IncludesCode, COUNT(*) AS Count FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.ViewCount > 10 AND q.Answe...
What is the Date of the Tournament with a Score of 3 6, 7 6(6), 5 7?
CREATE TABLE table_49188 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Date" FROM table_49188 WHERE "Score" = '3–6, 7–6(6), 5–7'
What was the result for the award for best current affairs presenter?
CREATE TABLE table_63093 ("Year" real,"Organisation" text,"Award" text,"Nominated Work Title" text,"Result" text)
SELECT "Result" FROM table_63093 WHERE "Award" = 'best current affairs presenter'
What is the sum of all gold medals for Algeria when total medals is less than 3?
CREATE TABLE table_35005 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Gold") FROM table_35005 WHERE "Nation" = 'algeria' AND "Total" < '3'
Which episode number drew in 3.35 million viewers in the United States?
CREATE TABLE table_14929574_3 (series__number VARCHAR,us_viewers__million_ VARCHAR)
SELECT COUNT(series__number) FROM table_14929574_3 WHERE us_viewers__million_ = "3.35"
calculate how many times patient 56635 has received cont inv mec ven <96 hrs procedures.
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 patients (row_id number,subject_id number,gender text,dob time,dod time)C...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv mec ven <96 hrs') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56635)
What is the highest swimsuit score of the contestant with an evening gown larger than 9.175 and an interview score less than 8.425?
CREATE TABLE table_78235 ("State" text,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real)
SELECT MAX("Swimsuit") FROM table_78235 WHERE "Evening Gown" > '9.175' AND "Interview" < '8.425'
What is the sum of car numbers with less than 126 points and 147 laps?
CREATE TABLE table_33000 ("Driver" text,"Car #" real,"Make" text,"Points" real,"Laps" real,"Winnings" text)
SELECT SUM("Car #") FROM table_33000 WHERE "Points" < '126' AND "Laps" = '147'
What venue is home for the Melbourne team?
CREATE TABLE table_name_60 (venue VARCHAR,home_team VARCHAR)
SELECT venue FROM table_name_60 WHERE home_team = "melbourne"
Name the total number of step 6 for 11 gs grade
CREATE TABLE table_2319437_1 (step_6 VARCHAR,gs_grade VARCHAR)
SELECT COUNT(step_6) FROM table_2319437_1 WHERE gs_grade = 11
I want the manner of departure for date of appointment being 12 october 2007
CREATE TABLE table_56406 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT "Manner of departure" FROM table_56406 WHERE "Date of appointment" = '12 october 2007'
Which Rank has a Total of 1 and a Bronze larger than 0?
CREATE TABLE table_7669 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Rank") FROM table_7669 WHERE "Total" = '1' AND "Bronze" > '0'
How many game locations occurred on March 6?
CREATE TABLE table_23248967_9 (location_attendance VARCHAR,date VARCHAR)
SELECT COUNT(location_attendance) FROM table_23248967_9 WHERE date = "March 6"
did patient 7073 undergo any procedures until 2104?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '2104'
What game did Eoin Holohan play in?
CREATE TABLE table_name_69 (game VARCHAR,player VARCHAR)
SELECT game FROM table_name_69 WHERE player = "eoin holohan"
Is SW 858 a must-take prerequisite for any other course ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement v...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'SW' AND COURSE_0.number = 858 AND COURSE_1.course_id = course_prerequisite.course_id
What is the December game that led to an 11-13-5 record?
CREATE TABLE table_name_9 (december INTEGER,record VARCHAR)
SELECT MAX(december) FROM table_name_9 WHERE record = "11-13-5"
What is run time when there were 7.4 million viewers?
CREATE TABLE table_72856 ("Episode" text,"Broadcast date" text,"Run time" text,"Viewers (in millions)" text,"Archive" text)
SELECT "Run time" FROM table_72856 WHERE "Viewers (in millions)" = '7.4'
Find the number of last names of teachers in alphabetical order of last name with a bar chart.
CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),student_id INTEGER,date_incident_start DATETIME,date_incident_end DATETIME,incident_summary VARCHAR(255),recommendations VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHA...
SELECT last_name, COUNT(last_name) FROM Teachers GROUP BY last_name ORDER BY last_name
What was the score on January 16, 2010?
CREATE TABLE table_66782 ("Outcome" text,"Date" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Score" FROM table_66782 WHERE "Date" = 'january 16, 2010'
how patient 012-18025 was admitted to the hospital since 2105 first?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intak...
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '012-18025' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime LIMIT 1
tell me the single released immediately before hey joe .
CREATE TABLE table_204_500 (id number,"year" number,"title" text,"peak chart positions\nus country" number,"peak chart positions\nus" number,"album" text)
SELECT "title" FROM table_204_500 WHERE id = (SELECT id FROM table_204_500 WHERE "title" = '"hey joe"') - 1
The Maserati 4cl's minimum no was?
CREATE TABLE table_21977627_1 (no INTEGER,chassis VARCHAR)
SELECT MIN(no) FROM table_21977627_1 WHERE chassis = "Maserati 4CL"
What are the home team scores when richmond is the home team?
CREATE TABLE table_20764 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_20764 WHERE "Home team" = 'Richmond'
Which position did the player hold that played for the Philadelphia Flyers in NHL?
CREATE TABLE table_19544 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Position" FROM table_19544 WHERE "NHL team" = 'Philadelphia Flyers'
what is the name of the next player after mark walsh ?
CREATE TABLE table_203_460 (id number,"player" text,"played" number,"legs won" number,"legs lost" number,"lwat" number,"100+" number,"140+" number,"180s" number,"high checkout" number,"3-dart average" number)
SELECT "player" FROM table_203_460 WHERE id = (SELECT id FROM table_203_460 WHERE "player" = 'mark walsh') + 1
Which audition city held callbacks at Amelia Island Plantation?
CREATE TABLE table_name_81 (audition_city VARCHAR,callback_venue VARCHAR)
SELECT audition_city FROM table_name_81 WHERE callback_venue = "amelia island plantation"
Finding Front End developers in Kochi and Trivandram.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)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 PostTypes (I...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (LOWER(Location) LIKE LOWER('%kochi%') OR LOWER(Location) L...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, show in asc by the y axis.
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 job_history (EMPLOYEE_ID decimal(6,0)...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY)
What is the method where there is a loss with time 5:00?
CREATE TABLE table_78397 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Method" FROM table_78397 WHERE "Res." = 'loss' AND "Time" = '5:00'
Who directed 'loathe and marriage'?
CREATE TABLE table_2563 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Directed by" FROM table_2563 WHERE "Title" = 'Loathe and Marriage'
How many times did an election feature the result robert l. leggett (d) 50.2% albert dehr (r) 49.8%?
CREATE TABLE table_18334 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT COUNT("Result") FROM table_18334 WHERE "Candidates" = 'Robert L. Leggett (D) 50.2% Albert Dehr (R) 49.8%'