instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Find the first names of faculties of rank Professor in alphabetic order. | CREATE TABLE FACULTY (Fname VARCHAR,Rank VARCHAR) | SELECT Fname FROM FACULTY WHERE Rank = "Professor" ORDER BY Fname |
Which Label has a Format of 7' single, and a Date of 1988? | CREATE TABLE table_35222 ("Date" text,"Label" text,"Region" text,"Format" text,"Catalog" text) | SELECT "Label" FROM table_35222 WHERE "Format" = '7" single' AND "Date" = '1988' |
Name the airport with IATA of cxb | CREATE TABLE table_68851 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "Airport" FROM table_68851 WHERE "IATA" = 'cxb' |
count the number of patients whose marital status is married and year of death is less than or equal to 2165? | 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.marital_status = "MARRIED" AND demographic.dod_year <= "2165.0" |
What district had someone first elected in 1982? | CREATE TABLE table_18213 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Status" text,"Opponent" text) | SELECT "District" FROM table_18213 WHERE "First elected" = '1982' |
has patient 12726 excreted chest tubes left pleural 1 today? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,... | SELECT COUNT(*) > 0 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 = 12726)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes le... |
What was the team's position in table when Danny OST was the outgoing manager? | CREATE TABLE table_29460 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT "Position in table" FROM table_29460 WHERE "Outgoing manager" = 'Danny Ost' |
When 3:41:20 is 3:34:14 what is cheboksary , russia? | CREATE TABLE table_73616 ("World record" text,"Denis Nizhegorodov (RUS)" text,"3:34:14" text,"Cheboksary,Russia" text,"11 May 2008" text) | SELECT "Cheboksary , Russia" FROM table_73616 WHERE "3:34:14" = '3:41:20' |
show me the fares on all flights round trip from PITTSBURGH to OAKLAND | 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_fare (flight_id int,fare_id int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,ba... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... |
Name the most year when population of woocoo is 2700 | CREATE TABLE table_12576536_1 (year INTEGER,population__woocoo_ VARCHAR) | SELECT MAX(year) FROM table_12576536_1 WHERE population__woocoo_ = 2700 |
What is the average gold of the winter athlete with 1 bronze, less than 3 silver, and less than 4 total medals? | CREATE TABLE table_75365 ("Athlete" text,"Sport" text,"Type" text,"Olympics" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Gold") FROM table_75365 WHERE "Bronze" = '1' AND "Type" = 'winter' AND "Silver" < '3' AND "Total" < '4' |
What is the lowest Laps that has a Year after 2002 with Alexander Frei Bruno Besson? | CREATE TABLE table_name_4 (laps INTEGER,year VARCHAR,co_drivers VARCHAR) | SELECT MIN(laps) FROM table_name_4 WHERE year > 2002 AND co_drivers = "alexander frei bruno besson" |
what was the the organism name found in the first pleural fluid test of patient 17398 until 40 months ago? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id ... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <=... |
Date of first questions 2017. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTyp... | SELECT DATE(Posts.CreationDate) AS asked, COUNT(1) AS questions FROM (SELECT MIN(Id) AS Id, OwnerUserId FROM Posts GROUP BY OwnerUserId) AS temp, Posts WHERE temp.Id = Posts.Id AND DATE(Posts.CreationDate) BETWEEN '01/01/2017' AND '01/01/2018' AND TIME_TO_STR(DATE(Posts.CreationDate), '%W') IN (2, 3, 4, 5, 6) GROUP BY ... |
topics used by Luke Zettlemoyer | CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE... | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Luke Zettlemoyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
What is the height of the building named 555 17th street? | CREATE TABLE table_name_77 (height_ft___m VARCHAR,name VARCHAR) | SELECT height_ft___m FROM table_name_77 WHERE name = "555 17th street" |
For the attribute other_details and the amount of other_details, show their proportion by a pie chart. | CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR(10),detention_type_description VARCHAR(80))CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),... | SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
Count the number of different software platforms. | CREATE TABLE shop (shop_id number,shop_name text,location text,open_date text,open_year number)CREATE TABLE stock (shop_id number,device_id number,quantity number)CREATE TABLE device (device_id number,device text,carrier text,package_version text,applications text,software_platform text) | SELECT COUNT(DISTINCT software_platform) FROM device |
If % mcconnell is 47.17% what is the total number of mcconnell ? | CREATE TABLE table_73 ("County" text,"Precincts" real,"Lunsford" real,"% Lunsford" text,"McConnell" real,"% McConnell" text,"Total" text) | SELECT COUNT("McConnell") FROM table_73 WHERE "% McConnell" = '47.17%' |
For those employees who did not have any job in the past, show me the trend about manager_id over hire_date with a line chart. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID ... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
List the status shared by more than two roller coaster. | CREATE TABLE roller_coaster (Status VARCHAR) | SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2 |
when did patient 80119 receive bicarbonate test the first time until 03/2105? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance tex... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80119) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-03' ORDER BY ... |
what is the number of patients whose diagnoses short title is dmi renl nt st uncntrld? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "DMI renl nt st uncntrld" |
Who is the Japanese voice actor of the Battle of the Planets of Keyop? | CREATE TABLE table_5642 ("Gatchaman" text,"Battle of the Planets" text,"G-Force" text,"Eagle Riders" text,"OVA (Harmony Gold Dub)" text,"Rank" text,"Bird Uniform" text,"Weapon" text,"Mecha" text,"Japanese voice actor" text,"Voice actor (BOTP)" text,"Voice actor (G-Force)" text,"Voice actor (Harmony Gold OVA Dub)" text,... | SELECT "Japanese voice actor" FROM table_5642 WHERE "Battle of the Planets" = 'keyop' |
Which GDP per capita (US$) (2004) is the highest one that has an Area (km ) larger than 148825.6, and a State of roraima? | CREATE TABLE table_name_37 (gdp_per_capita__us INTEGER,area__km²_ VARCHAR,state VARCHAR) | SELECT MAX(gdp_per_capita__us) AS $___2004_ FROM table_name_37 WHERE area__km²_ > 148825.6 AND state = "roraima" |
What team did the Wizards play against when their record was 2-5? | CREATE TABLE table_23274514_4 (team VARCHAR,record VARCHAR) | SELECT team FROM table_23274514_4 WHERE record = "2-5" |
What was the number of episodes whose production code is 7ABB21? | CREATE TABLE table_30382 ("\u2116" real,"#" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text) | SELECT COUNT("#") FROM table_30382 WHERE "Production code" = '7ABB21' |
who is the pole position for the rnd 3 | CREATE TABLE table_16749 ("Rnd" real,"Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text) | SELECT "Pole Position" FROM table_16749 WHERE "Rnd" = '3' |
how many patients this year have been diagnosed with drug overdose- general - with decreased mental status during the same month after receiving a ssri administration? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ssri administration' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'star... |
What is the Birth of the lady that has a Became Duchess on 18 august 1593 husband's accession? | CREATE TABLE table_6449 ("Birth" text,"Marriage" text,"Became Duchess" text,"Ceased to be Duchess" text,"Death" text,"Spouse" text) | SELECT "Birth" FROM table_6449 WHERE "Became Duchess" = '18 august 1593 husband''s accession' |
which Record has a Score of 1 4? | CREATE TABLE table_name_30 (record VARCHAR,score VARCHAR) | SELECT record FROM table_name_30 WHERE score = "1–4" |
Tags by number of views. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,... | SELECT t.TagName, SUM(p.ViewCount) AS Views, SUM(p.ViewCount) / COUNT(*) AS "avg_views" FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE t.Count > @TagThreshold GROUP BY t.TagName ORDER BY 'avg_views' DESC |
hba1c 6 _ 9 % | CREATE TABLE table_train_203 ("id" int,"gender" string,"perforation" bool,"hemoglobin_a1c_hba1c" float,"peptic_ulcer_disease" bool,"serum_c_peptide" float,"gastrointestinal_disease" bool,"serum_creatinine" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_203 WHERE hemoglobin_a1c_hba1c >= 6 AND hemoglobin_a1c_hba1c <= 9 |
when did patient 031-17834 receive a microbiology test on the first hospital encounter for the last time? | 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 cost (costid number,uniquepid text,patienthealthsystemstayid number,eventt... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
what is the percentile of 1.8 for a creatinine lab test given the same age as patient 021-79544 during the first hospital visit? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid n... | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'creatinine' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '021-79544' AND NOT pa... |
do you have one to DENVER from PHILADELPHIA | 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 int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal... | 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 = 'D... |
What was the away score for Carlton? | CREATE TABLE table_name_41 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_41 WHERE away_team = "carlton" |
What are the names of parties and their respective regions? | CREATE TABLE party_events (event_id number,event_name text,party_id number,member_in_charge_id number)CREATE TABLE region (region_id number,region_name text,date text,label text,format text,catalogue text)CREATE TABLE party (party_id number,minister text,took_office text,left_office text,region_id number,party_name tex... | SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id |
A bar chart shows the distribution of All_Games and School_ID , show in ascending by the bar. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games |
Find all types of store and number of them. | CREATE TABLE store (TYPE VARCHAR) | SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE |
What year was The Saber nominated for best action? | CREATE TABLE table_61041 ("Year" real,"Award" text,"Category" text,"Title of work" text,"Result" text) | SELECT AVG("Year") FROM table_61041 WHERE "Title of work" = 'saber' AND "Category" = 'best action' |
vsetci ktori maju viac ako 50 postov. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)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,Las... | SELECT Users.DisplayName, COUNT(Posts.OwnerUserId) AS PocPostov FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId GROUP BY DisplayName HAVING COUNT(Posts.OwnerUserId) > 5000 |
What's the series number of the episode with a broadcast order s04 e07? | CREATE TABLE table_1231892_4 (number_in_series INTEGER,broadcast_order VARCHAR) | SELECT MAX(number_in_series) FROM table_1231892_4 WHERE broadcast_order = "S04 E07" |
What is the ISBN of 'Dead as a Doornail? | CREATE TABLE table_16907214_1 (paperback VARCHAR,title VARCHAR) | SELECT paperback FROM table_16907214_1 WHERE title = "Dead as a Doornail" |
What did the home team when they played Richmond? | CREATE TABLE table_name_48 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team AS score FROM table_name_48 WHERE away_team = "richmond" |
What home team played at the western oval? | CREATE TABLE table_32739 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_32739 WHERE "Venue" = 'western oval' |
What is the specification where senior high school is 25mm? | CREATE TABLE table_18813 ("Specification" text,"Gender" text,"Junior High School (12\u201315 yrs)" text,"Senior High School (15\u201318 yrs)" text,"University students and Adults (18yrs+)" text) | SELECT "Specification" FROM table_18813 WHERE "Senior High School (15\u201318 yrs)" = '25mm' |
What's the green communist when Euroteste/JN is the polling Institute? | CREATE TABLE table_65646 ("Date Released" text,"Polling institute" text,"Social Democratic" text,"Socialist" text,"Green-Communist" text,"Democratic and Social Centre" text,"Lead" text) | SELECT "Green-Communist" FROM table_65646 WHERE "Polling institute" = 'euroteste/jn' |
give me the total amount of wound vac #1 that patient 92788 produces since 06/28/2104. | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text... | 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 outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'wou... |
Top editors in a given period (excluding title/tag-only edits). | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)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,LastEditorDisplayN... | SELECT ph.UserId AS "user_link", COUNT(DISTINCT RevisionGUID) AS "count" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 5 AND (ph.CreationDate >= '##Date1?2018-01-01##') AND (ph.CreationDate <= '##Date2?2018-12-31##') GROUP BY ph.UserId ORDER BY 'count' DESC LIMIT 100 |
What was the opponent on December 16, 1989? | CREATE TABLE table_name_14 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_14 WHERE date = "december 16, 1989" |
What is the most recent release date? | CREATE TABLE table_1467951_4 (release_date INTEGER) | SELECT MAX(release_date) FROM table_1467951_4 |
What was Fredrik Jacobson's score? | CREATE TABLE table_61315 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "Score" FROM table_61315 WHERE "Player" = 'fredrik jacobson' |
provide the number of patients whose days of hospital stay is greater than 43 and procedure short title is aortocor bypas-2 cor art? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "43" AND procedures.short_title = "Aortocor bypas-2 cor art" |
WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME/RETIRED? | CREATE TABLE table_name_44 (manufacturer VARCHAR,laps VARCHAR,time_retired VARCHAR) | SELECT manufacturer FROM table_name_44 WHERE laps = "24" AND time_retired = "+1.965" |
What was the session at the circuit of autodrom most? | CREATE TABLE table_name_95 (session VARCHAR,circuit VARCHAR) | SELECT session FROM table_name_95 WHERE circuit = "autodrom most" |
when was the last arterial bp [diastolic] of patient 25814 measured on this month/28? | 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttim... | SELECT chartevents.charttime 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 = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... |
Which Nation has a Second of tomas pitonak? | CREATE TABLE table_name_72 (nation VARCHAR,second VARCHAR) | SELECT nation FROM table_name_72 WHERE second = "tomas pitonak" |
How big was the crowd in a game that had the home team score 18.19 (127)? | CREATE TABLE table_52088 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT COUNT("Crowd") FROM table_52088 WHERE "Home team score" = '18.19 (127)' |
What is the Theme with a Paper Type of tullis russell coatings, and a Date with Issue of 1 october 2008? | CREATE TABLE table_57517 ("Date of Issue" text,"Theme" text,"Design" text,"Illustration" text,"Paper Type" text,"First Day Cover Cancellation" text) | SELECT "Theme" FROM table_57517 WHERE "Paper Type" = 'tullis russell coatings' AND "Date of Issue" = '1 october 2008' |
among patients who had a lab test of other fluid, how many of them were from white ethnic origin? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.label = "RBC, Other Fluid" |
How long did Joyce Jacobs portray her character on her show? | CREATE TABLE table_79213 ("Actor" text,"Character" text,"Soap Opera" text,"Years" text,"Duration" text) | SELECT "Duration" FROM table_79213 WHERE "Actor" = 'joyce jacobs' |
What is the sum of points values that are associated with 0 losses and more than 8 games? | CREATE TABLE table_name_67 (points INTEGER,lost VARCHAR,games VARCHAR) | SELECT SUM(points) FROM table_name_67 WHERE lost = 0 AND games > 8 |
Which margin of victory has cyber agent ladies as the tournament? | CREATE TABLE table_41542 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Margin of victory" FROM table_41542 WHERE "Tournament" = 'cyber agent ladies' |
i live in DENVER and i'd like to make a trip to PITTSBURGH | CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE date_day (month_number int,day_numbe... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... |
What is week 4 if week 3 is 35.40? | CREATE TABLE table_59382 ("Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text,"Week 6" text,"Week 7" text) | SELECT "Week 4" FROM table_59382 WHERE "Week 3" = '35.40' |
What is the name of the player that is pick #69? | CREATE TABLE table_70180 ("Pick #" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Player" FROM table_70180 WHERE "Pick #" = '69' |
Who is the forward from Grambling State? | CREATE TABLE table_58141 ("Player" text,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT "Player" FROM table_58141 WHERE "Position" = 'forward' AND "School/Club Team" = 'grambling state' |
how many total seasons are given in the chart ? | CREATE TABLE table_204_985 (id number,"season" text,"competition" text,"round" text,"club" text,"home" text,"away" text,"aggregate" text) | SELECT COUNT("season") FROM table_204_985 |
what's the party with candidates being silvio conte (r) unopposed | CREATE TABLE table_18291 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Party" FROM table_18291 WHERE "Candidates" = 'Silvio Conte (R) Unopposed' |
How many production codes are there for episode number 45? | CREATE TABLE table_28250 ("No." real,"#" real,"Title" text,"Director" text,"Writer(s)" text,"Original air date" text,"Prod. code" real,"U.S. viewers (million)" text) | SELECT COUNT("Prod. code") FROM table_28250 WHERE "No." = '45' |
When the # is 4, what is the pop./ km ? | CREATE TABLE table_25114 ("#" real,"Name" text,"Name (English)" text,"Population 2008-07-01" real,"Area (km\u00b2)" real,"Pop./ km\u00b2" text,"ISO 3166-2" text,"Administrative centre" text) | SELECT "Pop./ km\u00b2" FROM table_25114 WHERE "#" = '4' |
What was the genre of Queen (an artist from the United Kingdom)? | CREATE TABLE table_name_47 (genre VARCHAR,country_of_origin VARCHAR,artist VARCHAR) | SELECT genre FROM table_name_47 WHERE country_of_origin = "united kingdom" AND artist = "queen" |
count the number of patients whose gender is f and discharge location is disch-tran to psych hosp? | 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.gender = "F" AND demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" |
what are the four most commonly given lab tests since 2104 for patients who were previously diagnosed with lower gi bleeding - diverticular during the same month? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'lower gi bleeding - diverticular' AND STRFTIME('%y',... |
What is Site, when Opponent is 'All times are in eastern.'? | CREATE TABLE table_9383 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Site" FROM table_9383 WHERE "Opponent" = 'all times are in eastern.' |
What is the age of student Linda Smith? | CREATE TABLE Student (Age VARCHAR,Fname VARCHAR,Lname VARCHAR) | SELECT Age FROM Student WHERE Fname = "Linda" AND Lname = "Smith" |
What was the highest total when Norrkoping scored 12? | CREATE TABLE table_name_21 (total INTEGER,norrköping VARCHAR) | SELECT MAX(total) FROM table_name_21 WHERE norrköping = "12" |
What is the first and last name of the students who are not in the largest major?, order by the Y-axis from high to low. | CREATE TABLE Has_amenity (dormid INTEGER,amenid 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 Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_nam... | SELECT Fname, COUNT(Fname) FROM Student WHERE Major <> (SELECT Major FROM Student) GROUP BY Fname ORDER BY COUNT(Fname) DESC |
What is the lowest population in which 28.0% are democrat? | CREATE TABLE table_29236 ("City" text,"Population" real,"Registered voters" text,"Democratic" text,"Republican" text,"D\u2013R spread" text,"Other" text,"No party preference" text) | SELECT MIN("Population") FROM table_29236 WHERE "Democratic" = '28.0%' |
Who was eliminated on Banana Night? | CREATE TABLE table_45201 ("Name" text,"Category" text,"Eliminated" text,"Date" text,"Special Guest" text) | SELECT "Name" FROM table_45201 WHERE "Eliminated" = 'banana night' |
how many hours have passed since patient 022-6959 had an admission to the hospital? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '022-6959' AND patient.hospitaldischargetime IS NULL |
What was the latest episode number that Meredith Averill wrote? | CREATE TABLE table_28561455_1 (no_in_series INTEGER,written_by VARCHAR) | SELECT MAX(no_in_series) FROM table_28561455_1 WHERE written_by = "Meredith Averill" |
When the Attendance was 4,516, what was the Record? | CREATE TABLE table_54491 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Record" FROM table_54491 WHERE "Attendance" = '4,516' |
Which Points have an Attendance of 21,273, and a Record of 5 1 1? | CREATE TABLE table_50040 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text,"Points" real) | SELECT MIN("Points") FROM table_50040 WHERE "Attendance" = '21,273' AND "Record" = '5–1–1' |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of employee_id bin hire_date by time. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME va... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
Tell me the stages for 1981 | CREATE TABLE table_name_42 (stages VARCHAR,year VARCHAR) | SELECT stages FROM table_name_42 WHERE year = 1981 |
What is the 2nd leg when Ermis Aradippou is the first team? | CREATE TABLE table_name_50 (team_1 VARCHAR) | SELECT 2 AS nd_leg FROM table_name_50 WHERE team_1 = "ermis aradippou" |
What school does Kerry Wood play for? | CREATE TABLE table_17048 ("Player" text,"Position" text,"School" text,"Hometown" text,"MLB Draft" text) | SELECT "School" FROM table_17048 WHERE "Player" = 'Kerry Wood' |
how much does it cost patient 95892's hospital stay in the current hospital visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,di... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admissions.dischtime IS NULL) |
Find the id of the courses that do not have any prerequisite? | CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE takes (id text,course_id text,sec_id text,semester text,year number,grade text)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,... | SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq |
Show the number of the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000, could you display by the how many date of transaction in ascending? | CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Investors (investor_id INTEGER,Inv... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000 ORDER BY COUNT(date_of_transaction) |
systolic blood pressure < 100 mmhg | CREATE TABLE table_test_17 ("id" int,"anemia" bool,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"active_infection" bool,"fever" bool,"bradycardia" int,"renal_disease" bool,"oliguria" bool,"creatinine_clearance_cl" float,"left_ventricular_failure" bool,"hgb" int,"platelet_count" float,... | SELECT * FROM table_test_17 WHERE systolic_blood_pressure_sbp < 100 |
What year did he compete in the car class and win 0 stages? | CREATE TABLE table_name_59 (year VARCHAR,class VARCHAR,stages_won VARCHAR) | SELECT year FROM table_name_59 WHERE class = "car" AND stages_won = "0" |
when the last time patient 3712 was prescribed a medicine via oral route in the last hospital visit? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3712 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'oral' ORDER BY prescriptions.startdate DESC LIMIT 1 |
Eric Lippert's comments about precedence. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT * FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id WHERE UserId = 88656 AND Body LIKE '%precedence%' ORDER BY Comments.CreationDate DESC |
when was the first time that patient 5544 had maximum phosphate value in 04/this year? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_labitems (r... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5544) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURREN... |
i would like to fly from ATLANTA to PHILADELPHIA | CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... |
Who tied for highest rebounds in game 29? | CREATE TABLE table_23285849_6 (high_rebounds VARCHAR,game VARCHAR) | SELECT high_rebounds FROM table_23285849_6 WHERE game = 29 |
Playing against Chelmsford City on 15 November 1986, who was the home team? | CREATE TABLE table_name_6 (home_team VARCHAR,date VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_6 WHERE date = "15 november 1986" AND away_team = "chelmsford city" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.