instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
when was the last time that was patient 027-82318 had the maximum calcium during their current hospital visit?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'calcium' ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the last_name by a bar chart, display by the Y in descending please.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME va...
SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC
what is the name moving to atl tico minero?
CREATE TABLE table_59442 ("Nat." text,"Name" text,"Moving to" text,"Type" text,"Transfer window" text)
SELECT "Name" FROM table_59442 WHERE "Moving to" = 'atlético minero'
provide the number of patients whose death status is 0 and procedure short title is exc/des hrt les,endovasc?
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.expire_flag = "0" AND procedures.short_title = "Exc/des hrt les,endovasc"
Which are the upper elective courses offered for CS ?
CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instru...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
what is the total number of schools that are now vacant ?
CREATE TABLE table_203_40 (id number,"p.s. #" number,"school name" text,"neighborhood" text,"low grade" text,"high grade" number,"year closed" text,"building status" text)
SELECT COUNT("school name") FROM table_203_40 WHERE "building status" = 'vacant'
Where was the game played when the score was 14.16 (100)-12.12 (84)?
CREATE TABLE table_27219 ("Round" text,"Opposition" text,"Time" text,"Date" text,"Home/Away" text,"Venue" text,"Score" text,"Result/Margin" text,"Broadcaster" text,"TV" text,"Ladder Position" text)
SELECT "Venue" FROM table_27219 WHERE "Score" = '14.16 (100)-12.12 (84)'
Who are the opponents for games on Sunday, June 9?
CREATE TABLE table_24918268_2 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_24918268_2 WHERE date = "Sunday, June 9"
Which rampage killed 8 in Israel?
CREATE TABLE table_name_44 (name VARCHAR,killed VARCHAR,country VARCHAR)
SELECT name FROM table_name_44 WHERE killed = "8" AND country = "israel"
tell me the first value of creatinine in a lab test of patient 30307 in 10/this year?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id n...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30307) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE...
How frequently does THTREMUS 370 meet for class ?
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_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE ta (campus_job_id int,student_id int,location var...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
What is the name of the person with a 2008 club of Nc Bejaia?
CREATE TABLE table_44040 ("Name" text,"Height" text,"Weight" text,"Spike" text,"2008 club" text)
SELECT "Name" FROM table_44040 WHERE "2008 club" = 'nc bejaia'
Up and downvotes for site users.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTask...
SELECT DisplayName, Reputation, UpVotes, DownVotes, UpVotes + DownVotes AS TotalVotes, ROUND(UpVotes * 1.0 / (DownVotes + UpVotes) * 100.0, 1) AS UpvotePercentage FROM Users WHERE UpVotes + DownVotes > 0 ORDER BY ROUND(UpVotes * 1.0 / (DownVotes + UpVotes) * 100.0, 1)
what was the total amount of blood loss that patient 022-82169 had on 10/23/2102.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text...
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 = '022-82169')) AND intakeoutput.celllabel = 'blood...
If the Away team score was 14.10 (94), which Date was that?
CREATE TABLE table_54571 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_54571 WHERE "Away team score" = '14.10 (94)'
What are the names and countries of origin for the artists who produced the top three highly rated songs.
CREATE TABLE song (artist_name VARCHAR,rating VARCHAR)CREATE TABLE artist (artist_name VARCHAR,country VARCHAR)
SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3
What is the Circuit in the ATCC Round 1 Series with Winner Jim Richards?
CREATE TABLE table_79664 ("Date" text,"Series" text,"Circuit" text,"City / State" text,"Winner" text,"Team" text)
SELECT "Circuit" FROM table_79664 WHERE "Winner" = 'jim richards' AND "Series" = 'atcc round 1'
Name the date with chicago visiting
CREATE TABLE table_name_64 (date VARCHAR,visitor VARCHAR)
SELECT date FROM table_name_64 WHERE visitor = "chicago"
What is the lowest evening score of the contestant with an evening gown less than 8.938, from Texas, and with an average less than 8.846 has?
CREATE TABLE table_78234 ("State" text,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real)
SELECT MIN("Interview") FROM table_78234 WHERE "Evening Gown" < '8.938' AND "State" = 'texas' AND "Average" < '8.846'
What's the total Lost with Games that's less than 4?
CREATE TABLE table_35014 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real)
SELECT SUM("Lost") FROM table_35014 WHERE "Games" < '4'
Name the hypotenuse for vertices ymf
CREATE TABLE table_27727 ("Number" real,"Name" text,"Vertices" text,"Hypotenuse 0 c" text,"Vertical 0 b" text,"Horizontal 0 a" text)
SELECT "Hypotenuse 0 c" FROM table_27727 WHERE "Vertices" = '月山泛 ΔYMF'
Name the mixed doubles when tour is hong kong super series
CREATE TABLE table_14496232_2 (mixed_doubles VARCHAR,tour VARCHAR)
SELECT mixed_doubles FROM table_14496232_2 WHERE tour = "Hong Kong Super Series"
what nationality is the player who played from 1997-98
CREATE TABLE table_10015132_7 (nationality VARCHAR,years_in_toronto VARCHAR)
SELECT nationality FROM table_10015132_7 WHERE years_in_toronto = "1997-98"
What score occurred when the save was ||27,108||63 44?
CREATE TABLE table_11955 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text)
SELECT "Score" FROM table_11955 WHERE "Save" = '||27,108||63–44'
How many times was the overall attendance 17807?
CREATE TABLE table_2771237_1 (overall_attendance VARCHAR,average_attendance VARCHAR)
SELECT COUNT(overall_attendance) FROM table_2771237_1 WHERE average_attendance = 17807
What is the total value for Lost, when the value for Points is greater than 21, and when the value for Draw is 2?
CREATE TABLE table_69121 ("Place" real,"Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" real)
SELECT SUM("Lost") FROM table_69121 WHERE "Points" > '21' AND "Draw" = '2'
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and employee_id , and order FIRST_NAME in descending order.
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 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),CO...
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 FIRST_NAME DESC
On the Date of 15 June 1992 what is the Score that is listed?
CREATE TABLE table_name_73 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_73 WHERE date = "15 june 1992"
Name the mosst finals apps
CREATE TABLE table_73257 ("Name" text,"Nationality" text,"from" real,"to" text,"League Apps" real,"League Goals" real,"Finals Apps" real,"Finals Goals" real,"Position" text)
SELECT MAX("Finals Apps") FROM table_73257
Name the week 3 with week 6 of 31+40=71
CREATE TABLE table_75059 ("Team" text,"Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text,"Week 6" text,"Week 7" text,"Week 8 Final" text)
SELECT "Week 3" FROM table_75059 WHERE "Week 6" = '31+40=71'
Which Record has the Res of win with the Event of extreme fighting 1?
CREATE TABLE table_name_30 (record VARCHAR,res VARCHAR,event VARCHAR)
SELECT record FROM table_name_30 WHERE res = "win" AND event = "extreme fighting 1"
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter, and list in descending by the y axis.
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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) DESC
List all club names in ascending order of start year.
CREATE TABLE club (club_id number,name text,region text,start_year text)CREATE TABLE competition (competition_id number,year number,competition_type text,country text)CREATE TABLE club_rank (rank number,club_id number,gold number,silver number,bronze number,total number)CREATE TABLE player (player_id number,name text,p...
SELECT name FROM club ORDER BY start_year
What is the position of player Tobias Lindberg?
CREATE TABLE table_17211 ("Round" real,"Overall" text,"Player" text,"Position" text,"Nationality" text,"Club team" text)
SELECT "Position" FROM table_17211 WHERE "Player" = 'Tobias Lindberg'
What is the highest lost number of the team with less than 14 points and less than 18 played?
CREATE TABLE table_name_65 (lost INTEGER,points VARCHAR,played VARCHAR)
SELECT MAX(lost) FROM table_name_65 WHERE points < 14 AND played < 18
what is the admisson type and diagnosis for patient name francis baseler?
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 demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Francis Baseler"
Which Catalog was formated as a CD under the label Alfa Records?
CREATE TABLE table_80055 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Catalog" FROM table_80055 WHERE "Label" = 'alfa records' AND "Format" = 'cd'
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order y-axis 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC
Where did Darius Hamilton go?
CREATE TABLE table_17110 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT "School" FROM table_17110 WHERE "Player" = 'Darius Hamilton'
Which opponent has a time of 2:35?
CREATE TABLE table_38728 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Opponent" FROM table_38728 WHERE "Time" = '2:35'
how many hours have passed since first time on this hospital encounter patient 032-24135 stayed in the ward 1068?
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '032-24135' AND patient.wardid = 1068 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
What is British, when Examples is 'November, rotunda, colossus, proscenium'?
CREATE TABLE table_name_12 (british VARCHAR,examples VARCHAR)
SELECT british FROM table_name_12 WHERE examples = "november, rotunda, colossus, proscenium"
What was the nationality of the player with a score of 72-72-67=211?
CREATE TABLE table_name_38 (country VARCHAR,score VARCHAR)
SELECT country FROM table_name_38 WHERE score = 72 - 72 - 67 = 211
Which round goes to Stanford college?
CREATE TABLE table_name_21 (round VARCHAR,college VARCHAR)
SELECT round FROM table_name_21 WHERE college = "stanford"
What are the statuses of the platelet counts for the conditions where the prothrombin time and partial thromboblastin time is unaffected?
CREATE TABLE table_20592988_1 (platelet_count VARCHAR,prothrombin_time VARCHAR,partial_thromboplastin_time VARCHAR)
SELECT platelet_count FROM table_20592988_1 WHERE prothrombin_time = "Unaffected" AND partial_thromboplastin_time = "Unaffected"
What was the height of representative #6?
CREATE TABLE table_30272 ("Represent" real,"Contestant" text,"Age" real,"Height" text,"Hometown" text,"Sponsor" text)
SELECT "Height" FROM table_30272 WHERE "Represent" = '6'
how many patients have stayed in the hospital for more than 2 days with additive drug type?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "ADDITIVE"
Which Value has a Ratio as % of 100%?
CREATE TABLE table_40437 ("Band" text,"Value" text,"Ratio" text,"Ratio as %" text,"Average" text)
SELECT "Value" FROM table_40437 WHERE "Ratio as %" = '100%'
If the catches is 131, what is the rank total number?
CREATE TABLE table_26041144_16 (rank VARCHAR,catches VARCHAR)
SELECT COUNT(rank) FROM table_26041144_16 WHERE catches = 131
Show the names and details of all the staff members.
CREATE TABLE ref_attraction_types (attraction_type_code text,attraction_type_description text)CREATE TABLE theme_parks (theme_park_id number,theme_park_details text)CREATE TABLE museums (museum_id number,museum_details text)CREATE TABLE staff (staff_id number,tourist_attraction_id number,name text,other_details text)CR...
SELECT name, other_details FROM staff
When was the first year he placed 2nd in Izmir, Turkey?
CREATE TABLE table_name_3 (year INTEGER,result VARCHAR,venue VARCHAR)
SELECT MIN(year) FROM table_name_3 WHERE result = "2nd" AND venue = "izmir, turkey"
What was the week 12 standing for the housemate that nominated Deepak P Rahul in week 1 and Amit Carol in week 3?
CREATE TABLE table_name_8 (Final VARCHAR,week_1 VARCHAR,week_3 VARCHAR)
SELECT Final AS week_12 FROM table_name_8 WHERE week_1 = "deepak p rahul" AND week_3 = "amit carol"
Which network broadcast the game when the Western Bulldogs played melbourne?
CREATE TABLE table_24919137_2 (broadcaster VARCHAR,opposition VARCHAR)
SELECT broadcaster FROM table_24919137_2 WHERE opposition = "Melbourne"
Name the horizontal 0 for tong
CREATE TABLE table_27729 ("Number" real,"Name" text,"Vertices" text,"Hypotenuse 0 c" text,"Vertical 0 b" text,"Horizontal 0 a" text)
SELECT "Horizontal 0 a" FROM table_27729 WHERE "Name" = '通 TONG'
With the given points of 667, what was the number of tries against?
CREATE TABLE table_1752 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Tries against" FROM table_1752 WHERE "Points for" = '667'
What is the maximum ITV1 weekly ranking?
CREATE TABLE table_25664518_3 (itv1_weekly_ranking INTEGER)
SELECT MAX(itv1_weekly_ranking) FROM table_25664518_3
What is the Score on November 23, 1946 with Washington Capitols Home team?
CREATE TABLE table_name_91 (score VARCHAR,home VARCHAR,date VARCHAR)
SELECT score FROM table_name_91 WHERE home = "washington capitols" AND date = "november 23, 1946"
What is the lowest rank for El Paso Natural Gas Company Building?
CREATE TABLE table_64743 ("Rank" real,"Name" text,"Height ft (m)" text,"Floors" real,"Year" real)
SELECT MIN("Rank") FROM table_64743 WHERE "Name" = 'el paso natural gas company building'
Search Comments for String by User.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE...
SELECT Id AS "comment_link", Score, CreationDate, PostId AS "post_link" FROM Comments WHERE UserId = '##UserID##' AND UPPER(Text) LIKE '%' + @pattern + '%' ORDER BY CreationDate DESC
What was the Record for the game on October 30?
CREATE TABLE table_name_8 (record VARCHAR,date VARCHAR)
SELECT record FROM table_name_8 WHERE date = "october 30"
List the number of ramsan-720 hard drives?
CREATE TABLE table_27615520_1 (storage_medium VARCHAR,product_name VARCHAR)
SELECT COUNT(storage_medium) FROM table_27615520_1 WHERE product_name = "RamSan-720"
What was the episode number that had 797000 viewers?
CREATE TABLE table_25737761_3 (no VARCHAR,viewing_figure VARCHAR)
SELECT no FROM table_25737761_3 WHERE viewing_figure = 797000
Create a bar chart showing the total number across party
CREATE TABLE driver (Driver_ID int,Name text,Party text,Home_city text,Age int)CREATE TABLE school_bus (School_ID int,Driver_ID int,Years_Working int,If_full_time bool)CREATE TABLE school (School_ID int,Grade text,School text,Location text,Type text)
SELECT Party, COUNT(*) FROM driver GROUP BY Party
Top 50 question askers in MSE.
CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT OwnerUserId AS "user_link", COUNT(*) AS QuestionsCount FROM Posts WHERE NOT OwnerUserId IS NULL AND OwnerUserId != -1 GROUP BY OwnerUserId ORDER BY COUNT(*) DESC LIMIT 50
What was the number of the game played on February 24?
CREATE TABLE table_name_29 (game INTEGER,date VARCHAR)
SELECT SUM(game) FROM table_name_29 WHERE date = "february 24"
How many acting statuses are there?
CREATE TABLE head (head_id number,name text,born_state text,age number)CREATE TABLE management (department_id number,head_id number,temporary_acting text)CREATE TABLE department (department_id number,name text,creation text,ranking number,budget_in_billions number,num_employees number)
SELECT COUNT(DISTINCT temporary_acting) FROM management
A bar chart for what are the number of the dates that have an average sea level pressure between 30.3 and 31?
CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
PITTSBURGH to DENVER
CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion va...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN...
What was the name of the episode Alan Yang wrote?
CREATE TABLE table_25341765_1 (title VARCHAR,written_by VARCHAR)
SELECT title FROM table_25341765_1 WHERE written_by = "Alan Yang"
Name the score with record of 17-27
CREATE TABLE table_name_6 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_6 WHERE record = "17-27"
What is the value in 2008 when 1R is 2009 and 3R?
CREATE TABLE table_4979 ("Tournament" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2012" text,"2013" text)
SELECT "2008" FROM table_4979 WHERE "2009" = '1r' AND "2006" = '3r'
What was the location and attendance on the May 22 game?
CREATE TABLE table_55603 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Location Attendance" FROM table_55603 WHERE "Date" = 'may 22'
Name the total number of attendance for october 8
CREATE TABLE table_68733 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Series" text)
SELECT COUNT("Attendance") FROM table_68733 WHERE "Date" = 'october 8'
How many dorms are there?
CREATE TABLE dorm (Id VARCHAR)
SELECT COUNT(*) FROM dorm
count the number of patients whose ethnicity is black/cape verdean and age is less than 68.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "68"
What county has a Median family income of $37,667?
CREATE TABLE table_name_95 (county VARCHAR,median_family_income VARCHAR)
SELECT county FROM table_name_95 WHERE median_family_income = "$37,667"
what is the number of patients whose admission type is emergency and with lab test name lymphocytes percent?
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.admission_type = "EMERGENCY" AND lab.label = "Lymphocytes, Percent"
RU SO questions without body.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBase...
SELECT * FROM Posts WHERE (SELECT COUNT(*) FROM PostHistory WHERE PostId = Posts.Id AND (PostHistoryTypeId = 2 OR PostHistoryTypeId = 5)) = 0 AND Body = Title
What is the page count and word count greater than 5 with Bits of 18 22?
CREATE TABLE table_name_79 (page__number VARCHAR,word__number VARCHAR,bits VARCHAR)
SELECT page__number FROM table_name_79 WHERE word__number > 5 AND bits = "18–22"
Name the towns/villages for budapest
CREATE TABLE table_20653 ("Name of county" text,"County seat" text,"Area (km\u00b2)" real,"Population" real,"Population density" real,"Towns/ villages" real)
SELECT "Towns/ villages" FROM table_20653 WHERE "County seat" = 'Budapest'
What is the central word for 'robbers'?
CREATE TABLE table_26614365_1 (central VARCHAR,english VARCHAR)
SELECT central FROM table_26614365_1 WHERE english = "robbers"
How many people per km2 are there in the municipality whose mayor is Boy Quiat?
CREATE TABLE table_24557 ("Municipality" text,"Type" text,"District" text,"Area (km\u00b2)" text,"Population (2010)" real,"Pop. Density (per km\u00b2)" text,"No. of Barangays" real,"Municipal Mayor" text)
SELECT "Pop. Density (per km\u00b2)" FROM table_24557 WHERE "Municipal Mayor" = 'Boy Quiat'
Is MUSICOL 566 offered every semester ?
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 COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'MUSICOL' AND COURSEalias0.numbe...
What is the GDP % of EU in 2012 of the country with a GDP in billions of USD in 2012 of 256.3?
CREATE TABLE table_name_19 (gdp__percentage_of_eu__2012_ VARCHAR,gdp_in_s_billion_of_usd__2012_ VARCHAR)
SELECT gdp__percentage_of_eu__2012_ FROM table_name_19 WHERE gdp_in_s_billion_of_usd__2012_ = 256.3
Who performed with Tina Parekh?
CREATE TABLE table_18278508_2 (main_contestant VARCHAR,co_contestant__yaar_vs_pyaar_ VARCHAR)
SELECT main_contestant FROM table_18278508_2 WHERE co_contestant__yaar_vs_pyaar_ = "Tina Parekh"
Player Craig Parry of Australia is in what place number?
CREATE TABLE table_name_86 (place VARCHAR,country VARCHAR,player VARCHAR)
SELECT place FROM table_name_86 WHERE country = "australia" AND player = "craig parry"
Ranking de usuarios en Per.
CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT t.RANK, t."user", t.Location, t.Reputation FROM (SELECT Id, ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "rank", DisplayName AS "user", 'location', 'reputation' FROM Users WHERE LOWER(Location) LIKE '%peru%') AS t WHERE t.Id = 78168
Distribution of Flagged Posts by Time (Hours) to first flag.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayN...
SELECT diff1, COUNT(*) FROM (SELECT d1, d2, TIME_TO_STR(d1, '%y-%m') AS "d1f", (12 + CAST((JULIANDAY(d2) - JULIANDAY(d1)) * 24.0 AS INT)) AS "diff1" FROM (SELECT p.Id, MIN(p.CreationDate) AS d1, MIN(r.CreationDate) AS d2 FROM Posts AS p INNER JOIN ReviewTasks AS r ON r.PostId = p.Id WHERE p.PostTypeId = 1 OR p.PostType...
when was the first time that patient 015-12842 on the last icu visit had a heartrate that was less than 58.0?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean num...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-12842') AND NOT patient.unitdischargetime IS NU...
On what date is there a score1 of 2 - 4 with the opponent Chelsea under 18s?
CREATE TABLE table_64440 ("Match" real,"Date" text,"Competition or tour" text,"Ground" text,"Opponent" text,"Score1" text)
SELECT "Date" FROM table_64440 WHERE "Score1" = '2 - 4' AND "Opponent" = 'chelsea under 18s'
The episode with the original air date January 6, 1999, has what production code?
CREATE TABLE table_2618152_1 (production_code VARCHAR,original_air_date VARCHAR)
SELECT production_code FROM table_2618152_1 WHERE original_air_date = "January 6, 1999"
What is the earliest year when action was the genre?
CREATE TABLE table_64967 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text)
SELECT MIN("Year") FROM table_64967 WHERE "Genre" = 'action'
what is the number of patients whose year of death is less than or equal to 2111 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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Urine"
What is the largest number of stories in Recife completed later than 2007 with a height less than 135 meters?
CREATE TABLE table_name_38 (stories INTEGER,height__m_ VARCHAR,location VARCHAR,year_of_completion VARCHAR)
SELECT MAX(stories) FROM table_name_38 WHERE location = "recife" AND year_of_completion > 2007 AND height__m_ < 135
what are all of the flights into and out of ATLANTA 's airport
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE ground_service (city_code text,airport_code text,t...
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 (flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA') OR (flight.from_airport ...
What is the description when the reserve is Half Moon Caye?
CREATE TABLE table_name_40 (description VARCHAR,reserve VARCHAR)
SELECT description FROM table_name_40 WHERE reserve = "half moon caye"
show me the airlines between BOSTON and DENVER
CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int...
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
how many patients whose diagnoses long title is anemia in chronic kidney disease?
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 diagnoses.long_title = "Anemia in chronic kidney disease"
What is the name of the nurse has the most appointments?
CREATE TABLE appointment (prepnurse VARCHAR)CREATE TABLE nurse (name VARCHAR,employeeid VARCHAR)
SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1
what model names were dated after 1960 ?
CREATE TABLE table_203_823 (id number,"model name" text,"date" text,"type" text,"thrust (kg) / power (eshp)" text,"fitted to" text)
SELECT "model name" FROM table_203_823 WHERE "date" > 1960