instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
show first flight from PHILADELPHIA to DALLAS | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... |
what is the number of patients whose marital status is divorced and lab test name is cortisol? | 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 = "DIVORCED" AND lab.label = "Cortisol" |
how much is the difference in arterial bp [diastolic] of patient 11732 measured at 2103-05-26 23:00:00 compared to the value measured at 2103-05-26 17:00:00? | 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 (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11732)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'a... |
how many patients received antiemetic - serotonin antagonist within 2 months after having received oxygen therapy (> 60%) - non-rebreather mask? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (> 60%) - non-rebreather mask') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime... |
list the five most common diagnoses that were given to patients within 2 months after receiving hypotonic fluid administration - d5 half-normal saline this year. | 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 treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hypotonic fluid administration - d5 half... |
Alton Lister Category:Articles with hCards has what as the listed years? | CREATE TABLE table_name_56 (years VARCHAR,player VARCHAR) | SELECT years FROM table_name_56 WHERE player = "alton lister category:articles with hcards" |
On what date were the 1997 Bridgetown games in which a Martinique girl competed? | CREATE TABLE table_13471 ("Event" text,"Record" text,"Nationality" text,"Date" text,"Games" text) | SELECT "Date" FROM table_13471 WHERE "Nationality" = 'martinique' AND "Games" = '1997 bridgetown' |
Show my answers to R tag. Show my answers to R tag | 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 a.Score, a.Body, q.Tags, q.Title FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerUserId = '##UserId##' AND q.Tags LIKE '%<r>%' ORDER BY a.Score DESC |
For the days with the 3 largest maximum gust speeds, show me the frequency of their corresponding date in the weekdays level using a bar chart. | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f... | SELECT date, COUNT(date) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 |
Show different types of ships and the average tonnage of ships of each type. | CREATE TABLE ship (TYPE VARCHAR,Tonnage INTEGER) | SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE |
What is the date for the game 35? | CREATE TABLE table_27756314_8 (date VARCHAR,game VARCHAR) | SELECT date FROM table_27756314_8 WHERE game = 35 |
When waikaia is the electorate what is the highest by-election? | CREATE TABLE table_4144 ("By-election" real,"Electorate" text,"Date" text,"Incumbent" text,"Reason" text,"Winner" text) | SELECT MAX("By-election") FROM table_4144 WHERE "Electorate" = 'Waikaia' |
How many receptions for players with over 647 yards and an under 14 yard average? | CREATE TABLE table_name_83 (rec INTEGER,yards VARCHAR,avg VARCHAR) | SELECT MIN(rec) FROM table_name_83 WHERE yards > 647 AND avg < 14 |
specify the route of drug administration for phenylephrine | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Phenylephrine" |
Which Rank has a Silver larger than 1 and a Total larger than 13? | CREATE TABLE table_name_95 (rank VARCHAR,silver VARCHAR,total VARCHAR) | SELECT rank FROM table_name_95 WHERE silver > 1 AND total > 13 |
On November 1, 1964, where was the game site? | CREATE TABLE table_21914 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Game site" FROM table_21914 WHERE "Date" = 'November 1, 1964' |
How many clubs does number 6 play for? | CREATE TABLE table_12962773_15 (current_club VARCHAR,no VARCHAR) | SELECT COUNT(current_club) FROM table_12962773_15 WHERE no = 6 |
All answers by a specific user including tags. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,Cr... | SELECT a.Id AS "post_link", a.Score, q.Tags FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE (a.OwnerUserId = '##userid##') ORDER BY a.Id |
Golfer Steve Pate has what To par? | CREATE TABLE table_name_66 (to_par VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_66 WHERE player = "steve pate" |
what is the first flight after 800 from BOSTON to SAN FRANCISCO | CREATE TABLE month (month_number int,month_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,lengt... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 800 AND flight.to_airport = AIRPORT_SERVICE_1... |
Which Outcome has a Launch Date of march 18, 1964; 14:50 gmt? | CREATE TABLE table_57779 ("Rocket launch" text,"Launch Date" text,"Mission" text,"Institutional authority" text,"Launch Site" text,"Outcomes" text,"Derivatives" text) | SELECT "Outcomes" FROM table_57779 WHERE "Launch Date" = 'march 18, 1964; 14:50 gmt' |
what are the top four most frequent medications that followed during the same hospital visit for patients who were given intravenous diuretic - iv furosemide during this year? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'intravenous diu... |
What percentage of users were using Netscape during the period in which 21.67% were using Firefox? | CREATE TABLE table_13301 ("Period" text,"Internet Explorer" text,"Firefox" text,"Safari" text,"Opera" text,"Netscape" text,"Other Mozilla" text) | SELECT "Netscape" FROM table_13301 WHERE "Firefox" = '21.67%' |
In season 5 what episode number was production 06-03-519? | CREATE TABLE table_1954 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT COUNT("No. in season") FROM table_1954 WHERE "Production code" = '06-03-519' |
what is the number of patients with procedure icd9 code 4105 who died in or before 2180? | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.icd9_code = "4105" |
What is the fewest minutes played for the player with exactly 638 good passes? | CREATE TABLE table_28461589_2 (mins_played INTEGER,good_passes VARCHAR) | SELECT MIN(mins_played) FROM table_28461589_2 WHERE good_passes = 638 |
what is the highest points when position is higher than 6, lost is less than 12 and drawn is less than 1? | CREATE TABLE table_name_39 (points INTEGER,drawn VARCHAR,position VARCHAR,lost VARCHAR) | SELECT MAX(points) FROM table_name_39 WHERE position > 6 AND lost < 12 AND drawn < 1 |
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 time by a bar chart. | 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 locations (LOCATION_ID decimal(4,0),S... | 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) |
What time was the highest for 2nd finishers? | CREATE TABLE table_15884 ("Year" real,"Tournaments played" real,"Cuts made*" real,"Wins" real,"2nd" real,"Top 10s" real,"Best finish" text,"Earnings ($)" real,"Money list rank" text,"Scoring average" text,"Scoring rank" text) | SELECT MAX("2nd") FROM table_15884 |
what is the latitude of the feature of longitude 80.0e | CREATE TABLE table_16799784_7 (latitude VARCHAR,longitude VARCHAR) | SELECT latitude FROM table_16799784_7 WHERE longitude = "80.0E" |
find me the number of patients with the diagnoses of critical illness myopathy who have been hospitalized for more than 20 days. | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "20" AND diagnoses.short_title = "Critical illness myopthy" |
What is the Born-Died dates of Xhafer Bej Ypi? | CREATE TABLE table_47381 ("Name" text,"Born-Died" text,"Term start" text,"Term end" text,"Political Party" text) | SELECT "Born-Died" FROM table_47381 WHERE "Name" = 'xhafer bej ypi' |
What college has Lance Moore Category:articles with hcards? | CREATE TABLE table_59102 ("Original NFL team" text,"Player" text,"Pos." text,"College" text,"Conf." text) | SELECT "College" FROM table_59102 WHERE "Player" = 'lance moore category:articles with hcards' |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday by a bar chart, and could you sort by the Y-axis in ascending? | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) |
Which Opponent has a Method of submission? | CREATE TABLE table_14591 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Opponent" FROM table_14591 WHERE "Method" = 'submission' |
count the number of self pay insurance patients who have been admitted for more than 26 days in hospital. | 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 WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "26" |
Who won in 1927 | CREATE TABLE table_1342359_17 (incumbent VARCHAR,first_elected VARCHAR) | SELECT incumbent FROM table_1342359_17 WHERE first_elected = 1927 |
Name the italian voice actor for dirk fenselau | CREATE TABLE table_19726 ("Character" text,"French voice actor" text,"Italian voice actor" text,"German voice actor" text,"Spanish voice actor" text) | SELECT "Italian voice actor" FROM table_19726 WHERE "German voice actor" = 'Dirk Fenselau' |
Select * from Users where Location = 'india'. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE... | SELECT * FROM Users WHERE Location = 'india' |
What is the lowest game number on February 20? | CREATE TABLE table_name_69 (game INTEGER,date VARCHAR) | SELECT MIN(game) FROM table_name_69 WHERE date = "february 20" |
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID v... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
If graphics mode is less than 1.0, what are the char cells? | CREATE TABLE table_1974 ("Graphics mode" real,"Char cells" text,"Pixels" text,"Hardware colours" real,"used (KB)" real,"map" text,"Type" text) | SELECT "Char cells" FROM table_1974 WHERE "Graphics mode" < '1.0' |
What was the result when the time was 4:15? | CREATE TABLE table_name_66 (res VARCHAR,time VARCHAR) | SELECT res FROM table_name_66 WHERE time = "4:15" |
What is the score of the game where the record was 22-55? | CREATE TABLE table_name_7 (score VARCHAR,record VARCHAR) | SELECT score FROM table_name_7 WHERE record = "22-55" |
Find the names of all person sorted in the descending order using age. | CREATE TABLE Person (name VARCHAR,age VARCHAR) | SELECT name FROM Person ORDER BY age DESC |
i mean what was the first arterial bp mean for patient 1462 since 1247 days ago? | 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 chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1462)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b... |
what were the five most commonly given microbiology tests for patients that had previously received chest x-ray within 2 months the last year? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'chest x-ray' AND DATETIME(treatment.treatmen... |
What is the finish in 1956? | CREATE TABLE table_name_17 (finish VARCHAR,year VARCHAR) | SELECT finish FROM table_name_17 WHERE year = "1956" |
Which , if any , advisory prerequisites are there for Food and Drink of Asia ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE requirement (requirement_id int,requirement var... | SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Food and Drink of Asia%' |
What is the sum of the values for Melbourne, when Episode Number Production Number is 19 2-06, and when Sydney is less than 389,000? | CREATE TABLE table_name_93 (melbourne INTEGER,episode_number_production_number VARCHAR,sydney VARCHAR) | SELECT SUM(melbourne) FROM table_name_93 WHERE episode_number_production_number = "19 2-06" AND sydney < 389 OFFSET 000 |
How many different numbers of B shares does Handelsbanken fonder have? | CREATE TABLE table_23793 ("shareholder name" text,"A shares" real,"B shares" real,"% of capital" text,"% of votes" text) | SELECT COUNT("B shares") FROM table_23793 WHERE "shareholder name" = 'Handelsbanken fonder' |
In what TV season did the 3rd season air? | CREATE TABLE table_18761 ("Season" text,"Timeslot" text,"Season Premiere" text,"Season Finale" text,"Episodes" real,"TV Season" text,"Ranking" text,"Viewers (in millions)" text) | SELECT "TV Season" FROM table_18761 WHERE "Season" = '3rd' |
What is the bowling style of chris harris? | CREATE TABLE table_11950720_4 (bowling_style VARCHAR,player VARCHAR) | SELECT bowling_style FROM table_11950720_4 WHERE player = "Chris Harris" |
tell me the top three of the most common procedures this year? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid ... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 |
What was the original air date of series number 10? | CREATE TABLE table_name_20 (original_air_date INTEGER,series_number VARCHAR) | SELECT AVG(original_air_date) FROM table_name_20 WHERE series_number = 10 |
What series had Joan Tena in sixth place? | CREATE TABLE table_56632 ("Series" real,"Year" text,"Winner" text,"Runner-up" text,"Third place" text,"Fourth place" text,"Fifth place" text,"Sixth place" text,"Host" text) | SELECT SUM("Series") FROM table_56632 WHERE "Sixth place" = 'joan tena' |
What is the result for california 2? | CREATE TABLE table_1342338_6 (result VARCHAR,district VARCHAR) | SELECT result FROM table_1342338_6 WHERE district = "California 2" |
specify the death status of patients named paul edwards | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT demographic.expire_flag FROM demographic WHERE demographic.name = "Paul Edwards" |
How many were in attendance when the result was l 20-17? | CREATE TABLE table_name_42 (attendance VARCHAR,result VARCHAR) | SELECT attendance FROM table_name_42 WHERE result = "l 20-17" |
In which venue was North Melbourne the Away team? | CREATE TABLE table_name_14 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_14 WHERE away_team = "north melbourne" |
what is the number of patients with snf discharge who were admitted to hospital before 2154? | 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.discharge_location = "SNF" AND demographic.admityear < "2154" |
How many students live in each city? Show a bar chart, I want to rank by the bar in ascending. | CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1)... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code |
what were the top five most common diagnoses for patients of the 30s since 4 years ago? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE inputevents_cv (row_id number,subject_id num... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... |
What's the 102kg when the Ri Song-Hui was 226kg? | CREATE TABLE table_64355 ("World record" text,"Snatch" text,"Ri Song-Hui (PRK)" text,"102kg" text,"Busan,South Korea" text) | SELECT "102kg" FROM table_64355 WHERE "Ri Song-Hui ( PRK )" = '226kg' |
What date has ed as an actual title? | CREATE TABLE table_name_93 (date VARCHAR,actual_title VARCHAR) | SELECT date FROM table_name_93 WHERE actual_title = "ed" |
What is the Office when spencer c. young is on the liberal ticket?? | CREATE TABLE table_40327 ("Office" text,"Republican ticket" text,"Democratic ticket" text,"American Labor ticket" text,"Liberal ticket" text,"Communist ticket" text) | SELECT "Office" FROM table_40327 WHERE "Liberal ticket" = 'spencer c. young' |
What were the points for when there were 30 tries against? | CREATE TABLE table_810 ("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 "Points for" FROM table_810 WHERE "Tries against" = '30' |
Which Away Team has a Tie no of replay and a Home Team of Chesterfield? | CREATE TABLE table_50545 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Away team" FROM table_50545 WHERE "Tie no" = 'replay' AND "Home team" = 'chesterfield' |
Episode of 9 in which performer 3 had? | CREATE TABLE table_36205 ("Date" text,"Episode" real,"Performer 1" text,"Performer 2" text,"Performer 3" text,"Performer 4" text) | SELECT "Performer 3" FROM table_36205 WHERE "Episode" = '9' |
What is the largest total when the rank is 6 and there's less than 1 gold? | CREATE TABLE table_name_31 (total INTEGER,rank VARCHAR,gold VARCHAR) | SELECT MAX(total) FROM table_name_31 WHERE rank = "6" AND gold < 1 |
is there anything patient 69819 has had a diagnosis with until 2 years ago? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CRE... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69819) AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') |
how many patients are admitted under phys referral/normal delivery and discharge due to dead/expired? | 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 WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "DEAD/EXPIRED" |
how long did luis jesus take to finish in turin , italy in 1998 ? | CREATE TABLE table_204_98 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT "notes" FROM table_204_98 WHERE "year" = 1998 |
What is the design when quantity is 5,000,000? | CREATE TABLE table_25468520_1 (design VARCHAR,quantity VARCHAR) | SELECT design FROM table_25468520_1 WHERE quantity = "5,000,000" |
What was the original air date of episode number 1? | CREATE TABLE table_25597 ("No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text,"18-49 Rating/Share" text) | SELECT "Original air date" FROM table_25597 WHERE "No." = '1' |
Find the first names of the faculty members who are playing Canoeing or Kayaking. | CREATE TABLE Faculty (lname VARCHAR,facID VARCHAR)CREATE TABLE Faculty_participates_in (facID VARCHAR,actid VARCHAR)CREATE TABLE activity (activity_name VARCHAR) | SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' |
Group and count the durations for each actor with a bar graph. | CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text) | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration |
What was the time/retired of Darren Manning? | CREATE TABLE table_name_7 (time_retired VARCHAR,driver VARCHAR) | SELECT time_retired FROM table_name_7 WHERE driver = "darren manning" |
what is the daily minimum amount of chest tubes cticu ct 1 that patient 26057 had on this hospital encounter? | 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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE icustays (row_id number,subj... | SELECT MIN(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 = 26057 AND admissions.dischtime IS NULL)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d... |
What was the surface on march 2, 1997? | CREATE TABLE table_59073 ("Edition" text,"Round" text,"Date" text,"Partner" text,"Surface" text,"Opponents" text,"Result" text) | SELECT "Surface" FROM table_59073 WHERE "Date" = 'march 2, 1997' |
Given the titles of all courses, in order of titles and credits. | CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_min number,end_hr number,end_min number)CREATE TABLE advisor (s_id text,i_id text)CREATE TABLE instructor (id text,name text,dept_name text,salary number)CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TAB... | SELECT title FROM course ORDER BY title, credits |
Eduardo Martins is a customer at which company? | CREATE TABLE invoices (id number,customer_id number,invoice_date time,billing_address text,billing_city text,billing_state text,billing_country text,billing_postal_code text,total number)CREATE TABLE customers (id number,first_name text,last_name text,company text,address text,city text,state text,country text,postal_c... | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins" |
Who was the away team at Lake Oval? | CREATE TABLE table_name_68 (away_team VARCHAR,venue VARCHAR) | SELECT away_team AS score FROM table_name_68 WHERE venue = "lake oval" |
how many patients died in or before year 2180 had pituitary bleed as the primary disease? | 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 WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2180.0" |
How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, I want to order in descending by the y-axis. | CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major IN... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) DESC |
what was the name of the drug prescribed to patient 029-19659 within the same day after having been in 04/2104 diagnosed with acute respiratory failure - etiology unknown? | 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 t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-19659') AND diagnosis.diagnos... |
What defending forces have a population of 650? | CREATE TABLE table_8269 ("Name" text,"Date" text,"Defending forces" text,"Brigade" text,"Population" text) | SELECT "Defending forces" FROM table_8269 WHERE "Population" = '650' |
how much is patient 010-17316's weight for the first time since 21 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 treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17316') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-21 month') ORDER BY patient.unita... |
Which opponent's event was sb 24 - return of the heavyweights 2, and had a method of TKO (knee and punches)? | CREATE TABLE table_5166 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT "Opponent" FROM table_5166 WHERE "Event" = 'sb 24 - return of the heavyweights 2' AND "Method" = 'tko (knee and punches)' |
Top 50 users from New Zealand. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%zealand' ORDER BY Reputation DESC LIMIT 50 |
who was the first calder memorial trophy winner from the boston bruins ? | CREATE TABLE table_201_38 (id number,"season" text,"winner" text,"team" text,"position" text,"age" number) | SELECT "winner" FROM table_201_38 WHERE "team" = 'boston bruins' ORDER BY "season" LIMIT 1 |
What upper-level STRATEGY classes are offering this Spring ? | CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'STRATEGY' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sp... |
What is the largest population count in any of the census divisions in 2006? | CREATE TABLE table_2134521_1 (pop__2006_ INTEGER) | SELECT MAX(pop__2006_) FROM table_2134521_1 |
Smaller than 37, the highest year for Ford? | CREATE TABLE table_9101 ("Year" real,"Manufacturer" text,"Start" real,"Finish" real,"Team" text) | SELECT MAX("Year") FROM table_9101 WHERE "Manufacturer" = 'ford' AND "Finish" < '37' |
which country was ranked as the top in the 1999 all africa games ? | CREATE TABLE table_203_61 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_203_61 ORDER BY "rank" LIMIT 1 |
For artist names who are not from the United States, how many names in each year? | CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int) | SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Name |
who is the the candidates with incumbent being alfred j. elliott | CREATE TABLE table_18583 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_18583 WHERE "Incumbent" = 'Alfred J. Elliott' |
Questions sorted by Favorite count. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate t... | SELECT Questions.Id AS "post_link", Questions.Title, Questions.AnswerCount, Questions.ViewCount, Questions.FavoriteCount, Questions.Score, Questions.LastActivityDate FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER J... |
how many hours had passed since patient 016-18575 had been admitted to the icu? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '016-18575' AND patient.unitdischargetime IS NULL |
TeX.SX \\ corruption (grouped by id). | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostI... | SELECT COUNT(q.Body), q.OwnerUserId, q.OwnerDisplayName FROM Posts AS q WHERE (REPLACE(REPLACE(q.Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND q.OwnerUserId IN (SELECT p.OwnerUserId FROM Posts AS p WHERE (REPLACE(REPLACE(p.Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND q.AcceptedAnswerId != q.Id GROUP BY p.OwnerUserId... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.