instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Which Tournament has a Runner(s)-up of bob charles?
CREATE TABLE table_name_49 (tournament VARCHAR,runner_s__up VARCHAR)
SELECT tournament FROM table_name_49 WHERE runner_s__up = "bob charles"
What is the venue of the match with a score of 33-22?
CREATE TABLE table_name_45 (venue VARCHAR,score VARCHAR)
SELECT venue FROM table_name_45 WHERE score = "33-22"
What is the Outcome of the game against Frederic Jeanclaude?
CREATE TABLE table_48685 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Outcome" FROM table_48685 WHERE "Opponent" = 'frederic jeanclaude'
What is the rank when there are more than 4,123 completion and the comp percentage is more than 65.6?
CREATE TABLE table_79674 ("Rank" real,"Name" text,"Tenure" text,"Leagues" text,"Attempts" real,"Completions" real,"Comp %" real,"Touchdowns" real,"Interceptions" real,"Yardage" real,"QB Rating" real)
SELECT SUM("Rank") FROM table_79674 WHERE "Completions" > '4,123' AND "Comp %" > '65.6'
was patient 25869 underwent a pco2 test in 2105?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttim...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25869) AND STRFTIME('%y', labevents.charttime) = '2105'
What is the week 1 with candice hunnicutt in week 3?
CREATE TABLE table_name_53 (week_1 VARCHAR,week_3 VARCHAR)
SELECT week_1 FROM table_name_53 WHERE week_3 = "candice hunnicutt"
What's the record for October 8, 2000 before week 13?
CREATE TABLE table_77695 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game site" text)
SELECT "Record" FROM table_77695 WHERE "Week" < '13' AND "Date" = 'october 8, 2000'
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and code , and group by attribute headquarter, I want to show by the X-axis in asc.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
Search all posts for a string of characters.
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 Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE FlagTypes (Id number,Na...
SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate FROM Posts WHERE Body LIKE '%##text##%' ORDER BY CreationDate DESC
Find All_Road and All_Games_Percent , and visualize them by a bar chart.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT All_Road, All_Games_Percent FROM basketball_match
What are names of the movies that are either made before 1980 or directed by James Cameron?
CREATE TABLE movie (mid number,title text,year number,director text)CREATE TABLE rating (rid number,mid number,stars number,ratingdate time)CREATE TABLE reviewer (rid number,name text)
SELECT title FROM movie WHERE director = "James Cameron" OR year < 1980
I want the highest grid for Laps of 38
CREATE TABLE table_name_94 (grid INTEGER,laps VARCHAR)
SELECT MAX(grid) FROM table_name_94 WHERE laps = 38
How many CLASS P14 trains were made?
CREATE TABLE table_name_2 (quantity_made VARCHAR,class VARCHAR)
SELECT quantity_made FROM table_name_2 WHERE class = "p14"
who was this team 's next opponent after facing the soviet union on june 14 ?
CREATE TABLE table_204_814 (id number,"date" text,"opposition" text,"result" text,"score" text,"brazil scorers" text,"competition" text)
SELECT "opposition" FROM table_204_814 WHERE "date" > (SELECT "date" FROM table_204_814 WHERE "opposition" = 'soviet union') ORDER BY "date" LIMIT 1
In what county did McCain get 57.8%?
CREATE TABLE table_20799905_1 (county VARCHAR,mccain_percentage VARCHAR)
SELECT county FROM table_20799905_1 WHERE mccain_percentage = "57.8%"
Name the incumbent for lost re-election democratic-republican hold
CREATE TABLE table_2668352_14 (incumbent VARCHAR,result VARCHAR)
SELECT incumbent FROM table_2668352_14 WHERE result = "Lost re-election Democratic-Republican hold"
What points has united kingdom as the country, and 10 as the place?
CREATE TABLE table_name_29 (points VARCHAR,country VARCHAR,place VARCHAR)
SELECT points FROM table_name_29 WHERE country = "united kingdom" AND place = 10
what is the number of patients whose days of hospital stay is greater than 5 and diagnoses long title is phlebitis and thrombophlebitis of superficial veins of upper extremities?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.long_title = "Phlebitis and thrombophlebitis of superficial veins of upper extremities"
What political party does the person from San Diego belong to?
CREATE TABLE table_name_75 (party VARCHAR,residence VARCHAR)
SELECT party FROM table_name_75 WHERE residence = "san diego"
for the bile duct incision nec what does it cost?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'bile duct incision nec'))
What is the date of the game between Melbourne and Footscray?
CREATE TABLE table_77786 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_77786 WHERE "Home team" = 'melbourne'
What was the surface for the game that was played on 12-Apr-2005?
CREATE TABLE table_70304 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score" text)
SELECT "Surface" FROM table_70304 WHERE "Date" = '12-apr-2005'
What's spain's highest total?
CREATE TABLE table_name_34 (total INTEGER,country VARCHAR)
SELECT MAX(total) FROM table_name_34 WHERE country = "spain"
calculate the total quantity of output of patient 027-144847 on last month/24.
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,ce...
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 = '027-144847')) AND intakeoutput.cellpath LIKE '%o...
What was the lowest no. of attendance on record?
CREATE TABLE table_20556 ("#" real,"Date" text,"at/vs." text,"Opponent" text,"Score" text,"Attendance" real,"Record" text)
SELECT MIN("Attendance") FROM table_20556
What's the engine used for rounds 5-6?
CREATE TABLE table_57352 ("Constructor" text,"Chassis" text,"Engine" text,"Tyres" text,"Driver" text,"Rounds" text)
SELECT "Engine" FROM table_57352 WHERE "Rounds" = '5-6'
What are the dimensions of the coin with western sea barrage and locks at taedong gang on the reverse side?
CREATE TABLE table_298883_5 (dimensions VARCHAR,reverse VARCHAR)
SELECT dimensions FROM table_298883_5 WHERE reverse = "Western sea barrage and locks at Taedong Gang"
count how many times patient 032-12408 has received a digoxin procedure since 2105.
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-12408')) AND treatment.treatmentname = 'digoxin' AND STRFTIME('%y', treatmen...
How many million viewers watched episode 3 in the series?
CREATE TABLE table_26808178_1 (us_viewers__millions_ VARCHAR,series__number VARCHAR)
SELECT us_viewers__millions_ FROM table_26808178_1 WHERE series__number = 3
known thrombocytopenia ( platelet count < 100000 )
CREATE TABLE table_dev_60 ("id" int,"systolic_blood_pressure_sbp" int,"body_weight" float,"renal_disease" bool,"allergy_to_aspirin" bool,"creatinine_clearance_cl" float,"allergy_to_clopidogrel" bool,"allergy_to_heparin" bool,"platelet_count" float,"thrombocytopenia" float,"diastolic_blood_pressure_dbp" int,"allergy_to_...
SELECT * FROM table_dev_60 WHERE thrombocytopenia = 1 OR platelet_count < 100000
Name the type for mcminnville
CREATE TABLE table_2076533_1 (type VARCHAR,main_location VARCHAR)
SELECT type FROM table_2076533_1 WHERE main_location = "McMinnville"
What college is draft pick #327 from?
CREATE TABLE table_39716 ("Round" real,"Pick #" text,"Player" text,"Position" text,"College" text,"Tenure w/ Steelers" text)
SELECT "College" FROM table_39716 WHERE "Pick #" = '327'
What is Pocona Municipalities with 72 Totora municipalities and more than 74 pojo municipalities?
CREATE TABLE table_38601 ("Language" text,"Totora Municipality" real,"Pojo Municipality" real,"Pocona Municipality" real,"Chimor\u00e9 Municipality" real,"Puerto Villarroel Municipality" real,"Entre R\u00edos Municipality" real)
SELECT COUNT("Pocona Municipality") FROM table_38601 WHERE "Totora Municipality" = '72' AND "Pojo Municipality" > '74'
Attendance of 19,741 had what average week?
CREATE TABLE table_33849 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT AVG("Week") FROM table_33849 WHERE "Attendance" = '19,741'
What was the result of the 2000-01 season in which the IceGators were part of the Southwest division and were coached by Dave Farrish?
CREATE TABLE table_13990 ("Season" text,"League" text,"Division" text,"Coach" text,"Result" text)
SELECT "Result" FROM table_13990 WHERE "Coach" = 'dave farrish' AND "Division" = 'southwest' AND "Season" = '2000-01'
What is the result in 1994?
CREATE TABLE table_name_36 (result VARCHAR,year VARCHAR)
SELECT result FROM table_name_36 WHERE year = 1994
What is the id of the order which has the most items?
CREATE TABLE products (product_id number,product_name text,product_details text)CREATE TABLE order_items (order_item_id number,product_id number,order_id number,order_item_status text,order_item_details text)CREATE TABLE invoices (invoice_number number,invoice_date time,invoice_details text)CREATE TABLE customers (cust...
SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1
How many services are there?
CREATE TABLE parties (party_id number,payment_method_code text,party_phone text,party_email text)CREATE TABLE organization_contact_individuals (individual_id number,organization_id number,date_contact_from time,date_contact_to time)CREATE TABLE individuals (individual_id number,individual_first_name text,individual_mid...
SELECT COUNT(*) FROM services
Find the total amount of products ordered before 2018-03-17 07:13:53.
CREATE TABLE customer_orders (order_id VARCHAR,order_date INTEGER)CREATE TABLE order_items (order_quantity INTEGER,order_id VARCHAR)
SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53"
Which Venue has a Result of 2 0?
CREATE TABLE table_38983 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Venue" FROM table_38983 WHERE "Result" = '2–0'
How many questions have I closed?. Counts the number of questions a user has closed.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera...
SELECT * FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE NOT Posts.ClosedDate IS NULL LIMIT 100
Which 1992 has a 1996 of sf and a 1993 of a?
CREATE TABLE table_36309 ("Tournament" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text)
SELECT "1992" FROM table_36309 WHERE "1996" = 'sf' AND "1993" = 'a'
Which Driver won the Circuit of Rio de Janeiro?
CREATE TABLE table_32877 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text)
SELECT "Winning driver" FROM table_32877 WHERE "Circuit" = 'rio de janeiro'
Tell me the average top 10 for cuts made less than 10, wins less than 1 and top 25 of 5
CREATE TABLE table_11675 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT AVG("Top-10") FROM table_11675 WHERE "Wins" < '1' AND "Top-25" = '5' AND "Cuts made" < '10'
How many annual interchanges in the millions occurred in 2011-12 when the number of annual entry/exits was 36.609 million?
CREATE TABLE table_72964 ("Rank" real,"Railway Station" text,"Annual entry/exit (millions) 2011\u201312" text,"Annual interchanges (millions) 2011\u201312" text,"Total Passengers (millions) 2011\u201312" text,"Location" text,"Main Services" text,"Number of Platforms" real)
SELECT "Annual interchanges (millions) 2011\u201312" FROM table_72964 WHERE "Annual entry/exit (millions) 2011\u201312" = '36.609'
what was the name of the procedure performed to patient 23224, two times since 120 months ago?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locatio...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 232...
Where was the UFC 154 match held?
CREATE TABLE table_59268 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Location" FROM table_59268 WHERE "Event" = 'ufc 154'
What is Team, when Game is 73?
CREATE TABLE table_name_21 (team VARCHAR,game VARCHAR)
SELECT team FROM table_name_21 WHERE game = 73
Which owner has a Contemporary Christian music station on 97.9 FM?
CREATE TABLE table_54808 ("Frequency" text,"Call sign" text,"Name" text,"Format" text,"Owner" text)
SELECT "Name" FROM table_54808 WHERE "Format" = 'contemporary christian music' AND "Frequency" = '97.9 fm'
how many days has it been since the first stay of patient 17462 in the careunit tsicu on the current hospital encounter?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1
return me the paper in PVLDB with more than 200 citations .
CREATE TABLE publication_keyword (kid int,pid int)CREATE TABLE domain_keyword (did int,kid int)CREATE TABLE keyword (keyword varchar,kid int)CREATE TABLE organization (continent varchar,homepage varchar,name varchar,oid int)CREATE TABLE cite (cited int,citing int)CREATE TABLE domain_conference (cid int,did int)CREATE T...
SELECT publication.title FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.citation_num > 200 AND publication.jid = journal.jid
What score has tim duncan (27) as the leading scorer?
CREATE TABLE table_name_96 (score VARCHAR,leading_scorer VARCHAR)
SELECT score FROM table_name_96 WHERE leading_scorer = "tim duncan (27)"
give me the number of patients whose primary disease is ruq pain and days of hospital stay is greater than 2?
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 WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.days_stay > "2"
How many stations are called radyo5 101.9 news fm?
CREATE TABLE table_17822401_1 (location VARCHAR,branding VARCHAR)
SELECT COUNT(location) FROM table_17822401_1 WHERE branding = "Radyo5 101.9 News FM"
What was the engine belonging to Pierluigi Martini with a Tyre of P?
CREATE TABLE table_name_20 (engine VARCHAR,tyres VARCHAR,driver VARCHAR)
SELECT engine FROM table_name_20 WHERE tyres = "p" AND driver = "pierluigi martini"
Which loss has a Record of 54-39?
CREATE TABLE table_68227 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Loss" FROM table_68227 WHERE "Record" = '54-39'
What is the lowest population density of Strakonice (st) with more than 112 settlements?
CREATE TABLE table_name_66 (pop_dens INTEGER,district VARCHAR,noof_settlements VARCHAR)
SELECT MIN(pop_dens) FROM table_name_66 WHERE district = "strakonice (st)" AND noof_settlements > 112
count the number of patients whose age is less than 80 and lab test fluid is cerebrospinal fluid (csf)?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
what does the restriction ap58 mean
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 fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,seaso...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/58'
What player scored 143 goals?
CREATE TABLE table_name_15 (player VARCHAR,goals VARCHAR)
SELECT player FROM table_name_15 WHERE goals = "143"
Who was the driver with 29 laps?
CREATE TABLE table_name_39 (driver VARCHAR,laps VARCHAR)
SELECT driver FROM table_name_39 WHERE laps = "29"
what was the last time patient 52898 had a immunology microbiology test this month?
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 patients (row_id number,subject_id number,gender text,dob time...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND microbiologyevents.spec_type_desc = 'immunology' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'st...
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of price , and group by attribute name in a bar chart, and could you order from low to high 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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price
what's the minimum total cost of the hospital that involves a procedure called anticoagulant administration - factor xa inhibitor during this year?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunit...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticoagulant administration - factor xa inh...
What's the First Day Cover Cancellation with Denomination of $0.50 and Date of Issue as 13 June 2005?
CREATE TABLE table_name_68 (first_day_cover_cancellation VARCHAR,denomination VARCHAR,date_of_issue VARCHAR)
SELECT first_day_cover_cancellation FROM table_name_68 WHERE denomination = "$0.50" AND date_of_issue = "13 june 2005"
how many patients posses self insurance and are tested for creatinine kinase mb isoenzyme in lab?
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.insurance = "Self Pay" AND lab.label = "Creatine Kinase, MB Isoenzyme"
How many Extra Points were scored by the Player who had 5 Points and less than 1 Touchdowns?
CREATE TABLE table_5361 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT MIN("Extra points") FROM table_5361 WHERE "Points" = '5' AND "Touchdowns" < '1'
Name the most field goals
CREATE TABLE table_14342480_5 (field_goals INTEGER)
SELECT MAX(field_goals) FROM table_14342480_5
Bar chart x axis event details y axis how many event details, rank in ascending by the bars please.
CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Ser...
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details
what were the top four most common procedures until 2100?
CREATE TABLE d_icd_diagnoses (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 procedures_icd (row_id number,subject_id number,hadm_id ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) <= '2100' GROUP BY procedures_icd.icd9_code) AS t1...
Give me the list of patients who were diagnosed with acute kidney failure (unspecified) that were administered the drug via the tp route.
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute kidney failure NOS" AND prescriptions.route = "TP"
What was the score of the game in which the Toronto Maple Leafs were visitors?
CREATE TABLE table_name_97 (score VARCHAR,visitor VARCHAR)
SELECT score FROM table_name_97 WHERE visitor = "toronto maple leafs"
Display a bar chart for what are the names and ids of the tourist attractions that are visited at most once?
CREATE TABLE Tourist_Attractions (Tourist_Attraction_ID INTEGER,Attraction_Type_Code CHAR(15),Location_ID INTEGER,How_to_Get_There VARCHAR(255),Name VARCHAR(255),Description VARCHAR(255),Opening_Hours VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Features (Feature_ID INTEGER,Feature_Details VARCHAR(255))CREATE T...
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
Who was the broadcaster in 2003?
CREATE TABLE table_name_24 (broadcaster VARCHAR,year VARCHAR)
SELECT broadcaster FROM table_name_24 WHERE year = "2003"
What Limnology Laboratory classes do n't require prerequisites ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Limnology Laboratory%' OR course.description LIKE '%Limnology Laboratory%' OR course.name LIKE '%Limnology Laboratory%') AND course.enforced_requirement = 'N / A'
count the number of patients whose days of hospital stay is greater than 1 and item id is 51257?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.itemid = "51257"
Name the most tier 1 capital for irish nationwide
CREATE TABLE table_22368322_2 (_€_million VARCHAR,tier_1_capital INTEGER,institution VARCHAR)
SELECT MAX(tier_1_capital), _€_million FROM table_22368322_2 WHERE institution = "Irish Nationwide"
On What Date is the Competition Semifinal that has a result of 2-1 aet?
CREATE TABLE table_43667 ("Match" text,"Date" text,"Location" text,"Lineup" text,"Result" text,"Competition" text)
SELECT "Date" FROM table_43667 WHERE "Competition" = 'semifinal' AND "Result" = '2-1 aet'
When fixed route is the type of fare how much is the 31-day pass?
CREATE TABLE table_23942 ("Type of Fare" text,"Cash Fare" text,"Day Pass" text,"31-Day Pass" text,"Monthly Pass" text)
SELECT "31-Day Pass" FROM table_23942 WHERE "Type of Fare" = 'Fixed Route'
What is Date, when Fastest Lap is James Winslow, when Race is 1, and when Winning Driver is Leanne Tander?
CREATE TABLE table_name_81 (date VARCHAR,winning_driver VARCHAR,fastest_lap VARCHAR,race VARCHAR)
SELECT date FROM table_name_81 WHERE fastest_lap = "james winslow" AND race = 1 AND winning_driver = "leanne tander"
What year shows the Entrant of bmw motorsport?
CREATE TABLE table_68396 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT SUM("Year") FROM table_68396 WHERE "Entrant" = 'bmw motorsport'
what is the number of patients whose days of hospital stay is greater than 20 and drug route is oral?
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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.route = "ORAL"
what was the average value of patient 010-29887's bicarbonate?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number...
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-29887')) AND lab.labname = 'bicarbonate'
What Player has a To par less than 15 and a Total of 149?
CREATE TABLE table_12391 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real)
SELECT "Player" FROM table_12391 WHERE "To par" < '15' AND "Total" = '149'
What date has 37 points?
CREATE TABLE table_43859 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Date" FROM table_43859 WHERE "Points" = '37'
what is the highest pick number of the CFL team, the winnipeg blue bombers?
CREATE TABLE table_52521 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_52521 WHERE "CFL Team" = 'winnipeg blue bombers'
Which First used has a Quantity of 26?
CREATE TABLE table_5850 ("Designation" text,"Car numbers" text,"Manufacturer" text,"Model No." text,"First used" text,"Quantity" real)
SELECT "First used" FROM table_5850 WHERE "Quantity" = '26'
find out the admission location and time of discharge for patient with patient id 17787.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT demographic.admission_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "17787"
What was the race of the person executed on December 27, 1827?
CREATE TABLE table_name_52 (race VARCHAR,date_of_execution VARCHAR)
SELECT race FROM table_name_52 WHERE date_of_execution = "december 27, 1827"
what was the first year she won a nomination ?
CREATE TABLE table_204_504 (id number,"year" number,"award" text,"category" text,"work" text,"result" text)
SELECT "year" FROM table_204_504 ORDER BY "year" LIMIT 1
Average Post Length for Users with at least 10,000 Rep and at least 100 Posts.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score n...
SELECT p.OwnerUserId, u.DisplayName, AVG(LENGTH(p.Body)) AS AvgLen FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Reputation >= 10000 GROUP BY p.OwnerUserId, u.DisplayName HAVING COUNT(p.Id) >= 100 ORDER BY AvgLen DESC
please tell me which airline has the most departures from ATLANTA
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,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE airline (airline...
SELECT DISTINCT COUNT(*), flight.airline_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.from_airport = airport_service.airport_code GROUP BY flight.airline_code
What was the location and attendance on March 9?
CREATE TABLE table_29746 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Location Attendance" FROM table_29746 WHERE "Date" = 'March 9'
Name the high assists for w 107 99 (ot)
CREATE TABLE table_29849 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_29849 WHERE "Score" = 'W 107–99 (OT)'
What is the Icelandic title for the Norweigan titled galgeblomsten?
CREATE TABLE table_32646 ("Swedish title" text,"Norwegian title" text,"Icelandic title" text,"Translated title" text,"Polish title" text,"Hungarian title" text,"Published" real)
SELECT "Icelandic title" FROM table_32646 WHERE "Norwegian title" = 'galgeblomsten'
How many point totals are there that rank higher than 9 and have a PPG avg higher than 13.4?
CREATE TABLE table_name_48 (total_points VARCHAR,rank VARCHAR,ppg_avg VARCHAR)
SELECT COUNT(total_points) FROM table_name_48 WHERE rank > 9 AND ppg_avg > 13.4
Plot the number of name by grouped by name as a bar graph, and could you show Name in asc order?
CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY Name
What's the title of the film directed by Friz Freleng with an MM Series, production number greater than 6209 and a release date of 1934-11-03?
CREATE TABLE table_name_77 (title VARCHAR,release_date VARCHAR,director VARCHAR,production_num VARCHAR,series VARCHAR)
SELECT title FROM table_name_77 WHERE production_num > 6209 AND series = "mm" AND director = "friz freleng" AND release_date = "1934-11-03"
Who is the director of Cannibal vegetarian, which is the film title used in nomination?
CREATE TABLE table_42602 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director(s)" text,"Result" text)
SELECT "Director(s)" FROM table_42602 WHERE "Film title used in nomination" = 'cannibal vegetarian'
What is the media market ranking for the Blackhawks?
CREATE TABLE table_17399 ("Metropolitan Area" text,"Media Market Ranking" real,"Hosted 4 teams since" real,"NFL Team(s)" text,"MLB Team(s)" text,"NBA Team(s)" text,"NHL Team(s)" text)
SELECT COUNT("Media Market Ranking") FROM table_17399 WHERE "NHL Team(s)" = 'Blackhawks'