instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
count the number of patients whose admission type is newborn and lab test item id is 50801.
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "50801"
Find all the songs that do not have a lead vocal.
CREATE TABLE albums (aid number,title text,year number,label text,type text)CREATE TABLE performance (songid number,bandmate number,stageposition text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE songs (songid number,title text)CREATE TABLE instruments (songid number,bandmateid num...
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "lead"
Unanswered or non-canon answered HP questions.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT Posts.Title, TagName FROM Tags, Posts WHERE TagName LIKE 'Harry-Potter' LIMIT 50
did patient 031-16123 undergo a cultures - blood procedure?
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 treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND treatment.treatmentname = 'cultures - blood'
what is the number of capacity that mega disk ' o is able to hold ?
CREATE TABLE table_203_873 (id number,"model name" text,"length" text,"width" text,"height" text,"riders" number,"capacity" number,"description" text,"portable" text,"notes" number)
SELECT "capacity" FROM table_203_873 WHERE "model name" = "mega disk'o"
In which division did they compete in 2012?
CREATE TABLE table_22180 ("Season" real,"Average Attendance Home" text,"Highest Attendance Home" text,"Average Attendance Away" text,"Highest Attendance Away" text,"Division / Section" text,"Level" text,"Average Attendance League" text)
SELECT "Division / Section" FROM table_22180 WHERE "Season" = '2012'
i would like an afternoon flight from DENVER COLORADO to DALLAS TEXAS
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop...
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, state AS STATE_0, state AS STATE_1 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...
How many political parties had a %2006 rating of 43.5?
CREATE TABLE table_2421 ("Political parties" text,"% 2006" text,"Seats 2006" real,"% 2001" text,"Seats 2001" real,"% 1997" text)
SELECT COUNT("Political parties") FROM table_2421 WHERE "% 2006" = '43.5'
What is the result for rounds under 2 against D.J. Linderman?
CREATE TABLE table_name_44 (res VARCHAR,round VARCHAR,opponent VARCHAR)
SELECT res FROM table_name_44 WHERE round < 2 AND opponent = "d.j. linderman"
Which Round is the lowest one that has a School/Club Team of virginia?
CREATE TABLE table_name_20 (round INTEGER,school_club_team VARCHAR)
SELECT MIN(round) FROM table_name_20 WHERE school_club_team = "virginia"
Show different nationalities along with the number of hosts of each nationality Visualize by bar chart, I want to list in ascending by the x-axis.
CREATE TABLE party (Party_ID int,Party_Theme text,Location text,First_year text,Last_year text,Number_of_hosts int)CREATE TABLE party_host (Party_ID int,Host_ID int,Is_Main_in_Charge bool)CREATE TABLE host (Host_ID int,Name text,Nationality text,Age text)
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality
what is the highest pick number of the CFL team, the winnipeg blue bombers?
CREATE TABLE table_name_42 (pick__number INTEGER,cfl_team VARCHAR)
SELECT MAX(pick__number) FROM table_name_42 WHERE cfl_team = "winnipeg blue bombers"
count the number of patients who have been dead after having been diagnosed with metabolic acidosis - due to bicarbonate loss during the same hospital visit in a year before.
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
has any microbiological test been performed on patient 55281's sputum in 12/2105?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-12'
Count the average age of patients who are still living with a known history of st elevation myocardial infarction/cardiac catheterization as the primary 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
What studio had the director Peter Lord Nick Park before 2004?
CREATE TABLE table_name_57 (studio_s_ VARCHAR,year VARCHAR,director VARCHAR)
SELECT studio_s_ FROM table_name_57 WHERE year < 2004 AND director = "peter lord nick park"
count the number of patients who were prescribed lr within 2 months after being diagnosed with crnry athrscl natve vssl since 2105.
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE admissions (row_id nu...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natv...
What is the Game with a Record of 19-15?
CREATE TABLE table_66647 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text)
SELECT "Game" FROM table_66647 WHERE "Record" = '19-15'
What is the lowest Total, when Silver is greater than 7, and when Gold is greater than 73?
CREATE TABLE table_name_99 (total INTEGER,silver VARCHAR,gold VARCHAR)
SELECT MIN(total) FROM table_name_99 WHERE silver > 7 AND gold > 73
List the number of runners up when albertina fransisca mailoa won the putri pariwisata contest?
CREATE TABLE table_26486 ("Year" real,"Putri Pariwisata Indonesia" text,"1st Runner Up" text,"2nd Runner Up" text,"3rd Runner Up" text,"4th Runner Up" text)
SELECT COUNT("3rd Runner Up") FROM table_26486 WHERE "Putri Pariwisata Indonesia" = 'Albertina Fransisca Mailoa'
What is the pick of Charley Taylor, who has an overall greater than 3?
CREATE TABLE table_name_58 (pick INTEGER,name VARCHAR,overall VARCHAR)
SELECT SUM(pick) FROM table_name_58 WHERE name = "charley taylor" AND overall > 3
What Place has a Player of bernhard langer?
CREATE TABLE table_61669 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_61669 WHERE "Player" = 'bernhard langer'
Group and count brand for each camera lens using a bar chart, sort by the bar in ascending.
CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY brand
A bar chart for what are the number of the purchase details of transactions with amount bigger than 10000?, and could you rank in asc by the the number of purchase details?
CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction...
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)
What is the average Regional Finals score when the record is 3-2 and there are more than 3 bids?
CREATE TABLE table_74490 ("Conference" text,"# of Bids" real,"Record" text,"Win %" real,"Regional Finals" real)
SELECT AVG("Regional Finals") FROM table_74490 WHERE "Record" = '3-2' AND "# of Bids" > '3'
What was the final score (result) for the game where 51,100 attended?
CREATE TABLE table_name_36 (result VARCHAR,attendance VARCHAR)
SELECT result FROM table_name_36 WHERE attendance = "51,100"
On what dates were employees without the letter M in their first names hired, and count them by a bar chart, and list y axis from high to low order please.
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),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY COUNT(HIRE_DATE) DESC
Which date has a PSOE of 36.1%?
CREATE TABLE table_71381 ("Polling Firm" text,"Date" text,"Link" text,"PSOE" text,"Others" text,"Lead" text)
SELECT "Date" FROM table_71381 WHERE "PSOE" = '36.1%'
Are any of my last classes ULCS classes ?
CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_ta...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%ULCS%' AND student_record.student_id = 1
How many years where Eichst dt had a number of 939?
CREATE TABLE table_17122 ("Year" real,"B\u00f6tzow" text,"Schwante" text,"Vehlefanz" text,"Neu-Vehlefanz" real,"Marwitz" text,"B\u00e4renklau" text,"Eichst\u00e4dt" real)
SELECT COUNT("Year") FROM table_17122 WHERE "Eichst\u00e4dt" = '939'
What's the KV-85 when the KV-1S is 45?
CREATE TABLE table_name_51 (kv_85_m1943 VARCHAR,kv_1s_m1942 VARCHAR)
SELECT kv_85_m1943 FROM table_name_51 WHERE kv_1s_m1942 = "45"
amount of posts per day.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,...
SELECT ROW_NUMBER() OVER (ORDER BY MIN(CreationDate)) AS rowNumber, COUNT(*) AS amount, DATE(MIN(CreationDate)) AS date FROM Posts WHERE OwnerUserId = '##UserId##' AND CreationDate BETWEEN '2008-08-01' AND '2008-08-17' GROUP BY DATE(CreationDate) ORDER BY MIN(CreationDate)
systolic blood pressure < 140 mmhg
CREATE TABLE table_test_13 ("id" int,"systolic_blood_pressure_sbp" int,"tachycardia" int,"diastolic_blood_pressure_dbp" int,"total_cholesterol" int,"high_density_lipoprotein_cholesterol_hdl_c" int,"serum_creatinine" float,"alcohol_abuse" bool,"drug_abuse" bool,"body_mass_index_bmi" float,"triglyceride_tg" float,"age" f...
SELECT * FROM table_test_13 WHERE systolic_blood_pressure_sbp < 140
Who is the owner that built in 2009-2011?
CREATE TABLE table_name_98 (owner VARCHAR,built VARCHAR)
SELECT owner FROM table_name_98 WHERE built = "2009-2011"
What is the location when founded was 1957?
CREATE TABLE table_73630 ("Institution" text,"Location" text,"Team Name" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Year Joined" real)
SELECT "Location" FROM table_73630 WHERE "Founded" = '1957'
What are the distinct types of the companies that have operated any flights with velocity less than 200?
CREATE TABLE flight (id number,vehicle_flight_number text,date text,pilot text,velocity number,altitude number,airport_id number,company_id number)CREATE TABLE operate_company (id number,name text,type text,principal_activities text,incorporated_in text,group_equity_shareholding number)CREATE TABLE airport (id number,c...
SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200
What are the Jersey numbers for Notre Dame?
CREATE TABLE table_49201 ("Player" text,"Nationality" text,"Jersey Number(s)" text,"Position" text,"Years" text,"From" text)
SELECT "Jersey Number(s)" FROM table_49201 WHERE "From" = 'notre dame'
What is the height when col is 1,077 and prominence is more than 2,349?
CREATE TABLE table_8612 ("Peak" text,"Location" text,"Height (m)" real,"Prominence (m)" real,"Col (m)" real)
SELECT AVG("Height (m)") FROM table_8612 WHERE "Col (m)" = '1,077' AND "Prominence (m)" > '2,349'
What Driver had 50+3 Points?
CREATE TABLE table_name_99 (driver VARCHAR,points VARCHAR)
SELECT driver FROM table_name_99 WHERE points = "50+3"
What was the score of the game that had a loss of Embree (1-2)?
CREATE TABLE table_67510 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Score" FROM table_67510 WHERE "Loss" = 'embree (1-2)'
All Answerers for a Given Tag with a Minimum Reputation of .... The Stats of a Tag only gives the Top-20 answerers. This query can list more of them and give other info as well.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId...
SELECT Users.Id AS "user_link", DisplayName, MAX(Age) AS Age, MAX(Location) AS Location, MAX(WebsiteUrl) AS Website, MAX(Reputation) AS Rep, COUNT(Answers.Id) AS Answers, SUM(Answers.Score) AS Score, CAST(AVG(CAST(Answers.Score AS FLOAT)) AS FLOAT(6, 1)) AS "avg" FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN...
On what day was the race that Cale Yarborough won in 364 laps?
CREATE TABLE table_2594 ("Year" text,"Day" text,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text)
SELECT "Day" FROM table_2594 WHERE "Laps" = '364' AND "Driver" = 'Cale Yarborough'
When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition?
CREATE TABLE table_41392 ("Year" real,"Senior PGA Championship" text,"The Tradition" text,"Senior Players Championship" text,"U.S. Senior Open" text,"Senior British Open" text)
SELECT "The Tradition" FROM table_41392 WHERE "Year" > '1998' AND "Senior Players Championship" = 'mark o''meara'
What is the most losses for positions under 15 and 66 goals against?
CREATE TABLE table_9512 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT MAX("Lost") FROM table_9512 WHERE "Goals Against" = '66' AND "Position" < '15'
What is the fewest number of attendees at Kardinia Park?
CREATE TABLE table_name_36 (crowd INTEGER,venue VARCHAR)
SELECT MIN(crowd) FROM table_name_36 WHERE venue = "kardinia park"
How many coins have a diameter of 23mm?
CREATE TABLE table_17975 ("Value" text,"Diameter" text,"Thickness" text,"Mass" text,"Composition" text,"Edge" text,"Obverse" text,"Reverse" text,"first minting" real,"issue" text,"withdrawal" text,"lapse" text)
SELECT COUNT("Reverse") FROM table_17975 WHERE "Diameter" = '23mm'
What was the attendance of week 8?
CREATE TABLE table_52057 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_52057 WHERE "Week" = '8'
What is Record, when Date is 'April 24'?
CREATE TABLE table_12219 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_12219 WHERE "Date" = 'april 24'
Find each target user's name and average trust score. Show a pie chart.
CREATE TABLE trust (source_u_id integer,target_u_id integer,trust integer)CREATE TABLE item (i_id integer,title varchar(20))CREATE TABLE review (a_id integer,u_id integer,i_id integer,rating integer,rank integer)CREATE TABLE useracct (u_id integer,name varchar(128))
SELECT name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id
Name the incumbent for north carolina 9
CREATE TABLE table_23264 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Incumbent" FROM table_23264 WHERE "District" = 'North Carolina 9'
What is the played value with 51 points?
CREATE TABLE table_5363 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Played" FROM table_5363 WHERE "Points" = '51'
Find the number of teachers who teach the student called CHRISSY NABOZNY.
CREATE TABLE list (lastname text,firstname text,grade number,classroom number)CREATE TABLE teachers (lastname text,firstname text,classroom number)
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY"
Average answer length (and min and max).
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,R...
SELECT (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%W') - 1) / 52.0) AS YR_WK, MIN(LENGTH(p.Body)) AS "min", AVG(LENGTH(p.Body)) AS "average", MAX(LENGTH(p.Body)) AS "max" FROM Users AS u, Posts AS p WHERE p.PostTypeId = 2 AND p.Score > 0 AND p.CreationDate >= '2015-01-01 00:00' GROUP BY (TIME_TO...
Who wrote the episode which was directed by Nick Marck?
CREATE TABLE table_28195898_1 (written_by VARCHAR,directed_by VARCHAR)
SELECT written_by FROM table_28195898_1 WHERE directed_by = "Nick Marck"
Which points classification has 4 as the stage?
CREATE TABLE table_22464308_2 (points_classification VARCHAR,stage VARCHAR)
SELECT points_classification FROM table_22464308_2 WHERE stage = 4
kidney failure ( creatinin > 140 )
CREATE TABLE table_test_29 ("id" int,"bleeding" int,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"heart_disease" bool,"trauma" bool,"renal_disease" bool,"creatinine_clearance_cl" float,"hemorrhagic_stroke" bool,"platelet_count" float,"surgery" bool,"thromb...
SELECT * FROM table_test_29 WHERE kidney_disease = 1 OR creatinine_clearance_cl > 140
What was the pick number for Deji Karim, in a round lower than 6?
CREATE TABLE table_35389 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT AVG("Pick #") FROM table_35389 WHERE "Name" = 'deji karim' AND "Round" < '6'
Tell me the country for lane of 6
CREATE TABLE table_name_66 (country VARCHAR,lane VARCHAR)
SELECT country FROM table_name_66 WHERE lane = 6
what is the withdrawal when the lb&sc number is less than 16 and the s.r. number is 2011?
CREATE TABLE table_name_95 (withdrawal VARCHAR,sr_number VARCHAR,lb VARCHAR,sc_number VARCHAR)
SELECT withdrawal FROM table_name_95 WHERE lb & sc_number < 16 AND sr_number = 2011
Which website has 1921 as the year founded?
CREATE TABLE table_59510 ("School" text,"Suburb/Town" text,"Years" text,"Founded" real,"Website" text)
SELECT "Website" FROM table_59510 WHERE "Founded" = '1921'
What is the name of the Post code district that is in Eden Park?
CREATE TABLE table_53502 ("Location" text,"Londonborough" text,"Post town" text,"Postcodedistrict" text,"Dialcode" text)
SELECT "Postcodedistrict" FROM table_53502 WHERE "Location" = 'eden park'
Top Flutter users in Ireland.
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,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
What is the attendance for the t7-7 result?
CREATE TABLE table_45706 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_45706 WHERE "Result" = 't7-7'
Which Rank has a Runner -up smaller than 0?
CREATE TABLE table_name_31 (rank INTEGER,runner__up INTEGER)
SELECT MAX(rank) FROM table_name_31 WHERE runner__up < 0
which election year has henry wyndham as the 2nd member and walter barttelot as 1st member?
CREATE TABLE table_68101 ("Election" text,"1st Member" text,"1st Party" text,"2nd Member" text,"2nd Party" text)
SELECT "Election" FROM table_68101 WHERE "2nd Member" = 'henry wyndham' AND "1st Member" = 'walter barttelot'
How many rounds did geoff lees drive with chassis of n180?
CREATE TABLE table_52990 ("Constructor" text,"Chassis" text,"Engine" text,"Tyres" text,"Driver" text,"Rounds" text)
SELECT "Rounds" FROM table_52990 WHERE "Chassis" = 'n180' AND "Driver" = 'geoff lees'
was there any microbiology tests until 1 year ago for the bronchial lavage of patient 031-19622?
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 medication (medicationid number,patientunitstayid number,drugname text,dosage tex...
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND microlab.culturesite = 'bronchial lavage' AND DATETIME(microlab.c...
What is No.1, when No. 2 is Emma, and when No. 7 is Olivia?
CREATE TABLE table_45951 ("Region (year)" text,"No. 1" text,"No. 2" text,"No. 3" text,"No. 4" text,"No. 5" text,"No. 6" text,"No. 7" text,"No. 8" text,"No. 9" text,"No. 10" text)
SELECT "No. 1" FROM table_45951 WHERE "No. 2" = 'emma' AND "No. 7" = 'olivia'
List all customer status codes and the number of customers having each status code in a bar chart.
CREATE TABLE Customer_Payments (customer_id INTEGER,datetime_payment DATETIME,payment_method_code VARCHAR(10),amount_payment DOUBLE)CREATE TABLE Staff (staff_id INTEGER,staff_address_id INTEGER,nickname VARCHAR(80),first_name VARCHAR(80),middle_name VARCHAR(80),last_name VARCHAR(80),date_of_birth DATETIME,date_joined_s...
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
what is the weight of a shot that is xx-inch?
CREATE TABLE table_name_51 (weight_of_shot VARCHAR,designation__bore_ VARCHAR)
SELECT weight_of_shot FROM table_name_51 WHERE designation__bore_ = "xx-inch"
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of code , and group by attribute name, and display in desc by the X please.
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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
Total answers and Accepted Answers By Date.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,In...
SELECT Users.DisplayName AS "user_name", COUNT(DISTINCT answer.Id) AS "total_answers", COUNT(DISTINCT question.Id) AS "accepted_answers" FROM Posts AS answer LEFT OUTER JOIN Posts AS question ON question.AcceptedAnswerId = answer.Id INNER JOIN Users ON answer.OwnerUserId = Users.Id INNER JOIN PostTags ON answer.ParentI...
What is the number of booking end dates of the apartments with type code 'Duplex' in each year? Return a bar chart.
CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex"
What is the length for a diesel engine with numbers of tbd (13 buses)?
CREATE TABLE table_55005 ("Year" text,"Make & Model" text,"Length" text,"Engine Type" text,"Numbers" text)
SELECT "Length" FROM table_55005 WHERE "Engine Type" = 'diesel' AND "Numbers" = 'tbd (13 buses)'
papers by oren etzioni
CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE field (fieldid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABL...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'oren etzioni' AND writes.authorid = author.authorid
What is ASTC Member, when State is Arkansas, when AAM Member is No, and when AAM Accredited is Yes?
CREATE TABLE table_42120 ("City" text,"State" text,"AAM Accredited" text,"AAM Member" text,"ASTC Member" text)
SELECT "ASTC Member" FROM table_42120 WHERE "State" = 'arkansas' AND "AAM Member" = 'no' AND "AAM Accredited" = 'yes'
how many numer of jamaicans granted british citizenship with naturalisation by marriage being 1060
CREATE TABLE table_16531 ("Year" real,"Numer of Jamaicans granted British citizenship" real,"Naturalisation by residence" real,"Naturalisation by marriage" real,"Registration of a minor child" real,"Registration by other means" real)
SELECT COUNT("Numer of Jamaicans granted British citizenship") FROM table_16531 WHERE "Naturalisation by marriage" = '1060'
who shot the best 73 m
CREATE TABLE table_204_234 (id number,"round" text,"100 yd (91 m)" text,"80 yd (73 m)" text,"60 yd (55 m)" text,"50 yd (46 m)" text,"40 yd (37 m)" text)
SELECT "round" FROM table_204_234 ORDER BY "80 yd (73 m)" DESC LIMIT 1
Top 100 User of Bhubaneswar.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Nam...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bhubaneswar%' ORDER BY Reputation DESC LIMIT 100
what dose of calcium gluconate was last prescribed to patient 95470 since 12/2102?
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 inputevents_cv (row_id number,subject_id number,hadm_id number...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95470) AND prescriptions.drug = 'calcium gluconate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-12' ORDER BY prescriptions.startdate DESC LIMIT 1
Who is the drive for an Entrant of Scuderia Ambrosiana?
CREATE TABLE table_name_65 (driver VARCHAR,entrant VARCHAR)
SELECT driver FROM table_name_65 WHERE entrant = "scuderia ambrosiana"
show me CO flights from CHICAGO to SEATTLE on saturday morning
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)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 i...
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 = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND...
what is admission type and date of death of subject id 2560?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT demographic.admission_type, demographic.dod FROM demographic WHERE demographic.subject_id = "2560"
i would like to leave early in the morning
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 airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE air...
SELECT DISTINCT flight_id FROM flight WHERE departure_time BETWEEN 0 AND 800
What is the average Lap of damon hill, with a Grid smaller than 1?
CREATE TABLE table_11287 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT AVG("Laps") FROM table_11287 WHERE "Driver" = 'damon hill' AND "Grid" < '1'
Are there any ULCS courses in the courses I 've taken ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varcha...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%ULCS%' AND student_record.student_id = 1
give me the number of patients born before 2060 who had ascitic fluid lab test done.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2060" AND lab.fluid = "Ascites"
how many patients whose primary disease is pituitary bleed and year of death is less than or equal to 2138?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2138.0"
what is item id of subject id 2560?
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 lab.itemid FROM lab WHERE lab.subject_id = "2560"
What's the minimal number of points scored in any game?
CREATE TABLE table_25952 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT MIN("Points") FROM table_25952
what was the name of the specimen test that patient 031-3355 had first received in this hospital encounter?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin te...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) ORDER BY microla...
Find the types and details for all premises and order by the premise type.
CREATE TABLE premises (premises_type VARCHAR,premise_details VARCHAR)
SELECT premises_type, premise_details FROM premises ORDER BY premises_type
A bar chart shows the distribution of date_address_from and the average of monthly_rental bin date_address_from by weekday.
CREATE TABLE Teachers (teacher_id INTEGER,address_id INTEGER,first_name VARCHAR(80),middle_name VARCHAR(80),last_name VARCHAR(80),gender VARCHAR(1),cell_mobile_number VARCHAR(40),email_address VARCHAR(40),other_details VARCHAR(255))CREATE TABLE Student_Addresses (student_id INTEGER,address_id INTEGER,date_address_from ...
SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
count the number of patients who take drug via oral route and have diagnoses of cerebral embolism with cerebral infarction.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cerebral embolism with cerebral infarction" AND prescriptions.route = "ORAL"
What is the D 47 when the D 49 is r 32?
CREATE TABLE table_56226 ("D 50" text,"D 49" text,"D 48" text,"D 47" text,"D 46" text,"D 45" text,"D 44" text,"D 43" text,"D 42" text,"D 41" text)
SELECT "D 47" FROM table_56226 WHERE "D 49" = 'r 32'
is there a flight tomorrow morning from COLUMBUS to NASHVILLE
CREATE TABLE month (month_number int,month_name text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NASHVILLE' AND date_day.day_number = 20 AND date_day.month_number = 1 AN...
Which driver finished in position 8?
CREATE TABLE table_name_50 (driver VARCHAR,fin_pos VARCHAR)
SELECT driver FROM table_name_50 WHERE fin_pos = 8
How many chapters did Elmer Clifton direct?
CREATE TABLE table_name_86 (chapters VARCHAR,director VARCHAR)
SELECT COUNT(chapters) FROM table_name_86 WHERE director = "elmer clifton"
What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?
CREATE TABLE enzyme (id number,name text,location text,product text,chromosome text,omim number,porphyria text)CREATE TABLE medicine (id number,name text,trade_name text,fda_approved text)CREATE TABLE medicine_enzyme_interaction (enzyme_id number,medicine_id number,interaction_type text)
SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
what was the last lab test when they visited the hospital first time given to patient 77213?
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 chartevents (row_id number,subject_id number,hadm_id number,ic...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77213 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DE...