instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Which Championships have a League of ontario australian football league?
CREATE TABLE table_12662 ("Club" text,"League" text,"Sport" text,"Established" text,"Championships" real)
SELECT "Championships" FROM table_12662 WHERE "League" = 'ontario australian football league'
count the number of patients that have had a blood, venipuncture microbiology test in 2104.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,pat...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND STRFTIME('%y', microlab.culturetakentime) = '2104')
how many total trains were build in 1949 ?
CREATE TABLE table_204_77 (id number,"number" text,"builder" text,"type" text,"date" text,"works number" number,"notes" text)
SELECT COUNT("number") FROM table_204_77 WHERE "date" = 1949
What is the subdivision name (BE) where subdivision name (RU) (BGN) is Grodnenskaya Oblast'?
CREATE TABLE table_30887 ("Code" text,"Subdivision name (be) (BGN/PCGN)" text,"Subdivision name (be) (GOST)" text,"Subdivision name (ru) (BGN/PCGN)" text,"Subdivision name (ru) (GOST)" text,"Subdivision category" text)
SELECT "Subdivision name ( be ) (BGN/PCGN)" FROM table_30887 WHERE "Subdivision name ( ru ) (BGN/PCGN)" = 'Grodnenskaya oblast'
What was the away team that played Fitzroy?
CREATE TABLE table_32813 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_32813 WHERE "Home team" = 'fitzroy'
Tell me the number of bronze for silver of 0 and total less than 1
CREATE TABLE table_32135 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_32135 WHERE "Silver" = '0' AND "Total" < '1'
What was the date of the game where the indians record was 37-44?
CREATE TABLE table_35680 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Date" FROM table_35680 WHERE "Record" = '37-44'
What is the average attendance for seasons before 1999 with pos of 8?
CREATE TABLE table_name_93 (attendance_g INTEGER,pos VARCHAR,season VARCHAR)
SELECT AVG(attendance_g) FROM table_name_93 WHERE pos = 8 AND season < 1999
What game that had a record of 39-44 had the lowest attendance?
CREATE TABLE table_name_44 (attendance INTEGER,record VARCHAR)
SELECT MIN(attendance) FROM table_name_44 WHERE record = "39-44"
what were the four drugs most often prescribed to the bronchitis - acute male patients aged 40s within 2 months after they had been diagnosed with bronchitis - acute since 6 years ago?
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bronchitis - acute' AND DATETIME(diagnosis.diagnos...
Show the average of weight from each sex, display total number from low to high order.
CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
What was the record in the game whose first star was J. Oduya?
CREATE TABLE table_27537518_6 (record VARCHAR,first_star VARCHAR)
SELECT record FROM table_27537518_6 WHERE first_star = "J. Oduya"
What is the nickname of the newberry college?
CREATE TABLE table_11658094_3 (nickname VARCHAR,institution VARCHAR)
SELECT nickname FROM table_11658094_3 WHERE institution = "Newberry College"
Which losing team had a score of 24-12?
CREATE TABLE table_16545 ("Season" real,"Grand FinalDate" text,"WinningTeam" text,"Score" text,"LosingTeam" text,"Location" text,"GF Attendance" real,"Clive Churchill Medal" text)
SELECT "LosingTeam" FROM table_16545 WHERE "Score" = '24-12'
Which State (class) has a Successor of harry f. byrd, jr. (d)? Question
CREATE TABLE table_name_54 (state__class_ VARCHAR,successor VARCHAR)
SELECT state__class_ FROM table_name_54 WHERE successor = "harry f. byrd, jr. (d)"
Wilson confidence rating for posts of a user. https://stackapps.com/questions/8555/request-for-user-script-to-calculate-wilson-confidence-ratings-for-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.Id, p.OwnerUserId, SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) AS upvotes, SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS downvotes FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId IN (2, 3) AND p.OwnerUserId = 2157772 GROUP BY p.Id, p.OwnerUserId
Which of the top-10s has a starts value of 14?
CREATE TABLE table_name_53 (top_10s INTEGER,starts VARCHAR)
SELECT MAX(top_10s) FROM table_name_53 WHERE starts = 14
What episode includes 'Cop and Saucer'?
CREATE TABLE table_23368 ("N\u00ba" real,"Ep" real,"Huckleberry Hound" text,"Pixie and Dixie" text,"Yogi Bear" text,"Air date" text,"Credited animators" text)
SELECT MIN("Ep") FROM table_23368 WHERE "Huckleberry Hound" = 'Cop and Saucer'
give me the number of patients whose admission type is urgent and primary disease is left femur fracture?
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 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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "LEFT FEMUR FRACTURE"
what was the name of the first intake that patient 12927 had on this month/28.
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_labitems (row_id number,itemid number,l...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927)) AND DATETIME(inputevents_cv....
What is team 1 if Renova is team 2?
CREATE TABLE table_58763 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text)
SELECT "Team 1" FROM table_58763 WHERE "Team 2" = 'renova'
What is the name on the Republican ticket when the Socialist ticket was louis waldman?
CREATE TABLE table_name_17 (republican_ticket VARCHAR,socialist_ticket VARCHAR)
SELECT republican_ticket FROM table_name_17 WHERE socialist_ticket = "louis waldman"
What is the Location with a county of 30 Hancock?
CREATE TABLE table_63745 ("School" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Football Class" text,"Primary Conference" text,"County" text)
SELECT "Location" FROM table_63745 WHERE "County" = '30 hancock'
Name the title for total viewers on fx+ being 483,000
CREATE TABLE table_26493520_3 (title VARCHAR,total_viewers_on_fx VARCHAR)
SELECT title FROM table_26493520_3 WHERE total_viewers_on_fx = "483,000"
how many patients whose admission year is less than 2166 and diagnoses long title is pneumococcal pneumonia [streptococcus pneumoniae pneumonia]?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2166" AND diagnoses.long_title = "Pneumococcal pneumonia [Streptococcus pneumoniae pneumonia]"
Next semester , how many lecture sections are offered for PSYCH 464 ?
CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,tota...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PSYCH' AND course.number = 464 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
What name shows as private authority and hibiscus and bays local board ?
CREATE TABLE table_name_70 (name VARCHAR,authority VARCHAR,local_board VARCHAR)
SELECT name FROM table_name_70 WHERE authority = "private" AND local_board = "hibiscus and bays"
What was the highest goals with fewer than 16 losses, fewer than 11 wins, and a goal difference greater than -9?
CREATE TABLE table_62631 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MAX("Goals for") FROM table_62631 WHERE "Losses" < '16' AND "Wins" < '11' AND "Goal Difference" > '-9'
the top elevation measured for this station is 2591m
CREATE TABLE table_203_839 (id number,"station" text,"type" text,"latitude" text,"longitude" text,"el. (m)" number,"opened" number,"closed" number,"coordinates" text)
SELECT "station" FROM table_203_839 WHERE "el. (m)" = 2591
Who scored the most points when the Bucks played against Houston?
CREATE TABLE table_29945 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High points" FROM table_29945 WHERE "Team" = 'Houston'
What is the latest year rafael nadal was in the French Open, Roger Federer was in Wimbledon, and Roger Federer was in the Australian Open?
CREATE TABLE table_name_71 (year INTEGER,australian_open VARCHAR,french_open VARCHAR,wimbledon VARCHAR)
SELECT MAX(year) FROM table_name_71 WHERE french_open = "rafael nadal" AND wimbledon = "roger federer" AND australian_open = "roger federer"
how many teams had at least two drivers this season ?
CREATE TABLE table_204_808 (id number,"team" text,"no" number,"driver" text,"class" text,"chassis" text,"engine" text)
SELECT COUNT(*) FROM (SELECT "team" FROM table_204_808 GROUP BY "team" HAVING COUNT("driver") >= 2)
What is the thurs 25 aug when wed 24 aug is 19' 59.73 113.216mph?
CREATE TABLE table_31467 ("Rank" real,"Rider" text,"Sat 20 Aug" text,"Mon 22 Aug" text,"Tues 23 Aug" text,"Wed 24 Aug" text,"Thurs 25 Aug" text,"Fri 26 Aug" text)
SELECT "Thurs 25 Aug" FROM table_31467 WHERE "Wed 24 Aug" = '19'' 59.73 113.216mph'
Which episode did actor A. J. Buckley last appear in?
CREATE TABLE table_11240028_1 (last_appearance VARCHAR,portrayed_by VARCHAR)
SELECT last_appearance FROM table_11240028_1 WHERE portrayed_by = "A. J. Buckley"
what is the number of patients who had non-invasive mechanical ventilation procedure?
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 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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Non-invasive mechanical ventilation"
A bar chart about what are the average prices of products, grouped by manufacturer name?, I want to rank by the names in descending.
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, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
What is the Week 8 result of the team that lost to syarcuse (4-2) in Week 7?
CREATE TABLE table_name_44 (week_8_oct_26 VARCHAR,week_7_oct_19 VARCHAR)
SELECT week_8_oct_26 FROM table_name_44 WHERE week_7_oct_19 = "syarcuse (4-2)"
What was the rank of tris speaker when BB/SO was 7?
CREATE TABLE table_name_20 (rank VARCHAR,player VARCHAR,bb_so VARCHAR)
SELECT rank FROM table_name_20 WHERE player = "tris speaker" AND bb_so = 7
What is the notes for the rowers from denmark?
CREATE TABLE table_65987 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Notes" FROM table_65987 WHERE "Country" = 'denmark'
What is the Overall number for pick 17?
CREATE TABLE table_5161 ("Round" text,"Pick" real,"Overall" real,"Name" text,"Position" text,"Team" text)
SELECT "Overall" FROM table_5161 WHERE "Pick" = '17'
Which length has a Bullet of 6.5 (.257)?
CREATE TABLE table_name_26 (length VARCHAR,bullet VARCHAR)
SELECT length FROM table_name_26 WHERE bullet = "6.5 (.257)"
tell me the price of taking heparin flush (10 units/ml)?
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 DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'heparin flush (10 units/ml)')
What is the frequency for I/O bus of DMI, voltage of 0.725 1.4v and part cn80617004458ab?
CREATE TABLE table_13614 ("Model number" text,"sSpec number" text,"Frequency" text,"Turbo" text,"GPU frequency" text,"Cores" text,"L2 cache" text,"L3 cache" text,"I/O bus" text,"Mult." text,"Memory" text,"Voltage" text,"Socket" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text)
SELECT "Frequency" FROM table_13614 WHERE "I/O bus" = 'dmi' AND "Voltage" = '0.725–1.4v' AND "Part number(s)" = 'cn80617004458ab'
has patient 004-65662 gone through any lab test since 2103?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid nu...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-65662')) AND STRFTIME('%y', lab.labresulttime) >= '2103'
which patients have aztreonam drug prescription?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Aztreonam"
What is the Population of Sargent County?
CREATE TABLE table_name_38 (population VARCHAR,county VARCHAR)
SELECT population FROM table_name_38 WHERE county = "sargent"
What was the decision on october 5?
CREATE TABLE table_57987 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Decision" FROM table_57987 WHERE "Date" = 'october 5'
What is his record at ufc 115?
CREATE TABLE table_name_14 (record VARCHAR,event VARCHAR)
SELECT record FROM table_name_14 WHERE event = "ufc 115"
what is maximum age of patients whose admission location is clinic referral/premature and primary disease is sternal wound infection?
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 MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "STERNAL WOUND INFECTION"
What are the enrollment dates of all the tests that have result 'Pass', and count them by a bar chart, sort in descending by the y-axis.
CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VAR...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC
SELECT * FROM Comments WHERE Score = 6.
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 PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeI...
SELECT Text, LENGTH(Text) - LENGTH(REPLACE(Text, ' ', '')) + 1 FROM Comments WHERE Score = 6 AND Text LIKE '%?%' AND LENGTH(Text) - LENGTH(REPLACE(Text, ' ', '')) + 1 > 20
Which result's genre was jazz when its label was columbia and its title was requiem?
CREATE TABLE table_42515 ("Year" text,"Title" text,"Genre" text,"Label" text,"Result" text)
SELECT "Result" FROM table_42515 WHERE "Genre" = 'jazz' AND "Label" = 'columbia' AND "Title" = 'requiem'
Cassandra question count by week.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views num...
SELECT MONTH(DATE(Posts.CreationDate)), YEAR(DATE(Posts.CreationDate)), COUNT(Posts.Id) FROM Tags, PostTags, Posts WHERE Tags.TagName = 'cassandra' AND Tags.Id = PostTags.TagId AND PostTags.PostId = Posts.Id AND Posts.CreationDate > '2013-10-01' AND Posts.CreationDate < '2017-01-01' GROUP BY MONTH(DATE(Posts.CreationDa...
Which country is Jim Les from?
CREATE TABLE table_16836 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text)
SELECT "Nationality" FROM table_16836 WHERE "Player" = 'Jim Les'
find the insurance of subject id 6983.
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 demographic.insurance FROM demographic WHERE demographic.subject_id = "6983"
A bar chart showing how many representatives in each party, and I want to display Y-axis from low to high order.
CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real)CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text)
SELECT Party, COUNT(Party) FROM representative GROUP BY Party ORDER BY COUNT(Party)
What was Team Dnepr's position in 2006?
CREATE TABLE table_10068 ("Team" text,"Location" text,"Venue" text,"Capacity" real,"Position in 2006" text)
SELECT "Position in 2006" FROM table_10068 WHERE "Team" = 'dnepr'
For the teams that had fewer than 1 Byes, what was the lowest number of Draws?
CREATE TABLE table_43367 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Draws") FROM table_43367 WHERE "Byes" < '1'
What is the location attendance when the team is Golden State?
CREATE TABLE table_57742 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Location Attendance" FROM table_57742 WHERE "Team" = 'golden state'
What's the to par for england when the score is less than 71?
CREATE TABLE table_62123 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "To par" FROM table_62123 WHERE "Country" = 'england' AND "Score" < '71'
tell me the number of black/haitian patients who had open and other right hemicolectomy.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Opn rt hemicolectomy NEC"
How many patients with morbid obesity/sda primary disease died in or before the year 2183?
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.dod_year <= "2183.0"
What is the most recent final result for the years (won in bold) 1979?
CREATE TABLE table_1463332_2 (most_recent_final VARCHAR,years__won_in_bold_ VARCHAR)
SELECT most_recent_final FROM table_1463332_2 WHERE years__won_in_bold_ = "1979"
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
CREATE TABLE classroom (building VARCHAR,room_number VARCHAR,capacity INTEGER)
SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
since 1 year ago, what were the top three most frequent procedures that patients were given within 2 months after the diagnosis of hpt c w/o hepat coma nos.
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 number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
What was the best album in 1965?
CREATE TABLE table_52143 ("Year" real,"Single" text,"U.S. Country" text,"U.S." text,"U.S. AC" text,"Album" text)
SELECT "U.S. AC" FROM table_52143 WHERE "Album" = 'the best' AND "Year" = '1965'
What is the to par for Paul Azinger from the United States after 1986 for a total bigger than 145?
CREATE TABLE table_name_72 (to_par VARCHAR,total VARCHAR,player VARCHAR,country VARCHAR,year_won VARCHAR)
SELECT COUNT(to_par) FROM table_name_72 WHERE country = "united states" AND year_won > 1986 AND player = "paul azinger" AND total > 145
has patient 81461 been diagnosed with anything in 2105.
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom 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 chartevents (row_i...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105'
Top Users from New Delhi.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAu...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%New Delhi%' ORDER BY Reputation DESC LIMIT 100
What municipality has 719 people and is larger than 108.46 km2?
CREATE TABLE table_name_30 (regional_county_municipality VARCHAR,area__km_2__ VARCHAR,population VARCHAR)
SELECT regional_county_municipality FROM table_name_30 WHERE area__km_2__ > 108.46 AND population = 719
What was the home team score when the score for the away team was 7.9 (51)?
CREATE TABLE table_4723 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_4723 WHERE "Away team score" = '7.9 (51)'
how many days has it been since patient 012-66291 dext 5%-nacl 0.9% 1000 ml lvp was last prescribed on this hospital encounter?
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 treatment (treatmentid number,patientunitstayid number,treatmentname text,...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-662...
What is the score for set 2 when set 3 was 15 6?
CREATE TABLE table_55013 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Set 2" FROM table_55013 WHERE "Set 3" = '15–6'
Which circuit had a round larger than 5?
CREATE TABLE table_41116 ("Round" real,"Race name" text,"Circuit" text,"City/State" text,"Date" text,"Winner(s)" text,"Team" text)
SELECT "Circuit" FROM table_41116 WHERE "Round" > '5'
What's the abbreviation for the country with an inception of 1999 and US$Billion assets of 7.1?
CREATE TABLE table_name_79 (abbreviation VARCHAR,inception VARCHAR,assets_us$billion VARCHAR)
SELECT abbreviation FROM table_name_79 WHERE inception = "1999" AND assets_us$billion = "7.1"
give me the number of patients whose admission type is emergency and ethnicity is white?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "WHITE"
What type of bridge is Colton's Crossing Bridge?
CREATE TABLE table_name_46 (type VARCHAR,name VARCHAR)
SELECT type FROM table_name_46 WHERE name = "colton's crossing bridge"
What was the rank of the 2009-2010 TV season?
CREATE TABLE table_11231 ("Season" real,"Season Premiere" text,"Season Finale" text,"TV Season" text,"Rank" text,"Viewers (in millions)" real)
SELECT "Rank" FROM table_11231 WHERE "TV Season" = '2009-2010'
What is the time of the rider with a speed of 102.962mph?
CREATE TABLE table_53243 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text)
SELECT "Time" FROM table_53243 WHERE "Speed" = '102.962mph'
What times is 398 taught during the Winter terms ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester in...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the correlation between employee_id and department_id in a scatter chart.
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 departments (DEPARTMENT_ID decimal(4,...
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
most cited parsing papers
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE pape...
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ORDER BY CO...
How many incumbents represent district California 34?
CREATE TABLE table_18224 ("District" text,"Incumbent" text,"Party" text,"Elected" text,"Status" text,"Opponent" text)
SELECT COUNT("Incumbent") FROM table_18224 WHERE "District" = 'California 34'
What is the fewest steals any player had?
CREATE TABLE table_25353861_5 (steals INTEGER)
SELECT MIN(steals) FROM table_25353861_5
What is the result for the game before week 7 against BYE?
CREATE TABLE table_65678 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Result" FROM table_65678 WHERE "Week" < '7' AND "Opponent" = 'bye'
Which surface has a Date of 5 november 2011?
CREATE TABLE table_55037 ("Outcome" text,"Date" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Surface" FROM table_55037 WHERE "Date" = '5 november 2011'
How many years had a film that peaked at #10 in the UK?
CREATE TABLE table_name_1 (year VARCHAR,uk_peak_position VARCHAR)
SELECT COUNT(year) FROM table_name_1 WHERE uk_peak_position = "10"
What is the lowest octal with a 30 hexadecimal and less than 0 glyphs?
CREATE TABLE table_name_82 (octal INTEGER,hexadecimal VARCHAR,glyph VARCHAR)
SELECT MIN(octal) FROM table_name_82 WHERE hexadecimal = 30 AND glyph < 0
provide me with the age and location of discharge for patient with patient id 2560.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT demographic.age, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.
CREATE TABLE document_drafts (document_id number,draft_number number,draft_details text)CREATE TABLE ref_document_status (document_status_code text,document_status_description text)CREATE TABLE employees (employee_id number,role_code text,employee_name text,other_details text)CREATE TABLE ref_shipping_agents (shipping_...
SELECT employees.employee_name, COUNT(*) FROM employees JOIN circulation_history ON circulation_history.employee_id = employees.employee_id GROUP BY circulation_history.document_id, circulation_history.draft_number, circulation_history.copy_number ORDER BY COUNT(*) DESC LIMIT 1
What school did the 7-4 player attend?
CREATE TABLE table_11734041_17 (school_club_team_country VARCHAR,height_in_ft VARCHAR)
SELECT school_club_team_country FROM table_11734041_17 WHERE height_in_ft = "7-4"
Find the name and access counts of all documents, in alphabetic order of the document name. Show bar chart.
CREATE TABLE Functional_Areas (functional_area_code VARCHAR(15),parent_functional_area_code VARCHAR(15),functional_area_description VARCHAR(80))CREATE TABLE Roles (role_code VARCHAR(15),role_description VARCHAR(80))CREATE TABLE Document_Structures (document_structure_code VARCHAR(15),parent_document_structure_code VARC...
SELECT document_name, access_count FROM Documents ORDER BY document_name
what is the y = 2009 when the expression is month = floor ((d + e + 114) / 31)?
CREATE TABLE table_214479_8 (y_ VARCHAR,_2009 VARCHAR,expression VARCHAR,month VARCHAR,d VARCHAR,e VARCHAR)
SELECT y_ = _2009 FROM table_214479_8 WHERE expression = month = FLOOR((d + e + 114) / 31)
What are the lowest points when poles were 0 and races were 10?
CREATE TABLE table_26821 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"FLaps" real,"Podiums" real,"Points" real,"Position" text)
SELECT MIN("Points") FROM table_26821 WHERE "Poles" = '0' AND "Races" = '10'
What is the last match with a resigned manner of departure and a round 1 date of vacancy?
CREATE TABLE table_35438 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Last match" text,"Replaced by" text)
SELECT "Last match" FROM table_35438 WHERE "Manner of departure" = 'resigned' AND "Date of vacancy" = 'round 1'
What is the constituency number with electorates (2009) number larger than 152,958?
CREATE TABLE table_name_40 (constituency_number VARCHAR,number_of_electorates__2009_ INTEGER)
SELECT constituency_number FROM table_name_40 WHERE number_of_electorates__2009_ > 152 OFFSET 958
Show institution names along with the number of proteins for each institution in a bar chart.
CREATE TABLE Institution (Institution_id text,Institution text,Location text,Founded real,Type text,Enrollment int,Team text,Primary_Conference text,building_id text)CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage real,accession_number text,sequence_length real,sequence_identity_t...
SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, sort in desc by the Y.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CO...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC
Which Catalog has a Country of Japan?
CREATE TABLE table_name_71 (catalog VARCHAR,country VARCHAR)
SELECT catalog FROM table_name_71 WHERE country = "japan"
How many platinum points were awarded when 9 gold points were awarded?
CREATE TABLE table_11254821_2 (points_awarded__platinum_ VARCHAR,points_awarded__gold_ VARCHAR)
SELECT points_awarded__platinum_ FROM table_11254821_2 WHERE points_awarded__gold_ = 9