instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what is the number of patients whose admission year is less than 2187 and procedure long title is infusion of vasopressor agent?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2187" AND procedures.long_title = "Infusion of vasopressor agent"
What is the lowest Took Office, when Senator is Eddie Bernice Johnson, and when District is greater than 23?
CREATE TABLE table_name_50 (took_office INTEGER,senator VARCHAR,district VARCHAR)
SELECT MIN(took_office) FROM table_name_50 WHERE senator = "eddie bernice johnson" AND district > 23
provide the number of patients whose gender is f and death status is 1?
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.gender = "F" AND demographic.expire_flag = "1"
which club had 27 point and a goal difference of +1 ?
CREATE TABLE table_204_135 (id number,"position" number,"club" text,"played" number,"points" number,"wins" number,"draws" number,"losses" number,"goals for" number,"goals against" number,"goal difference" number)
SELECT "club" FROM table_204_135 WHERE "points" = 27 AND "goal difference" = 1
Can you specify the Core classes that are offered next Winter ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,r...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
What were the years active where Asian Cup played as a captain is Qatar 1988?
CREATE TABLE table_3729 ("#" real,"Matches As Captain" text,"Player" text,"Asian Cup Played As A Captain" text,"Years Active" text,"Caps(Goals)" text)
SELECT "Years Active" FROM table_3729 WHERE "Asian Cup Played As A Captain" = 'Qatar 1988'
the first time patient 67902 received int inser lead atri-vent until 2104?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 microbiologyev...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int inser lead atri-vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67902) AND...
who is the owner of the wild oatsxi bob oatley or mark richards ?
CREATE TABLE table_204_431 (id number,"yacht" text,"nation" text,"owner" text,"skipper" text,"launch year" number)
SELECT "owner" FROM table_204_431 WHERE "yacht" = 'wild oats xi'
what is the number of patients whose admission year is less than 2146 and diagnoses icd9 code is 3004?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2146" AND diagnoses.icd9_code = "3004"
Who wrote the episode with 7.52 million US viewers?
CREATE TABLE table_74305 ("#" real,"Episode" text,"Directed by" text,"Written by" text,"U.S. Viewers (in millions)" text,"Original airdate" text)
SELECT "Written by" FROM table_74305 WHERE "U.S. Viewers (in millions)" = '7.52'
What was the score when attendance was 19,887?
CREATE TABLE table_name_2 (record VARCHAR,attendance VARCHAR)
SELECT record FROM table_name_2 WHERE attendance = "19,887"
who wrote the first episode of the season ?
CREATE TABLE table_204_840 (id number,"no. in\nseries" number,"no. in\nseason" number,"title" text,"directed by" text,"written by" text,"original air date" text,"prod. code" text)
SELECT "written by" FROM table_204_840 WHERE "no. in\nseason" = 1
Which season had 0 wins and 5 losses for the Surrey team?
CREATE TABLE table_38793 ("Season" text,"Team" text,"Wins" text,"Losses" text,"Draws" text)
SELECT "Season" FROM table_38793 WHERE "Wins" = '0' AND "Losses" = '5' AND "Team" = 'surrey'
What was the last time period the class THTREMUS 252 was offered ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'THTREMUS' AND course.number = 252 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
what was the minimum monthly number of patients who were admitted for encephalopathy - metabolic in a year before?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'encephalopathy - metabolic' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) ...
What engine was used in 1999?
CREATE TABLE table_name_76 (engine VARCHAR,year VARCHAR)
SELECT engine FROM table_name_76 WHERE year = "1999"
What team placed second during the season where Western Australia placed fifth, South Australia placed sixth, and Tasmania placed fourth?
CREATE TABLE table_name_2 (second VARCHAR,fourth VARCHAR,fifth VARCHAR,sixth VARCHAR)
SELECT second FROM table_name_2 WHERE fifth = "western australia" AND sixth = "south australia" AND fourth = "tasmania"
Which away team scored 10.5 (65)?
CREATE TABLE table_11914 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_11914 WHERE "Away team score" = '10.5 (65)'
Name the rating % for channel of anhui satellite tv
CREATE TABLE table_name_73 (rating___percentage_ VARCHAR,channel VARCHAR)
SELECT rating___percentage_ FROM table_name_73 WHERE channel = "anhui satellite tv"
What title did Bill Foster direct ?
CREATE TABLE table_27504 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Title" FROM table_27504 WHERE "Directed by" = 'Bill Foster'
Who won Gold later than 2004 with Notes of 2.73km, 14controls?
CREATE TABLE table_60387 ("Year" real,"Gold" text,"Silver" text,"Bronze" text,"Notes" text)
SELECT "Gold" FROM table_60387 WHERE "Year" > '2004' AND "Notes" = '2.73km, 14controls'
For players whose occupation is not 'Researcher', tell me the distribution of their residences with a bar chart, and could you display by the total number in desc?
CREATE TABLE player (Player_ID int,Sponsor_name text,Player_name text,Gender text,Residence text,Occupation text,Votes int,Rank text)CREATE TABLE player_coach (Player_ID int,Coach_ID int,Starting_year int)CREATE TABLE coach (Coach_ID int,Coach_name text,Gender text,Club_ID int,Rank int)CREATE TABLE match_result (Rank i...
SELECT Residence, COUNT(Residence) FROM player WHERE Occupation <> "Researcher" GROUP BY Residence ORDER BY COUNT(Residence) DESC
how many patients had admission location as clinic referral/premature and diagnoses icd9 code as 25541?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541"
Who was the loser against the New York Giants in 2001?
CREATE TABLE table_name_43 (loser VARCHAR,year VARCHAR,winner VARCHAR)
SELECT loser FROM table_name_43 WHERE year = 2001 AND winner = "new york giants"
Show the name of each party and the corresponding number of delegates from that party with a bar chart, and sort by the bar in asc.
CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,County_name text,Population real,Zip_code text)CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroll...
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party
what is the next cartoon directed by robert mckimson after le quiet squad ?
CREATE TABLE table_203_338 (id number,"#" number,"title" text,"date" text,"director" text,"story" text,"synopsis" text,"notes" text)
SELECT "title" FROM table_203_338 WHERE "director" = 'robert mckimson' AND "date" > (SELECT "date" FROM table_203_338 WHERE "title" = 'le quiet squad') ORDER BY "date" LIMIT 1
How many uninterrupted ranks does john dingell have?
CREATE TABLE table_name_87 (uninterrupted_rank VARCHAR,name VARCHAR)
SELECT COUNT(uninterrupted_rank) FROM table_name_87 WHERE name = "john dingell"
What's the record of Carlos Boozer (23) as the leading scorer?
CREATE TABLE table_56465 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text)
SELECT "Record" FROM table_56465 WHERE "Leading scorer" = 'carlos boozer (23)'
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and employee_id , and list Y in descending order.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME...
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
The highest position with more than 16 points and less than 7 concedes?
CREATE TABLE table_name_40 (position INTEGER,points VARCHAR,conceded VARCHAR)
SELECT MAX(position) FROM table_name_40 WHERE points > 16 AND conceded < 7
what's the mascot for 66 pulaski 2?
CREATE TABLE table_name_39 (mascot VARCHAR,_number___county VARCHAR)
SELECT mascot FROM table_name_39 WHERE _number___county = "66 pulaski 2"
Find the states where have some college students in tryout.
CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number)
SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname
Create a bar chart showing the total number across denomination
CREATE TABLE school_performance (School_Id int,School_Year text,Class_A text,Class_AA text)CREATE TABLE school_details (School_ID int,Nickname text,Colors text,League text,Class text,Division text)CREATE TABLE player (Player_ID int,Player text,Team text,Age int,Position text,School_ID int)CREATE TABLE school (School_ID...
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination
What is the lowest official ITV1 rating with 45.4% share?
CREATE TABLE table_name_32 (official_itv1_rating INTEGER,share VARCHAR)
SELECT MIN(official_itv1_rating) FROM table_name_32 WHERE share = "45.4%"
what is the fare from PHILADELPHIA to PITTSBURGH BUSINESS class one way
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name va...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
what were the first creatine kinase (ck) from patient 96833 in the current hospital visit?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') ORDER BY labevents.chart...
Show me a bar chart for how many faculty members do we have for each faculty rank?, and list by the total number in ascending.
CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Participates_in (stuid INTEG...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*)
How much money did Willie Klein take home from the game in which he had a to par score larger than 13?
CREATE TABLE table_62381 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" real)
SELECT SUM("Money ( $ )") FROM table_62381 WHERE "Player" = 'willie klein' AND "To par" > '13'
What is the Total for the Player with a To par of +11?
CREATE TABLE table_61341 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT MAX("Total") FROM table_61341 WHERE "To par" = '+11'
What rank is the title with a gross of $26,589,355?
CREATE TABLE table_name_21 (rank VARCHAR,gross VARCHAR)
SELECT rank FROM table_name_21 WHERE gross = "$26,589,355"
Who was the illustrator in 1987?
CREATE TABLE table_40471 ("Year" real,"Author" text,"Illustrator" text,"Title" text,"Publisher" text)
SELECT "Illustrator" FROM table_40471 WHERE "Year" = '1987'
Who was the girl on week 1 that preceded week 2's Kamila Sulewska?
CREATE TABLE table_61246 ("Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text)
SELECT "Week 1" FROM table_61246 WHERE "Week 2" = 'kamila sulewska'
What is the mecha with a condor bird uniform?
CREATE TABLE table_5645 ("Gatchaman" text,"Battle of the Planets" text,"G-Force" text,"Eagle Riders" text,"OVA (Harmony Gold Dub)" text,"Rank" text,"Bird Uniform" text,"Weapon" text,"Mecha" text,"Japanese voice actor" text,"Voice actor (BOTP)" text,"Voice actor (G-Force)" text,"Voice actor (Harmony Gold OVA Dub)" text,...
SELECT "Mecha" FROM table_5645 WHERE "Bird Uniform" = 'condor'
age > 75 years
CREATE TABLE table_train_208 ("id" int,"anemia" bool,"serum_bicarbonate" int,"hemoglobin_a1c_hba1c" float,"temperature" float,"dementia" bool,"electrolyte_imbalances" bool,"impaired_sensorium" bool,"age" float,"NOUSE" float)
SELECT * FROM table_train_208 WHERE age > 75
What is the Area with 26 in Roll
CREATE TABLE table_name_63 (area VARCHAR,roll VARCHAR)
SELECT area FROM table_name_63 WHERE roll = 26
What episode was seen by 2.05 million viewers?
CREATE TABLE table_16602 ("No." real,"Episode" text,"Air Date" text,"Timeslot" text,"Rating" text,"Share" text,"18\u201349 (Rating/Share)" text,"Viewers (m)" text,"Rank (#)" text)
SELECT "Episode" FROM table_16602 WHERE "Viewers (m)" = '2.05'
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart, and rank in desc by the bars.
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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
get top protected questions by tag.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE ...
SELECT 'post_link' = Posts.Id, Posts.ViewCount, Posts.Score, Tags.TagName AS "tag_name" FROM PostHistory INNER JOIN PostTags ON PostTags.PostId = PostHistory.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE PostHistory.PostHistoryTypeId = 19 AND Tags.TagName = @Tag...
What club had 523 points against?
CREATE TABLE table_18955 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Points" text)
SELECT "Club" FROM table_18955 WHERE "Points against" = '523'
how many athletes did not finish with the time less than 53.00 ?
CREATE TABLE table_204_937 (id number,"rank" number,"lane" number,"athlete" text,"time" number)
SELECT COUNT("athlete") FROM table_204_937 WHERE "time" >= 53
On what Date is the Circuit at Sandown Raceway?
CREATE TABLE table_4948 ("Race Title" text,"Circuit" text,"City / State" text,"Date" text,"Winner" text)
SELECT "Date" FROM table_4948 WHERE "Circuit" = 'sandown raceway'
show me all UA flights from DENVER to SAN FRANCISCO for 9 1 1991
CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 9...
how many times did the team play at home but did not win ?
CREATE TABLE table_204_151 (id number,"game" number,"day" text,"date" text,"kickoff" text,"opponent" text,"results\nscore" text,"results\nrecord" text,"location" text,"attendance" number)
SELECT COUNT(*) FROM table_204_151 WHERE "opponent" = 'home' AND "results\nscore" <> 'w'
calculate the number of patients to whom lidocaine 5% patch was administered when admitted to emergency.
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,short_title text,long_title 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.admission_type = "EMERGENCY" AND prescriptions.drug = "Lidocaine 5% Patch"
What year had Best Actor in a Musical as a category?
CREATE TABLE table_name_15 (year INTEGER,category VARCHAR)
SELECT SUM(year) FROM table_name_15 WHERE category = "best actor in a musical"
where did rochdale play as opponent?
CREATE TABLE table_53610 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT "Venue" FROM table_53610 WHERE "Opponent" = 'rochdale'
Find journals about Neutralizing Antibody Languages .
CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE pa...
SELECT DISTINCT paper.journalid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Neutralizing Antibody Languages' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.journalid
how many prisons are in nubarashen ?
CREATE TABLE table_204_414 (id number,"name" text,"armenian" text,"location" text,"# of prisoners designed for" number,"notes" text)
SELECT COUNT("name") FROM table_204_414 WHERE "location" = 'nubarashen'
What is the Date of the Event in Punta del Este?
CREATE TABLE table_49359 ("Date" text,"City" text,"Event" text,"Winner" text,"Prize" text)
SELECT "Date" FROM table_49359 WHERE "City" = 'punta del este'
Who read the unabridged book written by Gary Paulsen?
CREATE TABLE table_7116 ("Title" text,"Author" text,"Un-/Abridged" text,"Read by" text,"Published" text)
SELECT "Read by" FROM table_7116 WHERE "Un-/Abridged" = 'unabridged' AND "Author" = 'gary paulsen'
What is the earliest year with points more than 8?
CREATE TABLE table_15248 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Pts." real)
SELECT MIN("Year") FROM table_15248 WHERE "Pts." > '8'
What's the score on April 9?
CREATE TABLE table_33987 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Score" FROM table_33987 WHERE "Date" = 'april 9'
Which season had a Regionalliga Sud of Stuttgarter Kickers?
CREATE TABLE table_5600 ("Season" text,"Regionalliga S\u00fcd" text,"Regionalliga West/S\u00fcdwest" text,"Regionalliga Nord" text,"Regionalliga Nord-Ost" text)
SELECT "Season" FROM table_5600 WHERE "Regionalliga S\u00fcd" = 'stuttgarter kickers'
what is age and diagnoses icd9 code of subject id 42067?
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,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067"
in 12/this year protonix, ondansetron inj or lisinopril have been prescribed for patient 012-37411?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dos...
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 = '012-37411')) AND medication.drugname IN ('protonix', 'ondansetron inj', 'l...
Which team/s have 48 goals total?
CREATE TABLE table_18967450_2 (club VARCHAR,goals VARCHAR)
SELECT club FROM table_18967450_2 WHERE goals = 48
How many races took place on the Indianapolis Motor Speedway track?
CREATE TABLE table_25240 ("Rnd" real,"Date" text,"Race Name" text,"Length" text,"Track" text,"Location" text,"Type" text,"Pole Position" text,"Winning Driver" text)
SELECT COUNT("Race Name") FROM table_25240 WHERE "Track" = 'Indianapolis Motor Speedway'
what is admission time and diagnoses long title of subject id 2560?
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 demographic.admittime, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
Who were the opponents of the final on June 23, 2003?
CREATE TABLE table_56425 ("Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponents in the final" text,"Score" text)
SELECT "Opponents in the final" FROM table_56425 WHERE "Date" = 'june 23, 2003'
Provide the number of patients with bradycardia as their primary disease who were hospitalized for more than 5 days.
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.days_stay > "5"
what is the name of the medication that was last prescribed to patient 26507 during the last month?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 admissions (row_id n...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26507) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1
What is the smallest number of runs?
CREATE TABLE table_28275 ("Rank" real,"Runs" real,"Average" text,"Strike rate" text,"Player" text,"Matches" real,"Innings" real,"Period" text)
SELECT MIN("Runs") FROM table_28275
What's the total number of league cup apps when the league goals were less than 0?
CREATE TABLE table_64988 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" real,"FA Cup Goals" real,"League Cup Apps" real,"League Cup Goals" real,"Total Apps" text,"Total Goals" real)
SELECT COUNT("League Cup Apps") FROM table_64988 WHERE "League Goals" < '0'
In what round was the loss at ufc 118?
CREATE TABLE table_66696 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Round" FROM table_66696 WHERE "Res." = 'loss' AND "Event" = 'ufc 118'
When zachary sanders is the performer what is the lowerst first aired?
CREATE TABLE table_191105_3 (first_aired INTEGER,performed_by VARCHAR)
SELECT MIN(first_aired) FROM table_191105_3 WHERE performed_by = "Zachary Sanders"
What is the Quarterback rating of the player who got a comp percentage of 62.0?
CREATE TABLE table_22548 ("Rank" real,"Name" text,"Tenure" text,"Leagues" text,"Attempts" real,"Completions" real,"Comp %" text,"Touchdowns" real,"Interceptions" real,"Yardage" real,"QB Rating" text)
SELECT "QB Rating" FROM table_22548 WHERE "Comp %" = '62.0'
For the sale details with amount smaller than 3000, visualize a bar chart that x-axis is the sales details and count them as y, I want to sort by the Y in desc.
CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Lots (lot_id INTEGER,investor_id INTEGER,lot_details VARCHAR(255))CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Investors (investor_id INTEGER,Investor_details VARCHAR(255))CREAT...
SELECT sales_details, COUNT(sales_details) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 GROUP BY sales_details ORDER BY COUNT(sales_details) DESC
What is the record for Norway on 23 august 1981?
CREATE TABLE table_name_56 (record VARCHAR,nationality VARCHAR,date VARCHAR)
SELECT record FROM table_name_56 WHERE nationality = "norway" AND date = "23 august 1981"
What is the sum of Rank with a build year earlier than 2007 for the howard johnson hotel bucharest?
CREATE TABLE table_35773 ("Rank" real,"Building" text,"City" text,"Height (m/ft)" text,"Built" real)
SELECT SUM("Rank") FROM table_35773 WHERE "Built" < '2007' AND "Building" = 'howard johnson hotel bucharest'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time, and list by the sum employee id in ascending please.
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,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 (DEP...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID)
List all the places that the Apocalypstix occupied when the Denim Demons were 2nd.
CREATE TABLE table_29619494_2 (apocalypstix VARCHAR,denim_demons VARCHAR)
SELECT apocalypstix FROM table_29619494_2 WHERE denim_demons = "2nd"
Who was the athlete with a wind of 1.8?
CREATE TABLE table_79418 ("Time" text,"Wind" text,"Athlete" text,"Nationality" text,"Location of race" text,"Date" text)
SELECT "Athlete" FROM table_79418 WHERE "Wind" = '1.8'
Which player has a to par of +8?
CREATE TABLE table_63803 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "Player" FROM table_63803 WHERE "To par" = '+8'
How many win total which has the rank smaller than 3 and events smaller than 22
CREATE TABLE table_name_71 (wins VARCHAR,events VARCHAR,rank VARCHAR)
SELECT COUNT(wins) FROM table_name_71 WHERE events < 22 AND rank < 3
when was the first year of rugby of the terrapins ?
CREATE TABLE table_204_442 (id number,"institution" text,"location" text,"enrollment" number,"nickname" text,"varsity\nsports" number,"rugby\nsince" text,"head coach" text)
SELECT "rugby\nsince" FROM table_204_442 WHERE "nickname" = 'terrapins'
In what Year is Keith Smith's Cross Code Debut RL Test v Wales?
CREATE TABLE table_64940 ("Player" text,"Int'l Debut" text,"Year" text,"Cross Code Debut" text,"Date" text)
SELECT "Year" FROM table_64940 WHERE "Cross Code Debut" = 'rl test v wales' AND "Player" = 'keith smith'
which two teams had the most draws ?
CREATE TABLE table_204_314 (id number,"pos" number,"team" text,"played" number,"won" number,"draw" number,"lost" number,"goals for" number,"goals against" number,"goal difference" number,"points" number,"notes" text)
SELECT "team" FROM table_204_314 WHERE "draw" = (SELECT MAX("draw") FROM table_204_314)
what has been the last song this artist has made an other appearance on ?
CREATE TABLE table_204_643 (id number,"release" number,"artist" text,"title" text,"notes" text,"album" text)
SELECT "title" FROM table_204_643 ORDER BY id DESC LIMIT 1
Events larger than 22, and a Earnings ( $ ) of 1,543,192, and a Rank smaller than 2 has the lowest wins?
CREATE TABLE table_38144 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Events" real,"Wins" real)
SELECT MIN("Wins") FROM table_38144 WHERE "Events" > '22' AND "Earnings ( $ )" = '1,543,192' AND "Rank" < '2'
Of the upper level elective classes that are taking place next semester , which ones do n't meet on Fridays ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ...
What is the sum of the weeks on a chart a song with a position less than 1 haas?
CREATE TABLE table_name_92 (weeks_on_chart INTEGER,position INTEGER)
SELECT SUM(weeks_on_chart) FROM table_name_92 WHERE position < 1
what is the affiliation of the hilltoppers mascot?
CREATE TABLE table_20887670_1 (affiliation VARCHAR,mascot VARCHAR)
SELECT affiliation FROM table_20887670_1 WHERE mascot = "Hilltoppers"
how many patients whose discharge location is rehab/distinct part hosp and primary disease is coronary artery disease?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
When Jeb Barlow was picked in round smaller than 7, how many player in totals were picked?
CREATE TABLE table_name_67 (pick VARCHAR,player VARCHAR,round VARCHAR)
SELECT COUNT(pick) FROM table_name_67 WHERE player = "jeb barlow" AND round < 7
Which Home team has a Home team score of 7.8 (50)?
CREATE TABLE table_10213 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_10213 WHERE "Home team score" = '7.8 (50)'
Which democratic incumbent is from the district of ohio 7?
CREATE TABLE table_name_93 (incumbent VARCHAR,party VARCHAR,district VARCHAR)
SELECT incumbent FROM table_name_93 WHERE party = "democratic" AND district = "ohio 7"
What is the 1993 value of the 1997 Grand Slams?
CREATE TABLE table_34223 ("Tournament" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"Career SR" text,"Career Win-Loss" text)
SELECT "1993" FROM table_34223 WHERE "1997" = 'grand slams'
Where was the match held on July 17, 1999?
CREATE TABLE table_name_43 (venue VARCHAR,date VARCHAR)
SELECT venue FROM table_name_43 WHERE date = "july 17, 1999"
Show names of musicals and the number of actors who have appeared in the musicals in a bar chart, and could you rank from high to low by the bars?
CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC
What is the average round in which a Safety with an overall rank higher than 89 was drafted?
CREATE TABLE table_name_41 (round INTEGER,position VARCHAR,overall VARCHAR)
SELECT AVG(round) FROM table_name_41 WHERE position = "safety" AND overall > 89