instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Who drove the grid 10 car? | CREATE TABLE table_name_3 (driver VARCHAR,grid VARCHAR) | SELECT driver FROM table_name_3 WHERE grid = 10 |
Draw a bar chart of manager name versus how many manager name, I want to sort how many manager name in desc order. | CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABL... | SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) DESC |
what is games when the losses is more than 1, percent is 0.5 and wins is 2? | CREATE TABLE table_61524 ("Quarterback" text,"Games" real,"Teams" text,"Wins" real,"Losses" real,"Percent" real) | SELECT "Games" FROM table_61524 WHERE "Losses" > '1' AND "Percent" = '0.5' AND "Wins" = '2' |
What's the mean week number for November 12, 1978? | CREATE TABLE table_name_9 (week INTEGER,date VARCHAR) | SELECT AVG(week) FROM table_name_9 WHERE date = "november 12, 1978" |
provide the number of patients whose lab test chart time is 2137-08-30 14:39:00. | 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 lab.charttime = "2137-08-30 14:39:00" |
what are the three most frequently prescribed drugs that patients were prescribed within 2 months after having received a contrast arteriogram-leg procedure until 1 year ago? | 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 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 ... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... |
If length is ft (m) with numbers of 6600-6684 (84 buses) for 2003, what is the engine type? | CREATE TABLE table_55002 ("Year" text,"Make & Model" text,"Length" text,"Engine Type" text,"Numbers" text) | SELECT "Engine Type" FROM table_55002 WHERE "Length" = 'ft (m)' AND "Year" = '2003' AND "Numbers" = '6600-6684 (84 buses)' |
Which player from the Ironi Nahariya club was born in 1980? | CREATE TABLE table_name_4 (player VARCHAR,current_club VARCHAR,year_born VARCHAR) | SELECT player FROM table_name_4 WHERE current_club = "ironi nahariya" AND year_born = 1980 |
What is the largest crowd that has the away side scoring 10.14 (74)? | CREATE TABLE table_33575 ("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_33575 WHERE "Away team score" = '10.14 (74)' |
What are the ids and details of events that have more than one participants. Visualize by bar chart. | CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Ser... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details |
when they visited the hospital last time was acetaminophen (tylenol) tab 650 mg prescribed to patient 030-28944? | 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 microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultur... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-28944' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... |
What is the attendance in texas stadium? | CREATE TABLE table_37516 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Attendance" real) | SELECT SUM("Attendance") FROM table_37516 WHERE "Venue" = 'texas stadium' |
Name the played with losing bonus of 3 and points against of 426 | CREATE TABLE table_6333 ("Club" text,"Played" 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 "Played" FROM table_6333 WHERE "Losing bonus" = '3' AND "Points against" = '426' |
What player represented Vista Murrieta High School? | CREATE TABLE table_11677691_10 (player VARCHAR,school VARCHAR) | SELECT player FROM table_11677691_10 WHERE school = "Vista Murrieta High school" |
How many times is the couple laura and colin? | CREATE TABLE table_31255 ("Rank by average" real,"Place" real,"Couple" text,"Total points" text,"Number of dances" real,"Average" text) | SELECT COUNT("Place") FROM table_31255 WHERE "Couple" = 'Laura and Colin' |
What is the 2nd round with a score of 3 - 3, and a team 2 fc lorient (d2)? | CREATE TABLE table_name_60 (score VARCHAR,team_2 VARCHAR) | SELECT 2 AS nd_round FROM table_name_60 WHERE score = "3 - 3" AND team_2 = "fc lorient (d2)" |
what year is chris mcnamara? | CREATE TABLE table_29598261_1 (year VARCHAR,name VARCHAR) | SELECT year FROM table_29598261_1 WHERE name = "Chris McNamara" |
What's the total power of the unit whose construction finished on 14.06.1963? | CREATE TABLE table_17900 ("Unit" text,"Type" text,"Net power" text,"Total power" text,"Construction start" text,"Construction finish" text,"Commercial operation" text,"Shut down" text) | SELECT "Total power" FROM table_17900 WHERE "Construction finish" = '14.06.1963' |
Potential collisions between tag badges and regular badges. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Sco... | SELECT t.TagName, t.Count FROM Badges AS b INNER JOIN Tags AS t ON LOWER(b.Name) = REPLACE(t.TagName, '-', ' ') WHERE b.TagBased = 0 GROUP BY t.TagName, t.Count ORDER BY t.Count DESC |
Who is the race caller when jim mckay and al michaels were s hosts in the year 1987? | CREATE TABLE table_22514845_4 (race_caller VARCHAR,s_host VARCHAR,year VARCHAR) | SELECT race_caller FROM table_22514845_4 WHERE s_host = "Jim McKay and Al Michaels" AND year = 1987 |
What is the Delivered as name of the H3 Locomotive? | CREATE TABLE table_name_64 (delivered_as VARCHAR,locomotive VARCHAR) | SELECT delivered_as FROM table_name_64 WHERE locomotive = "h3" |
Questions post by users in the given list. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTyp... | SELECT Id AS "post_link", OwnerDisplayName, CreationDate, Score, Tags FROM Posts WHERE PostTypeId = 1 AND OwnerDisplayName IN ('##list##') ORDER BY Id DESC |
count the number of patients who have received a pulmonary/ccm consultation procedure in the same month after they had been diagnosed with diabetes mellitus - type ii. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus - type ii') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment J... |
Who was Bob Bryan's partner/s on a hard surface in 2003? | CREATE TABLE table_4183 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Partner" FROM table_4183 WHERE "Year" = '2003' AND "Surface" = 'Hard' |
what is the number of patients admitted before 2131 due to ruq pain? | 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 = "RUQ PAIN" AND demographic.admityear < "2131" |
Name the number of party for new york 29 | CREATE TABLE table_18112 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT COUNT("Party") FROM table_18112 WHERE "District" = 'New York 29' |
For the 1967 Cleveland Browns season what is the total number of times they played the Minnesota Vikings and had an atttendance smaller than 68,431? | CREATE TABLE table_name_93 (week VARCHAR,opponent VARCHAR,attendance VARCHAR) | SELECT COUNT(week) FROM table_name_93 WHERE opponent = "minnesota vikings" AND attendance < 68 OFFSET 431 |
What Utah Jazz Forward played for Southern Methodist? | CREATE TABLE table_name_74 (player VARCHAR,position VARCHAR,school_club_team VARCHAR) | SELECT player FROM table_name_74 WHERE position = "forward" AND school_club_team = "southern methodist" |
recreate TAGS field, REPLACING [EXCEL-VBA] with [EXCEL]+[VBA] *where applicable. 271974 answers to 203085 questions, have at least one of the 3 tags | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREA... | SELECT COUNT(*) FROM Posts AS q WHERE (q.Tags LIKE '%<vba>%' OR q.Tags LIKE '%<excel>%' OR q.Tags LIKE '%<excel-vba>%') AND PostTypeId = 1 |
what was the last game to be attended by fewer than 30,000 people ? | CREATE TABLE table_204_917 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text,"attendance" number) | SELECT "date" FROM table_204_917 WHERE "attendance" < 30000 |
What are the miles when the Carvill Hurricane Index (CHI) is equal to 9.9? | CREATE TABLE table_20069 ("Name" text,"Year" real,"Landfall" text,"NHC Advisory Number" text,"V(mph)" real,"R(miles)" real,"Saffir-Simpson Category" real,"CHI" text) | SELECT "R(miles)" FROM table_20069 WHERE "CHI" = '9.9' |
What is the title of the single with the peak position of 10 and from France? | CREATE TABLE table_name_21 (title VARCHAR,peak_position VARCHAR,country VARCHAR) | SELECT title FROM table_name_21 WHERE peak_position = 10 AND country = "france" |
What is the field of the game on July 22? | CREATE TABLE table_name_7 (field VARCHAR,date VARCHAR) | SELECT field FROM table_name_7 WHERE date = "july 22" |
What is the highest number drawn when the position was 12? | CREATE TABLE table_43781 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text) | SELECT MAX("Drawn") FROM table_43781 WHERE "Position" = '12' |
for how many teams was the win percentage below 90 % | CREATE TABLE table_203_506 (id number,"opponent" text,"played" number,"won" number,"lost" number,"drawn" number,"% won overall" text) | SELECT COUNT("opponent") FROM table_203_506 WHERE "% won overall" < 90 |
What is the average year of entries with additional color black? | CREATE TABLE table_name_9 (year INTEGER,additional_colour_s_ VARCHAR) | SELECT AVG(year) FROM table_name_9 WHERE additional_colour_s_ = "black" |
How many patients of black/cape verdean ethnicity are diagnosed with the primary disease st elevated myocardial infarction/cardiac cath? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" |
Which date has an A venue with an Opponent of stoke city? | CREATE TABLE table_67657 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Scorers" text) | SELECT "Date" FROM table_67657 WHERE "Venue" = 'a' AND "Opponent" = 'stoke city' |
Which Top Speed has a Model Name of d14/4 supreme d14/4 sports & bushman? | CREATE TABLE table_name_69 (top_speed VARCHAR,model_name VARCHAR) | SELECT top_speed FROM table_name_69 WHERE model_name = "d14/4 supreme d14/4 sports & bushman" |
What was the final score of Washington's home game? | CREATE TABLE table_30472 ("Date" text,"Time" text,"Visiting team" text,"Home team" text,"Site" text,"Broadcast" text,"Result" text,"Attendance" real) | SELECT "Result" FROM table_30472 WHERE "Home team" = 'Washington' |
which nation came before spain ? | CREATE TABLE table_203_160 (id number,"rank" number,"heat" number,"nation" text,"competitors" text,"time" text,"notes" text) | SELECT "nation" FROM table_203_160 WHERE "rank" = (SELECT "rank" FROM table_203_160 WHERE "nation" = 'spain') - 1 |
What is the number for the french open 1974? | CREATE TABLE table_197638_7 (_number INTEGER,french_open VARCHAR) | SELECT MAX(_number) FROM table_197638_7 WHERE french_open = 1974 |
What are the ids of all students along with how many sports and games did they play? | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE plays_games (stuid number,gameid number,hours_played number)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE vid... | SELECT stuid, COUNT(*), SUM(gamesplayed) FROM sportsinfo GROUP BY stuid |
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and list from high to low by the Y. | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC |
Which week 2 had a week 3 of Cidney Carson? | CREATE TABLE table_12189 ("Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text) | SELECT "Week 2" FROM table_12189 WHERE "Week 3" = 'cidney carson' |
Which L2-Cache has a Frequency of 1333 mhz, and a Model Number of c3 1.3a? | CREATE TABLE table_8839 ("Model Number" text,"Frequency" text,"L2-Cache" text,"Front Side Bus" text,"Multiplier" text,"Voltage" text,"Socket" text) | SELECT "L2-Cache" FROM table_8839 WHERE "Frequency" = '1333 mhz' AND "Model Number" = 'c3 1.3a' |
What is the average Points when the engine was a climax straight-4 earlier than 1958? | CREATE TABLE table_name_4 (points INTEGER,engine VARCHAR,year VARCHAR) | SELECT AVG(points) FROM table_name_4 WHERE engine = "climax straight-4" AND year < 1958 |
Which location has 103.534 million passengers in 2011-12? | CREATE TABLE table_72963 ("Rank" real,"Railway Station" text,"Annual entry/exit (millions) 2011\u201312" text,"Annual interchanges (millions) 2011\u201312" text,"Total Passengers (millions) 2011\u201312" text,"Location" text,"Main Services" text,"Number of Platforms" real) | SELECT "Location" FROM table_72963 WHERE "Total Passengers (millions) 2011\u201312" = '103.534' |
is score can be negative. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId nu... | SELECT MAX(Score) FROM Posts WHERE PostTypeId = 1 |
What was the lowest Attendance for Games played on the Date of February 5? | CREATE TABLE table_52447 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT MIN("Attendance") FROM table_52447 WHERE "Date" = 'february 5' |
Title and Body of 5 tags. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,... | SELECT p.Body, 'swing', p.Title FROM Posts AS p, PostTags AS pt, Tags AS t WHERE p.CreationDate < '2014-03-01' AND pt.PostId = p.Id AND pt.TagId = t.Id AND t.TagName = 'swing' LIMIT 50000 |
What year was Luis Gutierrez election | CREATE TABLE table_1341423_13 (first_elected INTEGER,incumbent VARCHAR) | SELECT MIN(first_elected) FROM table_1341423_13 WHERE incumbent = "Luis Gutierrez" |
What was the TNS-Sofres when the Iflop was 5%? | CREATE TABLE table_55580 ("Party" text,"Results 2004" text,"CSA 5/28/09" text,"Ifop 5/30/09" text,"Ipsos 5/30/09" text,"BVA 6/1/09" text,"TNS-Sofres 6/2/09" text,"OpinionWay 6/3/09" text,"Ipsos 6/3/09" text,"TNS-Sofres 6/4/09" text,"CSA 6/4/09" text,"Ifop 6/4/09" text) | SELECT "TNS-Sofres 6/2/09" FROM table_55580 WHERE "Ifop 5/30/09" = '5%' |
Name the points with chassis of march 751 | CREATE TABLE table_15125 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Points" FROM table_15125 WHERE "Chassis" = 'march 751' |
Which ERP W is the lowest one that has a Frequency MHz of 91.3? | CREATE TABLE table_37894 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT MIN("ERP W") FROM table_37894 WHERE "Frequency MHz" = '91.3' |
Give me the comparison about ACC_Percent over the ACC_Regular_Season , sort by the ACC_Percent in ascending. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent |
What is the score for 4-1? | CREATE TABLE table_13201 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Score" FROM table_13201 WHERE "Record" = '4-1' |
How many points against when 41 is the tries for? | CREATE TABLE table_46096 ("Club" text,"Played" 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 against" FROM table_46096 WHERE "Tries for" = '41' |
Tell me the average goals with apps less than 3 | CREATE TABLE table_name_16 (goals INTEGER,apps INTEGER) | SELECT AVG(goals) FROM table_name_16 WHERE apps < 3 |
What is the score of the game with an 11-32-11 record? | CREATE TABLE table_55388 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Score" FROM table_55388 WHERE "Record" = '11-32-11' |
Who is the 2005 World AIDS Day Benefit 'Dream' Cast when the Original Australian performer is Susan-Ann Walker? | CREATE TABLE table_22753 ("Character" text,"Original Broadway performer" text,"Original Australian performer" text,"Original West End performer" text,"2005 World AIDS Day Benefit Dream Cast" text) | SELECT "2005 World AIDS Day Benefit Dream Cast" FROM table_22753 WHERE "Original Australian performer" = 'Susan-Ann Walker' |
uncontrolled hypertension | CREATE TABLE table_dev_9 ("id" int,"heart_disease" bool,"hba1c" float,"coronary_artery_disease_cad" bool,"triglyceride_tg" float,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_dev_9 WHERE hypertension = 1 |
when did patient 015-21757 first have maximum sao2 on 11/18/last year? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-21757')) AND NOT vitalperiodic.sao2 IS NULL AND... |
papers by steve seitz | CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paper... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'steve seitz' AND writes.authorid = author.authorid |
What's the termini of the route with junctions of i-35 fm 3338 sh 255? | CREATE TABLE table_56686 ("Route Name" text,"Direction" text,"Termini" text,"Junctions" text,"Length" text,"Population Area" text) | SELECT "Termini" FROM table_56686 WHERE "Junctions" = 'i-35 fm 3338 sh 255' |
Name the Wins which has Points smaller than 10, Losses smaller than 3, and a Scored of 11? | CREATE TABLE table_45252 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Bonus Points" text,"Points" real) | SELECT MIN("Wins") FROM table_45252 WHERE "Points" < '10' AND "Losses" < '3' AND "Scored" = '11' |
how many of the patients discharged-transfer to psych hospital had endosc inser stent bile | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Endosc inser stent bile" |
A bar chart showing the number of start date of the apartment bookings made by female guests (gender code 'Female') for each weekday. | CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,room_count CHAR(5))CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartment_Bookings (apt_booking_i... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" |
is morris s. arnold above or below maryanne trump barry in in the list ? | CREATE TABLE table_203_572 (id number,"judge" text,"court" text,"began active\nservice" text,"ended active\nservice" text,"ended senior\nstatus" text) | SELECT (SELECT id FROM table_203_572 WHERE "judge" = 'morris s. arnold') < (SELECT id FROM table_203_572 WHERE "judge" = 'maryanne trump barry') |
What label has brol 34531 as it's catalogue? | CREATE TABLE table_71782 ("Date" text,"Region" text,"Label" text,"Catalogue" text,"Format" text) | SELECT "Label" FROM table_71782 WHERE "Catalogue" = 'brol 34531' |
Who was the man of the match when they lost 2-4? | CREATE TABLE table_21357 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text,"Man of the Match" text) | SELECT "Man of the Match" FROM table_21357 WHERE "Result" = 'Lost 2-4' |
what is the tournament when the performance in 2012 is 3r and 2011 is qf? | CREATE TABLE table_15069 ("Tournament" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "Tournament" FROM table_15069 WHERE "2012" = '3r' AND "2011" = 'qf' |
How many different types are allocated to the institution in Bridgewater, Massachusetts? | CREATE TABLE table_3495 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" text,"Nickname" text,"Joined" text,"Left" text,"Football Conference" text,"Primary Conference" text) | SELECT COUNT("Type") FROM table_3495 WHERE "Location" = 'Bridgewater, Massachusetts' |
What is the Until date associated with a beginning From date of July 5, 2007? | CREATE TABLE table_71013 ("From" text,"Until" text,"Name" text,"Party" text,"Function" text) | SELECT "Until" FROM table_71013 WHERE "From" = 'july 5, 2007' |
among the patients of the age 60 or above since 2102, what is the top four prescribed drugs? | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND STRFTIME('%y', prescriptions.startdate) >= '2102' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <... |
Of the Hist Urb Form courses , which are the ones which satisfy the MDE requirement ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varc... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Hist Urb Form%' OR course.description LIKE '%Hist Urb Form%' OR course.name LIKE '%Hist Urb Form... |
Name the power provided where transfer speed mb/s is 300 and max cable length of 10 | CREATE TABLE table_174151_5 (power_provided VARCHAR,transfer_speed__mb_s_ VARCHAR,max_cable_length__m_ VARCHAR) | SELECT power_provided FROM table_174151_5 WHERE transfer_speed__mb_s_ = "300" AND max_cable_length__m_ = "10" |
what was the total amount of input that patient 15794 got during the previous day? | 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE patients (row_... | 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 = 15794)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), ... |
How many clubs were founded in belo horizonte? | CREATE TABLE table_26218124_1 (founded VARCHAR,city VARCHAR) | SELECT COUNT(founded) FROM table_26218124_1 WHERE city = "Belo Horizonte" |
What are the different years for all competitions that are not of type equal to tournament? | CREATE TABLE competition_result (competition_id number,club_id_1 number,club_id_2 number,score text)CREATE TABLE club (club_id number,name text,region text,start_year text)CREATE TABLE competition (competition_id number,year number,competition_type text,country text)CREATE TABLE player (player_id number,name text,posit... | SELECT DISTINCT year FROM competition WHERE competition_type <> "Tournament" |
What is the year in which most ships were built? | CREATE TABLE ship (ship_id number,name text,type text,built_year number,class text,flag text)CREATE TABLE captain (captain_id number,name text,ship_id number,age text,class text,rank text) | SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1 |
has there been any organism found in the last tissue microbiology test of patient 47460 in 08/this year? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (row_id nu... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47460) AND microbiologyevents.spec_type_desc = 'tissue' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATET... |
If the record is 5-5, what is the game maximum? | CREATE TABLE table_23285805_4 (game INTEGER,record VARCHAR) | SELECT MAX(game) FROM table_23285805_4 WHERE record = "5-5" |
When 10% is the percentage of electricity reduction how many sets of universities are there? | CREATE TABLE table_31191 ("Year" text,"Universities" real,"No. of Students Signed up" real,"% electricity reduction" text,"Tonnes of CO2 Saved" real,"\u00a3 Saved" text) | SELECT COUNT("Universities") FROM table_31191 WHERE "% electricity reduction" = '10%' |
Which players are from Indonesia? | CREATE TABLE country (country_id number,country_name text,capital text,official_native_language text)CREATE TABLE player (player_id number,player text,years_played text,total_wl text,singles_wl text,doubles_wl text,team number)CREATE TABLE match_season (season number,player text,position text,country number,team number... | SELECT T2.player FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T1.country_name = "Indonesia" |
hyperlipidemia ( total cholesterol > 260 mg / dl, ldl > 130 mg / dl, and / or triglycerides > 300 mg / dl ) despite appropriate treatment. | CREATE TABLE table_dev_18 ("id" int,"bleeding" int,"chronic_anticoagulant_therapy" bool,"renal_disease" bool,"hyperlipidemia" bool,"creatinine_clearance_cl" float,"chronic_hemostasis_disorders" bool,"significant_proteinuria" bool,"platelet_count" float,"total_cholesterol" int,"albumin_excretion" int,"ldl" int,"serum_cr... | SELECT * FROM table_dev_18 WHERE hyperlipidemia = 1 OR (total_cholesterol > 260 OR ldl > 130 OR triglyceride_tg > 300) |
How many episodes did the actor David Faustino appear in? | CREATE TABLE table_name_37 (episodes VARCHAR,actor VARCHAR) | SELECT episodes FROM table_name_37 WHERE actor = "david faustino" |
What was the location attendance when High points was by Pierce (22)? | CREATE TABLE table_11959669_4 (location_attendance VARCHAR,high_points VARCHAR) | SELECT location_attendance FROM table_11959669_4 WHERE high_points = "Pierce (22)" |
What are the ids of the problems that are from the product 'voluptatem' and are reported after 1995? | CREATE TABLE problems (problem_id number,product_id number,closure_authorised_by_staff_id number,reported_by_staff_id number,date_problem_reported time,date_problem_closed time,problem_description text,other_problem_details text)CREATE TABLE problem_category_codes (problem_category_code text,problem_category_descriptio... | SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995" |
Show the names of all the activities Mark Giuliano participates in. | CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE activity (actid number,activity_name text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone... | SELECT T3.activity_name FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" |
how many asian patients were treated with nifedipine cr? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug = "NIFEdipine CR" |
who was the runner-up in the 1915 competition for 'Articles with HCards'? | CREATE TABLE table_name_25 (runner_up VARCHAR,year VARCHAR) | SELECT runner_up FROM table_name_25 WHERE year = 1915 |
What is the CFL Team with Will Grant? | CREATE TABLE table_name_32 (cfl_team VARCHAR,player VARCHAR) | SELECT cfl_team FROM table_name_32 WHERE player = "will grant" |
How many accounts are there in total? | CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number)CREATE TABLE savings (custid number,balance number) | SELECT COUNT(*) FROM accounts |
In the next semester , what is the total number of classes being offered ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE ar... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Tell me the name in polish for radom seat | CREATE TABLE table_name_36 (name_in_polish VARCHAR,seat VARCHAR) | SELECT name_in_polish FROM table_name_36 WHERE seat = "radom" |
what is the maximum cost of the hospital which involves aortic valve disorder in 2105? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE prescriptions (row_id number,subject_id numb... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'aortic valve disorder')) AND STRFTIME('%y', cost.chargetime) = ... |
How much did the away team Geelong score? | CREATE TABLE table_name_53 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_53 WHERE away_team = "geelong" |
Among deaths 106 000 how many is crude rate. | CREATE TABLE table_2428 ("Period" text,"Births" text,"Deaths" text,"Difference" text,"Crude Birth Rate" real,"Crude Death Rate" real,"Natural Increase" real,"Total Fertility Rate" real,"Infant Mortality Rate" real) | SELECT "Crude Death Rate" FROM table_2428 WHERE "Deaths" = '106 000' |
List the id of students who attended some courses? | CREATE TABLE student_course_attendance (student_id VARCHAR) | SELECT student_id FROM student_course_attendance |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.