instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
among patients who had a hospital stay for more than 14 days, how many of them were discharged to home? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "14" |
List the name for storms and the number of affected regions for each storm. Plot them as pie chart. | CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real) | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID |
What was the party that was frist elected in 1919? | CREATE TABLE table_18645 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Party" FROM table_18645 WHERE "First elected" = '1919' |
Who is the Lees Team for episode 4x04? | CREATE TABLE table_23575917_4 (lees_team VARCHAR,episode VARCHAR) | SELECT lees_team FROM table_23575917_4 WHERE episode = "4x04" |
What are all the catalog entry names? | CREATE TABLE attribute_definitions (attribute_id number,attribute_name text,attribute_data_type text)CREATE TABLE catalog_contents_additional_attributes (catalog_entry_id number,catalog_level_number number,attribute_id number,attribute_value text)CREATE TABLE catalogs (catalog_id number,catalog_name text,catalog_publis... | SELECT DISTINCT (catalog_entry_name) FROM catalog_contents |
Which Money has a Score of 70-68-73-68=279? | CREATE TABLE table_name_25 (money___ INTEGER,score VARCHAR) | SELECT MIN(money___) AS $__ FROM table_name_25 WHERE score = 70 - 68 - 73 - 68 = 279 |
Which team has a class of 500cc and rank of 16th? | CREATE TABLE table_name_88 (team VARCHAR,class VARCHAR,rank VARCHAR) | SELECT team FROM table_name_88 WHERE class = "500cc" AND rank = "16th" |
How many games had a deficit of 175? | CREATE TABLE table_18505065_1 (played VARCHAR,against VARCHAR) | SELECT COUNT(played) FROM table_18505065_1 WHERE against = 175 |
What is the average rating for tv asahi? | CREATE TABLE table_18539834_2 (average_ratings VARCHAR,tv_station VARCHAR) | SELECT average_ratings FROM table_18539834_2 WHERE tv_station = "TV Asahi" |
What is the original air date of the episode written by Liz Feldman? | CREATE TABLE table_29920800_1 (original_air_date VARCHAR,written_by VARCHAR) | SELECT original_air_date FROM table_29920800_1 WHERE written_by = "Liz Feldman" |
Comments per week (questions with > 2 answers). | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREA... | WITH test_posts AS (SELECT q.Id AS Id, q.CreationDate AS CreationDate FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.AnswerCount > 2 UNION SELECT Id, CreationDate FROM Posts WHERE AnswerCount > 2) SELECT DATEADD(week, DATEDIFF(week, @epoch, CreationDate), @epoch) AS Week, COUNT(DISTINCT c.Id) AS Comments,... |
What is 9:00, when 8:30 is 'My Thursday Night Movie'? | CREATE TABLE table_40413 ("8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text) | SELECT "9:00" FROM table_40413 WHERE "8:30" = 'my thursday night movie' |
How many members are in each party? | CREATE TABLE member (member_id number,member_name text,party_id text,in_office text)CREATE TABLE region (region_id number,region_name text,date text,label text,format text,catalogue text)CREATE TABLE party_events (event_id number,event_name text,party_id number,member_in_charge_id number)CREATE TABLE party (party_id nu... | SELECT T2.party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id |
which week did they not have a match ? | CREATE TABLE table_203_730 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number,"bye" text) | SELECT "week" FROM table_203_730 WHERE "date" IS NULL |
What is the number of votes for the party which got more than 28 seats? | CREATE TABLE table_52367 ("Party" text,"Leader" text,"Votes" real,"Percentage" text,"Seats" real) | SELECT COUNT("Votes") FROM table_52367 WHERE "Seats" > '28' |
What is the poor law union of the Kilmaloda townland? | CREATE TABLE table_74468 ("Townland" text,"Area(acres)" real,"Barony" text,"Civil parish" text,"Poor law union" text) | SELECT "Poor law union" FROM table_74468 WHERE "Townland" = 'Kilmaloda' |
count the number of patients whose age is less than 67 and drug code is ns451000? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.formulary_drug_cd = "NS451000" |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of price , and group by attribute name. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name |
during the current hospital encounter patient 035-2205 had been prescribed ondansetron? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | 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 = '035-2205' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn... |
Bar chart x axis participant details y axis participant_id | CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Eve... | SELECT Participant_Details, Participant_ID FROM Participants |
What is the date of birth of the player that has 11 caps and plays the prop position? | CREATE TABLE table_56413 ("Player" text,"Position" text,"Date of Birth (Age)" text,"Caps" real,"Club/province" text) | SELECT "Date of Birth (Age)" FROM table_56413 WHERE "Caps" = '11' AND "Position" = 'prop' |
What are the countries of mountains with height bigger than 5000, and count them by a bar chart | CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text)CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int) | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country |
what are patient 8204's genders? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 prescriptio... | SELECT patients.gender FROM patients WHERE patients.subject_id = 8204 |
When was series premiere on the pilot episode | CREATE TABLE table_15823956_1 (series VARCHAR) | SELECT series AS premiere FROM table_15823956_1 WHERE series = "Pilot" |
Which location has a time of 9:30pm? | CREATE TABLE table_21330550_2 (location VARCHAR,time VARCHAR) | SELECT location FROM table_21330550_2 WHERE time = "9:30PM" |
What Nationality has a Position of right wing, with a #20 pick? | CREATE TABLE table_name_79 (nationality VARCHAR,position VARCHAR,pick__number VARCHAR) | SELECT nationality FROM table_name_79 WHERE position = "right wing" AND pick__number = "20" |
what were the five most commonly given laboratory tests for patients who were previously diagnosed with signs and symptoms of sepsis (sirs) - due to infectious process with organ dysfunction within the same hospital visit, since 2 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'signs and symptom... |
When 1-1 is the series who is the team? | CREATE TABLE table_22883210_11 (team VARCHAR,series VARCHAR) | SELECT team FROM table_22883210_11 WHERE series = "1-1" |
What is the highest Points, when Played is greater than 5? | CREATE TABLE table_name_30 (points INTEGER,played INTEGER) | SELECT MAX(points) FROM table_name_30 WHERE played > 5 |
What is the Hadeda Ibis when the Ostrich is Dark Chanting Goshawk? | CREATE TABLE table_20042805_2 (hadeda_ibis VARCHAR,ostrich VARCHAR) | SELECT hadeda_ibis FROM table_20042805_2 WHERE ostrich = "Dark Chanting Goshawk" |
What are the document ids for the budget type code 'SF'? | CREATE TABLE Documents_with_expenses (document_id VARCHAR,budget_type_code VARCHAR) | SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF' |
provide the number of patients with diagnoses icd9 code 75733 who had delta abnormal lab test status. | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "75733" AND lab.flag = "delta" |
provide the number of patients whose admission year is less than 2139 and item id is 50893? | CREATE TABLE procedures (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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.itemid = "50893" |
What was the record of the game that had a loss of Stottlemyre (10-12)? | CREATE TABLE table_79894 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_79894 WHERE "Loss" = 'stottlemyre (10-12)' |
What's the type of the school whose students' name is spirits? | CREATE TABLE table_23216 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real) | SELECT "Type" FROM table_23216 WHERE "Nickname" = 'Spirits' |
since 2101, what are the top four most frequently ordered laboratory tests for patients during the same month after they have been diagnosed with ac dvt/emb distl low ext? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... |
did patient 006-188114 get a vitamin b12 laboratory test during the first hospital visit? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,ag... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-188114' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit... |
I want a bar chart to show the average cloud cover of the dates that have the 5 highest cloud cover rates each year, and rank by the y axis from high to low. | CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INTEGER,mean_humidity INTEGER,min_humidity INTEGER,max_sea_level_pressure_inches NUMERIC,mean_sea_level_pressure_inches NUM... | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC |
A scatter chart about what are the grade number and classroom number of each class in the list? | CREATE TABLE teachers (LastName TEXT,FirstName TEXT,Classroom INTEGER)CREATE TABLE list (LastName TEXT,FirstName TEXT,Grade INTEGER,Classroom INTEGER) | SELECT Classroom, Grade FROM list |
what were the five most common medications prescribed for patients who had previously been diagnosed with dka within 2 months, in 2102? | 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.drugname FROM (SELECT t2.drugname, 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 = 'dka' AND STRFTIME('%y', diagnosis.diagnosistime) =... |
What is the total number of Rounds held in Nevada, United States in which the time was 1:55? | CREATE TABLE table_50474 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT COUNT("Round") FROM table_50474 WHERE "Location" = 'nevada, united states' AND "Time" = '1:55' |
how many jewish patients were admitted to the hospital before year 2148? | 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.religion = "JEWISH" AND demographic.admityear < "2148" |
WHAT IS THE 2ND LEG WITH TEAM 1 OF SPORTING? | CREATE TABLE table_50664 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_50664 WHERE "Team 1" = 'sporting' |
Where was the September 22 game played? | CREATE TABLE table_47354 ("Date" text,"Time" text,"Opponent" text,"Location" text,"Score" text) | SELECT "Location" FROM table_47354 WHERE "Date" = 'september 22' |
What is the total number of years that prof. aditya naraian purohit won? | CREATE TABLE table_name_76 (year VARCHAR,name VARCHAR) | SELECT COUNT(year) FROM table_name_76 WHERE name = "prof. aditya naraian purohit" |
Which stage has a mountains classification of Mariano Piccoli and was won by Giuseppe Citterio? | CREATE TABLE table_70136 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Trofeo Fast Team" text) | SELECT "Stage" FROM table_70136 WHERE "Mountains classification" = 'mariano piccoli' AND "Winner" = 'giuseppe citterio' |
Procurar Merchandising Feito pelo Daniel. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score nu... | SELECT Comments.PostId, Comments.Text AS "Coment rio" FROM Comments WHERE Comments.UserId = 4816 |
Which papers did the author 'Olin Shivers' write? Give me the paper titles. | CREATE TABLE papers (paperid number,title text)CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE inst (instid number,name text,country text)CREATE TABLE authors (authid number,lname text,fname text) | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers" |
When is the release date for a chip that has a Frequency of 2300mhz? | CREATE TABLE table_33930 ("Model Number" text,"Stepping" text,"Frequency" text,"L2 Cache" text,"Multi 1" text,"V Core" text,"Socket" text,"Release Date" text,"Part Number(s)" text) | SELECT "Release Date" FROM table_33930 WHERE "Frequency" = '2300mhz' |
What United States Player has a To par of +4 and a Score of 71-77=148? | CREATE TABLE table_name_67 (player VARCHAR,country VARCHAR,to_par VARCHAR,score VARCHAR) | SELECT player FROM table_name_67 WHERE country = "united states" AND to_par = "+4" AND score = 71 - 77 = 148 |
in what year was civallero 's first listed achievement ? | CREATE TABLE table_203_734 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT "year" FROM table_203_734 WHERE id = 1 |
calculate the duration of patient 013-12480's stay in the first icu. | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayi... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
Show me about the distribution of All_Neutral and ACC_Percent in a bar chart, sort by the Y-axis in asc. | 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_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent |
what is the total volume of output patient 28484 had on the first icu visit? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 admissions (row_id number,subje... | 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 = 28484) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) |
What is the last year that someone is first elected? | CREATE TABLE table_1342359_2 (first_elected INTEGER) | SELECT MAX(first_elected) FROM table_1342359_2 |
Is there a lab for 527 ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,stude... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 527 |
indicate the daily maximum amount of heart rate for patient 12367 during their last hospital encounter. | 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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locatio... | SELECT MAX(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 = 12367 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND chart... |
What is the original air date where tracy poust & jon kinnally was written by? | CREATE TABLE table_25126 ("Series #" real,"Season #" real,"Episode title" text,"Written by" text,"Directed by" text,"U.S. viewers (millions)" text,"Original air date" text) | SELECT "Original air date" FROM table_25126 WHERE "Written by" = 'Tracy Poust & Jon Kinnally' |
what year saw the highest output growth rate in japan between the years 1990 and 2004 ? | CREATE TABLE table_202_28 (id number,"year" number,"output growth rate %" number,"unemployment rate %" number,"inflation rate %" number) | SELECT "year" FROM table_202_28 WHERE "year" >= 1990 AND "year" <= 2004 ORDER BY "output growth rate %" DESC LIMIT 1 |
What college did delray brooks go to? | CREATE TABLE table_name_23 (college VARCHAR,player VARCHAR) | SELECT college FROM table_name_23 WHERE player = "delray brooks" |
Who won the series when the San Francisco Giants lost? | CREATE TABLE table_40441 ("Year" real,"Series" text,"Winning team" text,"Losing team" text,"Score" text,"Site" text) | SELECT "Winning team" FROM table_40441 WHERE "Losing team" = 'san francisco giants' |
What is the novel that has a valid status, located in Mongolia, and named Prenocephale? | CREATE TABLE table_42373 ("Name" text,"Novelty" text,"Status" text,"Authors" text,"Location" text) | SELECT "Novelty" FROM table_42373 WHERE "Status" = 'valid' AND "Location" = 'mongolia' AND "Name" = 'prenocephale' |
What is the rank of the player with the 39.69 average? | CREATE TABLE table_26041144_11 (rank VARCHAR,average VARCHAR) | SELECT rank FROM table_26041144_11 WHERE average = "39.69" |
What is the highest season for a bowl game of the 1993 Independence Bowl? | CREATE TABLE table_20211 ("#" real,"Season" real,"Bowl game" text,"Result" text,"Opponent" text,"Stadium" text,"Location" text,"Attendance" text) | SELECT MAX("Season") FROM table_20211 WHERE "Bowl game" = '1993 Independence Bowl' |
Name the Score which has a Time of 18:00 and a Venue of african union? | CREATE TABLE table_43863 ("Match No." real,"Date" text,"Time" text,"Score" text,"Venue" text,"Match Report" text) | SELECT "Score" FROM table_43863 WHERE "Time" = '18:00' AND "Venue" = 'african union' |
Show first name and id for all customers with at least 2 accounts. Show bar chart. | CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,production_type_code VARCHAR(15),unit_price DECIMAL(19,4),product_name VARCHAR(80),product_color VARCHAR(20),product_size VARCHAR(20))CREATE TABLE Order_Items (order_i... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id |
On which day were the subtotal hours 9:30? | CREATE TABLE table_name_9 (date VARCHAR,sub_total VARCHAR) | SELECT date FROM table_name_9 WHERE sub_total = "9:30" |
What is the result when you play at home against Pride | CREATE TABLE table_70317 ("Date" text,"Opponent" text,"Home/Away" text,"Field" text,"Result" text) | SELECT "Result" FROM table_70317 WHERE "Home/Away" = 'home' AND "Opponent" = 'pride' |
Who was eliminated from the competition when pau proceed to the quarter final? | CREATE TABLE table_28068063_3 (eliminated_from_competition VARCHAR,proceed_to_quarter_final VARCHAR) | SELECT eliminated_from_competition FROM table_28068063_3 WHERE proceed_to_quarter_final = "Pau" |
Which 2008 has a 2009 of A, and a Tournament of cincinnati masters? | CREATE TABLE table_name_39 (tournament VARCHAR) | SELECT 2008 FROM table_name_39 WHERE 2009 = "a" AND tournament = "cincinnati masters" |
Which Game has a Series of bruins lead 3 1? | CREATE TABLE table_name_30 (game INTEGER,series VARCHAR) | SELECT SUM(game) FROM table_name_30 WHERE series = "bruins lead 3–1" |
What was the stadium for the game held on October 31? | CREATE TABLE table_67701 ("Week" real,"Date" text,"Visiting Team" text,"Host Team" text,"Stadium" text) | SELECT "Stadium" FROM table_67701 WHERE "Date" = 'october 31' |
what is the number of patients whose admission type is elective and lab test fluid is urine? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title 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,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Urine" |
South African Users by Location. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Badges (Id number,UserId number,N... | SELECT Location, COUNT(*) AS number FROM Users WHERE Location LIKE '%South Africa%' OR Location LIKE '%Cape Town%' OR Location LIKE '%Capetown%' OR Location LIKE '%Joburg%' OR Location LIKE '%Johannesburg%' OR Location LIKE '%JHB%' OR Location LIKE '%Gauteng%' OR Location LIKE '%Pretoria%' OR Location LIKE '%Western Ca... |
What is the smallest grid for Ayrton Senna? | CREATE TABLE table_54111 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MIN("Grid") FROM table_54111 WHERE "Driver" = 'ayrton senna' |
what is the maximum total cost of a hospital involving a laboratory test for uric acid, urine since 5 years ago? | 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 d_icd_procedures (row_id number,icd9_code text,short_title tex... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'uric acid, urine')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY cos... |
What 2012 amount of earnings corresponds with less than 28 tournaments played? | CREATE TABLE table_name_59 (earnings___$__ VARCHAR,tournaments_played VARCHAR,year VARCHAR) | SELECT earnings___$__ FROM table_name_59 WHERE tournaments_played < 28 AND year = "2012" |
Which Bask has Soft of 18, and a Total larger than 35? | CREATE TABLE table_43521 ("School" text,"Bask" real,"Golf" text,"Soccer" text,"Soft" text,"Swimming" text,"Tennis" real,"Indoor track" text,"Outdoor track" text,"Volleyball" text,"Total" real) | SELECT AVG("Bask") FROM table_43521 WHERE "Soft" = '18' AND "Total" > '35' |
What was the attendance at Moorabbin Oval? | CREATE TABLE table_51767 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT AVG("Crowd") FROM table_51767 WHERE "Venue" = 'moorabbin oval' |
When is the date of appointment when the position in table is 16? | CREATE TABLE table_27383390_4 (date_of_appointment VARCHAR,position_in_table VARCHAR) | SELECT date_of_appointment FROM table_27383390_4 WHERE position_in_table = 16 |
What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a line chart, list from low to high by the date. | CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INTEGER,mean_humidity INTEGER,min_humidity INTEGER,max_sea_level_pressure_inches NUMERIC,mean_sea_level_pressure_inches NUM... | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and salary in a bar chart, show SALARY in asc order. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY |
what was the name of the intake that patient 017-83061 until 943 days ago last had? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunits... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-83061')) AND intakeoutput.cellpath LIKE '%intake%' AND D... |
calculate the number of patients born before 1879 ere tranferred within the facility. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1879" |
how long did orville brown remain nwa world heavyweight champion ? | CREATE TABLE table_202_45 (id number,"rank" number,"wrestler" text,"no. of reigns" number,"combined days" number) | SELECT "combined days" FROM table_202_45 WHERE "wrestler" = 'orville brown' |
For episode number 2-03, what are the names of the cast? | CREATE TABLE table_2570269_2 (cast VARCHAR,episode__number VARCHAR) | SELECT cast FROM table_2570269_2 WHERE episode__number = "2-03" |
How many companies that have ever operated a flight for each type? Draw a bar chart. | CREATE TABLE flight (id int,Vehicle_Flight_number text,Date text,Pilot text,Velocity real,Altitude real,airport_id int,company_id int)CREATE TABLE operate_company (id int,name text,Type text,Principal_activities text,Incorporated_in text,Group_Equity_Shareholding real)CREATE TABLE airport (id int,City text,Country text... | SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type |
when was last time patient 9038 was prescribed a medication via right eye route in 04/last year? | 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 d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numbe... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9038) AND prescriptions.route = 'right eye' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME... |
What was the number of athletes in the host city of Nice? | CREATE TABLE table_26669939_1 (no_of_athletes VARCHAR,host_city VARCHAR) | SELECT no_of_athletes FROM table_26669939_1 WHERE host_city = "Nice" |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the amount of hire_date bin hire_date by weekday in a bar chart, and sort in ascending by the total number please. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) |
Question score vs. highest voted Answer score. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUser... | SELECT q.Score AS "q-score", a.Score AS "a-score" FROM Posts AS q INNER JOIN (SELECT DISTINCT a.ParentId, MAX(a.Score) AS "score" FROM Posts AS a WHERE a.PostTypeId = 2 GROUP BY a.ParentId) AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL |
Which S.R. has a Average smaller than 23.63 Runs Scored of 49? | CREATE TABLE table_42794 ("Name" text,"Innings" real,"Runs Scored" real,"Balls Faced" real,"Average" real,"S.R." real) | SELECT "S.R." FROM table_42794 WHERE "Average" < '23.63' AND "Runs Scored" = '49' |
What is Peter Gregg Hurley Haywood's results? | CREATE TABLE table_13657749_2 (results VARCHAR,gto_winning_team VARCHAR) | SELECT results FROM table_13657749_2 WHERE gto_winning_team = "Peter Gregg Hurley Haywood" |
What category was Scream nominated for at the International Horror Guild? | CREATE TABLE table_name_52 (category VARCHAR,work VARCHAR,award VARCHAR) | SELECT category FROM table_name_52 WHERE work = "scream" AND award = "international horror guild" |
List all questions by a user. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostsWithDeleted (Id number,Po... | SELECT * FROM Posts WHERE OwnerUserId = @UserId AND PostTypeId = 1 |
What is the MWEHL Team on Round 2, with player Nicolas Kerdiles? | CREATE TABLE table_name_49 (mwehl_team VARCHAR,round VARCHAR,player VARCHAR) | SELECT mwehl_team FROM table_name_49 WHERE round = "2" AND player = "nicolas kerdiles" |
What was the result when the new england patriots played? | CREATE TABLE table_name_33 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_33 WHERE opponent = "new england patriots" |
What was the location for when the opponent was @ roughriders? | CREATE TABLE table_24605 ("Week" real,"Date" text,"Opponent" text,"Location" text,"Final Score" text,"Attendance" real,"Record" text) | SELECT "Location" FROM table_24605 WHERE "Opponent" = '@ Roughriders' |
Which County has an Enrollment of 297? | CREATE TABLE table_name_16 (county VARCHAR,enrollment VARCHAR) | SELECT county FROM table_name_16 WHERE enrollment = 297 |
Wat episode number had 5.46 million viewers? | CREATE TABLE table_3917 ("Episode #" real,"Series #" real,"Title" text,"Director" text,"Writer" text,"Original airdate" text,"Viewers (millions)" text) | SELECT "Episode #" FROM table_3917 WHERE "Viewers (millions)" = '5.46' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.