instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Who was the runner-up, when the champion was Bj rn Borg after 1978?
CREATE TABLE table_59191 ("Location" text,"Year" real,"Champion" text,"Runner-up" text,"Score" text)
SELECT "Runner-up" FROM table_59191 WHERE "Champion" = 'björn borg' AND "Year" > '1978'
What record has a december less than 6, points less than 38, and pittsburgh penguins as the opponent?
CREATE TABLE table_name_40 (record VARCHAR,opponent VARCHAR,december VARCHAR,points VARCHAR)
SELECT record FROM table_name_40 WHERE december < 6 AND points < 38 AND opponent = "pittsburgh penguins"
Give me a bar chart for total number of team id of each acc road, order by the X-axis in ascending.
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 ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
What is the position of player Tiffany Garofano (2)?
CREATE TABLE table_34399 ("Week" text,"Division" text,"Position" text,"Player" text,"School" text)
SELECT "Position" FROM table_34399 WHERE "Player" = 'tiffany garofano (2)'
count the number of patients whose discharge location is dead/expired?
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.discharge_location = "DEAD/EXPIRED"
how many patients died in or before year 2148 had the primary disease overdose?
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 WHERE demographic.diagnosis = "OVERDOSE" AND demographic.dod_year <= "2148.0"
how many patients are discharged to home health care and with procedure sm bowel exteriorization?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Sm bowel exteriorization"
Who playes the sport of athletics?
CREATE TABLE table_32972 ("Year" real,"Sportsperson" text,"Nation of birth" text,"Team" text,"Competition,federation,or league" text,"Sport" text)
SELECT "Sportsperson" FROM table_32972 WHERE "Sport" = 'athletics'
count the number of patients whose year of death is less than or equal to 2138 and procedure long title is other diagnostic procedures on nasal sinuses?
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.long_title = "Other diagnostic procedures on nasal sinuses"
what's the total dose of volume (ml) epinephrine that patient 011-52460 had received until 02/14/2103?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnos...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-52460')) AND intakeoutput.celllabel = 'volum...
What is the highest number of laps for grid 17?
CREATE TABLE table_58306 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MAX("Laps") FROM table_58306 WHERE "Grid" = '17'
Tell me the time/retired for grid 4
CREATE TABLE table_name_41 (time_retired VARCHAR,grid VARCHAR)
SELECT time_retired FROM table_name_41 WHERE grid = 4
First Posts by Users Created Recently.
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...
WITH UserFirstPost AS (SELECT OwnerUserId, MIN(Posts.Id) AS PostId FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Users.CreationDate > '2012-01-01' GROUP BY OwnerUserId LIMIT 50) SELECT * FROM UserFirstPost LIMIT 10
how many buildings have less than 20 floors ?
CREATE TABLE table_204_649 (id number,"rank" number,"name" text,"image" number,"height\nft (m)" text,"floors" number,"year" number,"notes" text)
SELECT COUNT("name") FROM table_204_649 WHERE "floors" < 20
What was Rut's Slovenes percentage in 1991?
CREATE TABLE table_name_76 (percent_of_slovenes_1991 VARCHAR,village__slovenian_ VARCHAR)
SELECT percent_of_slovenes_1991 FROM table_name_76 WHERE village__slovenian_ = "rut"
Name the Bore x stroke of 1929-32
CREATE TABLE table_name_83 (bore_x_stroke VARCHAR,year VARCHAR)
SELECT bore_x_stroke FROM table_name_83 WHERE year = "1929-32"
who were the chumps in the kitchen ?
CREATE TABLE table_204_269 (id number,"week" number,"room" text,"winning couple" text,"2nd couple" text,"3rd couple" text,"chumps" text)
SELECT "chumps" FROM table_204_269 WHERE "room" = 'kitchen'
Find the number of scientists involved for the projects that require more than 300 hours Show bar chart, and display by the total number in asc.
CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Scientists (SSN int,Name Char(30))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY COUNT(*)
the number of times david oliver placed 1st in 100m hurdles between the years 2006-2013 .
CREATE TABLE table_203_192 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT COUNT(*) FROM table_203_192 WHERE "position" = 1 AND "notes" = '110 m hurdles'
What is the grid for Jack Brabham with more than 65 laps?
CREATE TABLE table_56259 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT SUM("Grid") FROM table_56259 WHERE "Driver" = 'jack brabham' AND "Laps" > '65'
Which player was from Western Washington University, played midfield, and was from years after 2009?
CREATE TABLE table_42470 ("Year" real,"Team" text,"Player" text,"Position" text,"School" text)
SELECT "Player" FROM table_42470 WHERE "School" = 'western washington university' AND "Position" = 'midfield' AND "Year" > '2009'
How many points have 75 laps?
CREATE TABLE table_44442 ("Driver" text,"Team" text,"Laps" text,"Time/Retired" text,"Grid" text,"Laps Led" text,"Points" text)
SELECT "Points" FROM table_44442 WHERE "Laps" = '75'
What is found in the Built column of the locomotive with 0-4-0 wheels that is still in service?
CREATE TABLE table_name_8 (built VARCHAR,wheels VARCHAR,status VARCHAR)
SELECT built FROM table_name_8 WHERE wheels = "0-4-0" AND status = "in service"
What is the number of high checkout when legs Lost is 17, 140+ is 15, and played is larger than 4?
CREATE TABLE table_79618 ("Player" text,"Played" real,"Legs Won" real,"Legs Lost" real,"100+" real,"140+" real,"180s" real,"High Checkout" real,"3-dart Average" real)
SELECT SUM("High Checkout") FROM table_79618 WHERE "Legs Lost" = '17' AND "140+" = '15' AND "Played" > '4'
What was the name that had a starting price of 11/1 and a jockey named Garrett Cotter?
CREATE TABLE table_20668268_1 (name VARCHAR,starting_price VARCHAR,jockey VARCHAR)
SELECT name FROM table_20668268_1 WHERE starting_price = "11/1" AND jockey = "Garrett Cotter"
Which publisher has release year of 2000 and an original dreamcast platform?
CREATE TABLE table_name_60 (publisher VARCHAR,year_of_release VARCHAR,original_platforms VARCHAR)
SELECT publisher FROM table_name_60 WHERE year_of_release = "2000" AND original_platforms = "dreamcast"
What Opponent in the final had a Partner of Gast n Etlis?
CREATE TABLE table_7317 ("Outcome" text,"Date" real,"Tournament" text,"Surface" text,"Partner" text,"Opponent in the final" text,"Score in the final" text)
SELECT "Opponent in the final" FROM table_7317 WHERE "Partner" = 'gastón etlis'
indicate the daily minimum amount of respiration for patient 033-4763 in 11/last year.
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 MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-4763')) AND NOT vitalperiodic.respiration IS N...
when did patient 010-3286 first get his heartrate measured on 11/18/this year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number...
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 = '010-3286')) AND NOT vitalperiodic.heartrate IS NULL...
the last year what were the top three most common procedures that patients received during the same hospital encounter after getting a immunosuppressive therapy - tacrolimus?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid ...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'immun...
Which place is Andy Bean from the United States?
CREATE TABLE table_name_50 (place VARCHAR,country VARCHAR,player VARCHAR)
SELECT place FROM table_name_50 WHERE country = "united states" AND player = "andy bean"
how many people are there whose weight is higher than 85 for each gender?
CREATE TABLE people (sex VARCHAR,weight INTEGER)
SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex
give me the number of patients whose death status is 0 and diagnoses icd9 code is 78052?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "78052"
how many of the institutions are located in london ?
CREATE TABLE table_202_232 (id number,"institution" text,"location" text,"established" number,"gained university status" number,"vice-chancellor" text,"total number of students" number,"research funding (\u00a3,000)" number)
SELECT COUNT("institution") FROM table_202_232 WHERE "location" = 'london'
did patient 739 have a normal arterial bp [systolic] on 12/16/this year?
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,itemid number,amount number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,d...
SELECT COUNT(*) > 0 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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systol...
Name the attribute for mutation and domcharacterdatamodified
CREATE TABLE table_39431 ("Category" text,"Type" text,"Attribute" text,"Bubbles" text,"Cancelable" text)
SELECT "Attribute" FROM table_39431 WHERE "Category" = 'mutation' AND "Type" = 'domcharacterdatamodified'
Show distinct types of artworks that are nominated in festivals in 2007.
CREATE TABLE nomination (Artwork_ID VARCHAR,Festival_ID VARCHAR)CREATE TABLE festival_detail (Festival_ID VARCHAR,Year VARCHAR)CREATE TABLE artwork (Type VARCHAR,Artwork_ID VARCHAR)
SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007
What Team has a Pick of 40?
CREATE TABLE table_name_67 (team VARCHAR,pick VARCHAR)
SELECT team FROM table_name_67 WHERE pick = 40
Name the Report of 7 february with an Away team of new zealand breakers?
CREATE TABLE table_name_35 (report VARCHAR,date VARCHAR,away_team VARCHAR)
SELECT report FROM table_name_35 WHERE date = "7 february" AND away_team = "new zealand breakers"
What is the highest average of celebrity Natalia Lesz, who is ranked greater than 4?
CREATE TABLE table_6981 ("Rank" real,"Celebrity" text,"Professional Partner" text,"Season" real,"Average" real)
SELECT MAX("Average") FROM table_6981 WHERE "Rank" > '4' AND "Celebrity" = 'natalia lesz'
Count the number of parties.
CREATE TABLE host (host_id number,name text,nationality text,age text)CREATE TABLE party_host (party_id number,host_id number,is_main_in_charge others)CREATE TABLE party (party_id number,party_theme text,location text,first_year text,last_year text,number_of_hosts number)
SELECT COUNT(*) FROM party
what's the result with incumbent being jack z. anderson
CREATE TABLE table_1342233_6 (result VARCHAR,incumbent VARCHAR)
SELECT result FROM table_1342233_6 WHERE incumbent = "Jack Z. Anderson"
How many 3rd ru does Costa Rica have?
CREATE TABLE table_21790 ("Rank" real,"Country" text,"Miss United Continent" real,"Virreina" real,"1st RU" real,"2nd RU" real,"3rd RU" real,"4th RU" real,"Semifinalists" real,"Total" real)
SELECT MAX("3rd RU") FROM table_21790 WHERE "Country" = 'Costa Rica'
Which Year has a Category of best original song ( )?
CREATE TABLE table_77297 ("Year" real,"Award" text,"Category" text,"Country" text,"Result" text)
SELECT MAX("Year") FROM table_77297 WHERE "Category" = 'best original song (รอเธอหันมา – โฟกัส จิระกุล)'
What is taipei's lowest 2010 population?
CREATE TABLE table_name_99 (population__2010_ INTEGER,city VARCHAR)
SELECT MIN(population__2010_) FROM table_name_99 WHERE city = "taipei"
who was the most recent winner ?
CREATE TABLE table_204_655 (id number,"year" number,"winner" text,"album" text,"other finalists" text)
SELECT "winner" FROM table_204_655 ORDER BY "year" DESC LIMIT 1
Who was the leading scorer on the game played on February 25?
CREATE TABLE table_name_28 (leading_scorer VARCHAR,date VARCHAR)
SELECT leading_scorer FROM table_name_28 WHERE date = "february 25"
What is the weekly rank for the episode with a share over 7 and a rating/share of 2.3/7?
CREATE TABLE table_name_77 (rank__week_ VARCHAR,share VARCHAR,rating VARCHAR)
SELECT rank__week_ FROM table_name_77 WHERE share > 7 AND rating / SHARE(18 - 49) = 2.3 / 7
List all the participant ids and their details using a bar chart, and sort Y in asc order.
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,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa...
SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_ID
What is Wins, when Top-25 is less than 4, and when Top-5 is greater than 0?
CREATE TABLE table_name_97 (wins VARCHAR,top_25 VARCHAR,top_5 VARCHAR)
SELECT wins FROM table_name_97 WHERE top_25 < 4 AND top_5 > 0
Top SO users from Poznan, Poland.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%poznan%' OR LOWER(Location) LIKE '%pozna %') AND Reputation >= 100 ORDER BY Reputation DESC
what number of patients of american indian/alaska native ethnicity had lab test named transitional epithelial cells?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Transitional Epithelial Cells"
What position did he finish in the year his average start was 16.8?
CREATE TABLE table_2169966_2 (position VARCHAR,avg_start VARCHAR)
SELECT position FROM table_2169966_2 WHERE avg_start = "16.8"
Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.
CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,song text,artist_id number)CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,volume number,result text)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,f...
SELECT result, COUNT(*) FROM music_festival GROUP BY result ORDER BY COUNT(*) DESC
Who is no. 79 directed by?
CREATE TABLE table_22904752_1 (directed_by VARCHAR,no VARCHAR)
SELECT directed_by FROM table_22904752_1 WHERE no = 79
What is his record at ufc 67?
CREATE TABLE table_32704 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Record" FROM table_32704 WHERE "Event" = 'ufc 67'
how many parts were published in 2005 ?
CREATE TABLE table_203_679 (id number,"part" text,"number" text,"first public release date (first edition)" number,"latest public release date (edition)" number,"latest amendment" text,"title" text,"description" text)
SELECT COUNT("part") FROM table_203_679 WHERE "first public release date (first edition)" = 2005
Which loss was on June 13?
CREATE TABLE table_name_23 (loss VARCHAR,date VARCHAR)
SELECT loss FROM table_name_23 WHERE date = "june 13"
When were the callback auditions for the audition city in the episode aired on February 9, 2011?
CREATE TABLE table_29529 ("Episode air date" text,"Audition city" text,"First audition date" text,"Audition venue" text,"Callback audition date" text,"Callback venue" text,"Golden tickets" text)
SELECT "Callback audition date" FROM table_29529 WHERE "Episode air date" = 'February 9, 2011'
how many days have elapsed since patient 012-20116's last anemia diagnosis in their current hospital encounter?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-20116'...
had patient 012-20482 until 2103 been diagnosed with post craniotomy - for hemorrhage?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-20482')) AND diagnosis.diagnosisname = 'post craniotomy - for hemorrhage...
What is the area (in km2) for the community that has a status of village, a census ranking of 2,471 of 5,008, and a population of less than 748?
CREATE TABLE table_9244 ("Official Name" text,"Status" text,"Area km 2" real,"Population" real,"Census Ranking" text)
SELECT SUM("Area km 2") FROM table_9244 WHERE "Status" = 'village' AND "Census Ranking" = '2,471 of 5,008' AND "Population" < '748'
When are the A.M. time slots for PHYSED 482 ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE co...
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND c...
What is the 2002 average when 2003 is less than 13.2, 2006 is more than 12.1, 2011 is more than 13.5 and 2001 is 11.5?
CREATE TABLE table_9821 ("Division" text,"1999" real,"2000" real,"2001" real,"2002" real,"2003" real,"2004" real,"2005" real,"2006" real,"2007" real,"2008" real,"2009" real,"2010" real,"2011" real)
SELECT AVG("2002") FROM table_9821 WHERE "2003" < '13.2' AND "2006" > '12.1' AND "2011" > '13.5' AND "2001" = '11.5'
What is the listed population from the 2010 census of West Bogor?
CREATE TABLE table_16434 ("English name" text,"Original name" text,"Area in km\u00b2" text,"Population at 2010 Census" real,"Number of settlements and villages" real)
SELECT MIN("Population at 2010 Census") FROM table_16434 WHERE "English name" = 'West Bogor'
What was the sum of the draws for the team that had 11 wins, less than 38 points, and a position smaller than 4?
CREATE TABLE table_35522 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real)
SELECT SUM("Draws") FROM table_35522 WHERE "Position" < '4' AND "Wins" = '11' AND "Points" < '38'
what is maximum days of hospital stay of patients whose admission location is clinic referral/premature?
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
what is the dose of sucralfate that is last prescribed to patient 53015 until 05/2105?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 microbio...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53015) AND prescriptions.drug = 'sucralfate' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-05' ORDER BY prescriptions.startdate DESC LIMIT 1
What males speak Polish?
CREATE TABLE table_67865 ("Language" text,"Number" text,"percentage (%)" text,"males" text,"females" text)
SELECT "males" FROM table_67865 WHERE "Language" = 'polish'
Name the to par for score of 74-74-74-71=293
CREATE TABLE table_70164 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text)
SELECT "To par" FROM table_70164 WHERE "Score" = '74-74-74-71=293'
For those products with a price between 60 and 120, give me the comparison about price over the name , and sort Price in descending order.
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 Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Price DESC
Users with less reputation than X, Y and Z.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerU...
WITH raw AS (SELECT COUNT(Id) AS "total", COUNT(CASE WHEN Reputation < '##x##' THEN 1 ELSE NULL END) AS "x", COUNT(CASE WHEN Reputation < '##y##' THEN 1 ELSE NULL END) AS "y", COUNT(CASE WHEN Reputation < '##z##' THEN 1 ELSE NULL END) AS "z" FROM Users) SELECT (CAST('x' AS FLOAT) / CAST('total' AS FLOAT)) * 100 AS "x%"...
What was the finale for
CREATE TABLE table_10942714_1 (finale VARCHAR,chinese_title VARCHAR)
SELECT finale FROM table_10942714_1 WHERE chinese_title = "潮爆大狀"
What is the average Silver with rank 30 and a Bronze greater than 0
CREATE TABLE table_7954 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Silver") FROM table_7954 WHERE "Rank" = '30' AND "Bronze" > '0'
List the # for ships commissioned on september 30, 1967.
CREATE TABLE table_1014206_2 (_number VARCHAR,commissioned VARCHAR)
SELECT _number FROM table_1014206_2 WHERE commissioned = "September 30, 1967"
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to order by the y axis from high to low.
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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC
What is the total points of teams using a ligier js11/15 chassis?
CREATE TABLE table_name_18 (points VARCHAR,chassis VARCHAR)
SELECT COUNT(points) FROM table_name_18 WHERE chassis = "ligier js11/15"
how many patients whose admission location was tansfer from hospital/extram have undergone suture of artery procedure?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.short_title = "Suture of artery"
What courses on Tech Phys Instructn have no prerequisites ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TAB...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Tech Phys Instructn%' OR course.description LIKE '%Tech Phys Instructn%' OR course.name LIKE '%Tech Phys Instructn%') AND course.enforced_requirement = 'N / A'
show me flights from SEATTLE to SAN FRANCISCO that leave after 1700
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1...
What is the number of against when Central Murray is Tooleybuc Manangatang and there are fewer than 13 wins?
CREATE TABLE table_name_90 (against INTEGER,central_murray VARCHAR,wins VARCHAR)
SELECT MAX(against) FROM table_name_90 WHERE central_murray = "tooleybuc manangatang" AND wins < 13
What's the lowest round with the opponent John Howard that had a method of Decision (unanimous)?
CREATE TABLE table_name_21 (round INTEGER,method VARCHAR,opponent VARCHAR)
SELECT MIN(round) FROM table_name_21 WHERE method = "decision (unanimous)" AND opponent = "john howard"
how many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?
CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
Provide the number of patients that died and had a primary disease of ST elevated myocardial infarction/cardiac cath.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
how many patients are diagnosed with primary disease pituitary bleed and born before 2056?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dob_year < "2056"
When tim mack is on team usa what is the progressive total?
CREATE TABLE table_22796 ("Match no." real,"Match Type" text,"Team Europe" text,"Score" text,"Team USA" text,"Progressive Total" text)
SELECT "Progressive Total" FROM table_22796 WHERE "Team USA" = 'Tim Mack'
Show the number of type of thing code from each type of thing code, and I want to rank Y-axis in asc order please.
CREATE TABLE Residents (resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME,date_moved_out DATETIME,other_details VARCHAR(255))CREATE TABLE Customer_Events (Customer_Event_ID INTEGER,customer_id INTEGER,date_moved_in DATETIME,property_id INTEGER,resident_id INTEGER,thing_id INTEGER)CREATE TABLE Services (ser...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things GROUP BY Type_of_Thing_Code ORDER BY COUNT(Type_of_Thing_Code)
What is the 08:00 PM when the 07:00 PM is I am siam (rerun)?
CREATE TABLE table_42551 ("Time" text,"06:00 PM" text,"07:00 PM" text,"08:00 PM" text,"09:00 PM" text,"10:00 PM" text,"10:30 PM" text,"11:00 PM" text)
SELECT "08:00 PM" FROM table_42551 WHERE "07:00 PM" = 'i am siam (rerun)'
Which papers cite Daniel Jurafsky ?
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE field (fieldid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (c...
SELECT DISTINCT paper.paperid FROM author, cite, paper, writes WHERE author.authorname = 'Daniel Jurafsky' AND paper.paperid = cite.citingpaperid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid
i need a return flight from DENVER to ATLANTA
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)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 int,cruising_spe...
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 = 'ATLANTA...
What years did Lou Graham win in?
CREATE TABLE table_name_41 (year_s__won VARCHAR,player VARCHAR)
SELECT year_s__won FROM table_name_41 WHERE player = "lou graham"
What is the Rank of the Rider with a Speed of 111.072mph in Team 250CC Honda?
CREATE TABLE table_65200 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text)
SELECT AVG("Rank") FROM table_65200 WHERE "Team" = '250cc honda' AND "Speed" = '111.072mph'
which species have at least 87 % sequence identity ?
CREATE TABLE table_204_358 (id number,"species" text,"common name" text,"ncbi accession #" text,"ncbi name" text,"length" text,"sequence identity" text,"sequence similarity" text,"years since divergence from human (mya)" number)
SELECT "species" FROM table_204_358 WHERE "sequence identity" >= 87
What was the pick number when mark hayes was drafted?
CREATE TABLE table_name_42 (pick VARCHAR,player VARCHAR)
SELECT pick FROM table_name_42 WHERE player = "mark hayes"
Score of postponed (rain) rescheduled for June 27 had what loss?
CREATE TABLE table_name_32 (loss VARCHAR,score VARCHAR)
SELECT loss FROM table_name_32 WHERE score = "postponed (rain) rescheduled for june 27"
What was the finish with a total larger than 286, a to par of +4 and Bob Tway played?
CREATE TABLE table_name_70 (finish VARCHAR,player VARCHAR,total VARCHAR,to_par VARCHAR)
SELECT finish FROM table_name_70 WHERE total > 286 AND to_par = "+4" AND player = "bob tway"
How many new entries started in the round where winners from the previous round is 32?
CREATE TABLE table_22282 ("Round" text,"Clubs remaining" real,"Clubs involved" real,"Winners from previous round" text,"New entries this round" text,"Leagues entering at this round" text)
SELECT "New entries this round" FROM table_22282 WHERE "Winners from previous round" = '32'
what is the date when the home is st. louis?
CREATE TABLE table_54005 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_54005 WHERE "Home" = 'st. louis'
What is the total number of goals on the debut date of 14-04-1907?
CREATE TABLE table_11585313_1 (number_of_goals VARCHAR,date_of_debut VARCHAR)
SELECT COUNT(number_of_goals) FROM table_11585313_1 WHERE date_of_debut = "14-04-1907"
what was the attendance for a home venue and a w 3-0 result?
CREATE TABLE table_53608 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT AVG("Attendance") FROM table_53608 WHERE "Venue" = 'home' AND "Result" = 'w 3-0'