instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Proportion of Questions with an Accepted Answer.
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Rev...
SELECT 1.0 * COUNT(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) / COUNT(*) FROM Posts WHERE PostTypeId = 1
what is the number of medicare patients who had clofarabine intravenous infusion?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine"
How many sets were played in the tournament that had 4R in 2011 and 2R in 2008?
CREATE TABLE table_name_60 (Id VARCHAR)
SELECT 2009 FROM table_name_60 WHERE 2011 = "4r" AND 2008 = "2r"
what's the 3rd day with finbeingh position being 16th
CREATE TABLE table_667 ("Year" real,"Finish position" text,"1st day" text,"2nd day" text,"3rd day" text,"4th Day" text)
SELECT "3rd day" FROM table_667 WHERE "Finish position" = '16th'
What was the home team that played Vancouver on April 29?
CREATE TABLE table_name_62 (home VARCHAR,visitor VARCHAR,date VARCHAR)
SELECT home FROM table_name_62 WHERE visitor = "vancouver" AND date = "april 29"
What Date has a label of alfa records?
CREATE TABLE table_70691 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Date" FROM table_70691 WHERE "Label" = 'alfa records'
When did Pharaoh Seth's reign end?
CREATE TABLE table_11838 ("Name" text,"Country" text,"Reign began" text,"Reign ended" text,"Length" text)
SELECT "Reign ended" FROM table_11838 WHERE "Name" = 'pharaoh seth'
Find the number of patients whose ethnicity is white - russian and drug route is ivpca?
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 demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "IVPCA"
What are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, and display by the x-axis in desc.
CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC
what would be the average yearly number of patients diagnosed with toxic myopathy since 3 years ago?
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 AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'toxic myopathy') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY...
How many extra points did right halfback Roswell Wendell have?
CREATE TABLE table_75150 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT "Extra points" FROM table_75150 WHERE "Position" = 'right halfback' AND "Player" = 'roswell wendell'
What was the Company or Product name where Entrepreneurs Geoff and Colette Bell requested 75,000?
CREATE TABLE table_name_25 (company_or_product_name VARCHAR,money_requested__£_ VARCHAR,entrepreneur_s_ VARCHAR)
SELECT company_or_product_name FROM table_name_25 WHERE money_requested__£_ = "75,000" AND entrepreneur_s_ = "geoff and colette bell"
what number of patients born before the year 2034 had lab test item id 51009?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2034" AND lab.itemid = "51009"
What circuit has qualifying as the session?
CREATE TABLE table_name_77 (circuit VARCHAR,session VARCHAR)
SELECT circuit FROM table_name_77 WHERE session = "qualifying"
What are the fewest floors for the building that has a height of 116 meters?
CREATE TABLE table_name_42 (floors INTEGER,height__m_ VARCHAR)
SELECT MIN(floors) FROM table_name_42 WHERE height__m_ = 116
what is the one year survival rate of patients suffering from acute respiratory failure - due to pulmonary infiltrates who were prescribed cefazolin 2 gm in ns 100 ml ivpb (repackage)?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight nu...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
How many hispanic, latino, or puerto rican patients are on drug named sucralfate?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Sucralfate"
What player has +3 to par and score of 75-72=147?
CREATE TABLE table_name_23 (player VARCHAR,to_par VARCHAR,score VARCHAR)
SELECT player FROM table_name_23 WHERE to_par = "+3" AND score = 75 - 72 = 147
What's the score for the t10 player from zimbabwe?
CREATE TABLE table_name_19 (score VARCHAR,place VARCHAR,country VARCHAR)
SELECT score FROM table_name_19 WHERE place = "t10" AND country = "zimbabwe"
What are the names and ids of customers whose address contains TN Show bar chart, and rank in asc by the y-axis.
CREATE TABLE Staff_Department_Assignments (staff_id INTEGER,department_id INTEGER,date_assigned_from DATETIME,job_title_code VARCHAR(10),date_assigned_to DATETIME)CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_status_code VARCHAR(10),order_date DATETIME)CREATE TABLE Order_Items (order_item_id ...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id
What is Opponent, when Location/Attendance is 'Mellon Arena - 17,132'?
CREATE TABLE table_46904 ("Game" real,"Date" real,"Opponent" text,"Score" text,"Decision" text,"Location/Attendance" text,"Record" text)
SELECT "Opponent" FROM table_46904 WHERE "Location/Attendance" = 'mellon arena - 17,132'
Show the players and years played for players from team 'Columbus Crew'.
CREATE TABLE player (player_id number,player text,years_played text,total_wl text,singles_wl text,doubles_wl text,team number)CREATE TABLE team (team_id number,name text)CREATE TABLE match_season (season number,player text,position text,country number,team number,draft_pick_number number,draft_class text,college text)C...
SELECT T1.player, T1.years_played FROM player AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew"
Which district had first elected earlier than 2006 for representation of Broken Arrow, Tulsa?
CREATE TABLE table_name_7 (district VARCHAR,first_elected VARCHAR,towns_represented VARCHAR)
SELECT district FROM table_name_7 WHERE first_elected < 2006 AND towns_represented = "broken arrow, tulsa"
A bar chart for finding the number of the category descriptions of the products whose descriptions include letter 't', and could you rank x axis from low to high order?
CREATE TABLE Ref_Colors (color_code VARCHAR(15),color_description VARCHAR(80))CREATE TABLE Ref_Characteristic_Types (characteristic_type_code VARCHAR(15),characteristic_type_description VARCHAR(80))CREATE TABLE Product_Characteristics (product_id INTEGER,characteristic_id INTEGER,product_characteristic_value VARCHAR(50...
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description
count the number of patients who have had systemic antibiotics - quinolone performed since 3 years ago.
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicat...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - quinolone' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year'))
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of employee_id over hire_date .
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE ...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
Which player has a subtotal of more than 3 and more than 8 in round 1?
CREATE TABLE table_79006 ("Player" text,"Team" text,"Round 1" real,"Round 2" text,"Subtotal" real,"Finals" text,"Total" real)
SELECT "Player" FROM table_79006 WHERE "Subtotal" > '3' AND "Round 1" > '8'
Which Socialist candidate ran against American Labor candidate Caroline O'Day?
CREATE TABLE table_name_65 (socialist_ticket VARCHAR,american_labor_ticket VARCHAR)
SELECT socialist_ticket FROM table_name_65 WHERE american_labor_ticket = "caroline o'day"
Which film has a role named Taylor?
CREATE TABLE table_6390 ("Year" real,"Film" text,"Role" text,"Language" text,"Notes" text)
SELECT "Film" FROM table_6390 WHERE "Role" = 'taylor'
Who held pole position at the race won by Gilles Villeneuve, with the fastest lap held by Gilles Villeneuve, driving a Ferrari?
CREATE TABLE table_56348 ("Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text)
SELECT "Pole Position" FROM table_56348 WHERE "Fastest Lap" = 'gilles villeneuve' AND "Constructor" = 'ferrari' AND "Race Winner" = 'gilles villeneuve'
What are the types and nationalities of every ship?
CREATE TABLE mission (mission_id number,ship_id number,code text,launched_year number,location text,speed_knots number,fate text)CREATE TABLE ship (ship_id number,name text,type text,nationality text,tonnage number)
SELECT type, nationality FROM ship
what is the name of the episode whose premiere was in march 2, 1997?
CREATE TABLE table_24872 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT "Title" FROM table_24872 WHERE "Original air date" = 'March 2, 1997'
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a bar chart, and rank by the how many date of birth from high to low.
CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC
Which play is from Ireland?
CREATE TABLE table_62458 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Player" FROM table_62458 WHERE "Country" = 'ireland'
What is the state of the team who plays in Mumbai?
CREATE TABLE table_66769 ("Team" text,"City" text,"State" text,"Home venue" text,"Capacity" real)
SELECT "State" FROM table_66769 WHERE "Team" = 'mumbai'
What is the size of the crowd for the game with Footscray as the home team?
CREATE TABLE table_32861 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT AVG("Crowd") FROM table_32861 WHERE "Home team" = 'footscray'
Ashley Grimes had what to club?
CREATE TABLE table_49705 ("Exit Date" text,"Pos." text,"Player" text,"To club" text,"Transfer fee" text)
SELECT "To club" FROM table_49705 WHERE "Player" = 'ashley grimes'
What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals?
CREATE TABLE table_name_14 (bronze INTEGER,total VARCHAR,gold VARCHAR,nation VARCHAR)
SELECT MIN(bronze) FROM table_name_14 WHERE gold < 6 AND nation = "italy" AND total > 10
What was the result of the game that was played on 29,30 31 May 1902?
CREATE TABLE table_42819 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text)
SELECT "Result" FROM table_42819 WHERE "Date" = '29,30–31 may 1902'
All CommunityWiky posts by users that aren't closed.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe...
SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Users.DisplayName, Posts.CreationDate FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, ...
Which team has 48 rebounds?
CREATE TABLE table_36063 ("Rank" real,"Name" text,"Team" text,"Games" real,"Rebounds" real)
SELECT "Team" FROM table_36063 WHERE "Rebounds" = '48'
How many bronzes for nations ranked above 7, under 3 golds, and under 10 total medals?
CREATE TABLE table_56104 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_56104 WHERE "Rank" < '7' AND "Gold" < '3' AND "Total" < '10'
What percentage of Slovenes lived in the village of Roach in 1951?
CREATE TABLE table_name_31 (percent_of_slovenes_1951 VARCHAR,village__german_ VARCHAR)
SELECT percent_of_slovenes_1951 FROM table_name_31 WHERE village__german_ = "roach"
How many values for constituency for the vote result of 162?
CREATE TABLE table_73869 ("Constituency" text,"Candidate" text,"Affiliation" text,"Result - votes" real,"Result - %" text,"Loss/gain" text)
SELECT COUNT("Constituency") FROM table_73869 WHERE "Result - votes" = '162'
what is the overall number of chosen ideas where the person is scott parker
CREATE TABLE table_2840500_3 (pick VARCHAR,player VARCHAR)
SELECT COUNT(pick) FROM table_2840500_3 WHERE player = "Scott Parker"
What is the club when the chairman is roger lambrecht?
CREATE TABLE table_29447 ("Club" text,"Chairman" text,"Current manager" text,"Team captain" text,"Kitmaker" text,"Shirt sponsor" text)
SELECT "Club" FROM table_29447 WHERE "Chairman" = 'Roger Lambrecht'
Name the total number of pommel horses for vault of 9.475 and rank more than 16
CREATE TABLE table_10188 ("Rank" real,"Gymnast" text,"Floor Exercise" real,"Pommel Horse" real,"Rings" real,"Vault" real,"Parallel Bars" real,"Horizontal Bar" real,"Total" real)
SELECT COUNT("Pommel Horse") FROM table_10188 WHERE "Rank" > '16' AND "Vault" = '9.475'
What is Mark Henry's brand?
CREATE TABLE table_65340 ("Draw" real,"Entrant" text,"Brand" text,"Order" text,"Eliminated by" text,"Time" text)
SELECT "Brand" FROM table_65340 WHERE "Entrant" = 'mark henry'
How many profits is the company that is headquartered in the USA, in the banking industry, and has sales (billion $) less than 98.64 bringing in?
CREATE TABLE table_name_54 (profits__billion_ INTEGER,sales__billion_$_ VARCHAR,headquarters VARCHAR,industry VARCHAR)
SELECT SUM(profits__billion_) AS $_ FROM table_name_54 WHERE headquarters = "usa" AND industry = "banking" AND sales__billion_$_ < 98.64
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order by the Y in ascending.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer
Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart, show by the Y-axis in desc.
CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATE,End_Date DATE)CREATE TABL...
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC
How many Starts that have Cuts made of 2, Top 25 larger than 0, and Earnings ($) smaller than 338,067?
CREATE TABLE table_name_66 (starts VARCHAR,earnings__$_ VARCHAR,cuts_made VARCHAR,top_25 VARCHAR)
SELECT COUNT(starts) FROM table_name_66 WHERE cuts_made = 2 AND top_25 > 0 AND earnings__$_ < 338 OFFSET 067
What is the number of the game that was played in the time of 2:38?
CREATE TABLE table_name_95 (game INTEGER,time VARCHAR)
SELECT MAX(game) FROM table_name_95 WHERE time = "2:38"
how many total clubs are listed ?
CREATE TABLE table_203_581 (id number,"club" text,"chinese" text,"city" text,"home stadium" text,"capacity" number,"average attendance" number)
SELECT COUNT("club") FROM table_203_581
What is the Notes of the Frequency with Call sign CFUN-FM-1?
CREATE TABLE table_name_33 (notes VARCHAR,call_sign VARCHAR)
SELECT notes FROM table_name_33 WHERE call_sign = "cfun-fm-1"
What Player Club Team is Indiana Ice (ushl)?
CREATE TABLE table_name_10 (player VARCHAR,club_team VARCHAR)
SELECT player FROM table_name_10 WHERE club_team = "indiana ice (ushl)"
What is the Kanji for the Ayanami dd-45?
CREATE TABLE table_34249 ("Kanji" text,"Name" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" text)
SELECT "Kanji" FROM table_34249 WHERE "Name" = 'ayanami dd-45'
What was the nationality of player picked no. 179?
CREATE TABLE table_2679061_9 (nationality VARCHAR,pick__number VARCHAR)
SELECT nationality FROM table_2679061_9 WHERE pick__number = 179
Which department has the highest average student GPA, and what is the average gpa?
CREATE TABLE class (class_code text,crs_code text,class_section text,class_time text,class_room text,prof_num number)CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_num numbe...
SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
what's the name of the drug that was first prescribed to patient 60136?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locat...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136) ORDER BY prescriptions.startdate LIMIT 1
body mass index range ( 25 _ 38 kg / m2 ) with type ii diabetes mellitus receiving stable dose of metformin bid for the previous 60 days for glucose control
CREATE TABLE table_train_232 ("id" int,"metastatic_cancer" bool,"hemoglobin_a1c_hba1c" float,"diabetic" string,"short_life_expectancy" bool,"body_mass_index_bmi" float,"a1c" float,"NOUSE" float)
SELECT * FROM table_train_232 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 38 AND diabetic = 'ii'
If the spectral type is g1v, what is the constellation?
CREATE TABLE table_1820752_1 (constellation VARCHAR,spectral_type VARCHAR)
SELECT constellation FROM table_1820752_1 WHERE spectral_type = "G1V"
What is the average number of points scored by Joe Vagana when making fewer than 2 tries?
CREATE TABLE table_name_46 (points INTEGER,player VARCHAR,tries VARCHAR)
SELECT AVG(points) FROM table_name_46 WHERE player = "joe vagana" AND tries < 2
who is the only country to win only golds ?
CREATE TABLE table_204_211 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_204_211 WHERE "silver" = 0 AND "bronze" = 0
Name the away team score for geelong away team
CREATE TABLE table_name_25 (away_team VARCHAR)
SELECT away_team AS score FROM table_name_25 WHERE away_team = "geelong"
High View Counts with no Images. Questions whos answers don't have any screenshots but have a very high view count
CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body ...
SELECT P.Id AS "post_link", P.Score, P.ViewCount FROM Posts AS P WHERE P.ClosedDate IS NULL AND P.PostTypeId = 1 AND P.AnswerCount >= 1 AND P.Id NOT IN (SELECT A.ParentId FROM Posts AS A WHERE A.PostTypeId = 2 AND A.Score >= 2 AND A.Body LIKE '%imgur%') ORDER BY P.ViewCount DESC
Which Date has a Score of 24-7, and a Record of 4-10?
CREATE TABLE table_name_12 (date VARCHAR,score VARCHAR,record VARCHAR)
SELECT date FROM table_name_12 WHERE score = "24-7" AND record = "4-10"
In the year 2009 who was the under-13?
CREATE TABLE table_28600 ("Year" real,"Under-11" text,"Under-13" text,"Under-15" text,"Under-17" text,"Under-19" text)
SELECT "Under-13" FROM table_28600 WHERE "Year" = '2009'
When the Home team of geelong played, what was their lowest Crowd number?
CREATE TABLE table_name_23 (crowd INTEGER,home_team VARCHAR)
SELECT MIN(crowd) FROM table_name_23 WHERE home_team = "geelong"
How many picks had a round smaller than 6 and an overall bigger than 153?
CREATE TABLE table_name_47 (pick INTEGER,round VARCHAR,overall VARCHAR)
SELECT SUM(pick) FROM table_name_47 WHERE round < 6 AND overall > 153
what are patient 012-169's gender?
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 DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-169'
Plot a scatter chart, order id by the total number .
CREATE TABLE Financial_Transactions (transaction_id INTEGER,account_id INTEGER,invoice_number INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DECIMAL(19,4),transaction_comment VARCHAR(255),other_transaction_details VARCHAR(255))CREATE TABLE Invoice_Line_Items (order_item_id INTEGER,inv...
SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id
Name the Player who has a Country of united states, and a To par of 5?
CREATE TABLE table_name_73 (player VARCHAR,country VARCHAR,to_par VARCHAR)
SELECT player FROM table_name_73 WHERE country = "united states" AND to_par = "–5"
What is the Semi finalists when the Runner-up was katrina adams zina garrison-jackson?
CREATE TABLE table_40286 ("Week of" text,"Tier" text,"Winner" text,"Runner-up" text,"Semi finalists" text)
SELECT "Semi finalists" FROM table_40286 WHERE "Runner-up" = 'katrina adams zina garrison-jackson'
What is the size difference for exa?
CREATE TABLE table_name_29 (size_difference VARCHAR,prefix VARCHAR)
SELECT size_difference FROM table_name_29 WHERE prefix = "exa"
Where was the game with the result of 22-20 played?
CREATE TABLE table_11982 ("Date" text,"Venue" text,"Opponent" text,"Result" text,"Tournament" text,"Scored" real)
SELECT "Venue" FROM table_11982 WHERE "Result" = '22-20'
What poll had Steve Poizner at 37%?
CREATE TABLE table_70597 ("Poll source" text,"Date(s) administered" text,"Tom Campbell*" text,"Meg Whitman" text,"Steve Poizner" text,"Peter Foy*" text)
SELECT "Poll source" FROM table_70597 WHERE "Steve Poizner" = '37%'
Name the type with cancelable of no and attribute of ondragend
CREATE TABLE table_name_79 (type VARCHAR,cancelable VARCHAR,attribute VARCHAR)
SELECT type FROM table_name_79 WHERE cancelable = "no" AND attribute = "ondragend"
What is the Date, when the Opponent is Gisela Dulko?
CREATE TABLE table_14823 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Date" FROM table_14823 WHERE "Opponent" = 'gisela dulko'
Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14
CREATE TABLE table_66868 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Rider" FROM table_66868 WHERE "Laps" > '23' AND "Manufacturer" = 'aprilia' AND "Grid" = '14'
Compare the total enrollment in each county with a bar chart.
CREATE TABLE endowment (endowment_id int,School_id int,donator_name text,amount real)CREATE TABLE School (School_id text,School_name text,Location text,Mascot text,Enrollment int,IHSAA_Class text,IHSAA_Football_Class text,County text)CREATE TABLE budget (School_id int,Year int,Budgeted int,total_budget_percent_budgeted...
SELECT County, SUM(Enrollment) FROM School GROUP BY County
Show all the cinema names and opening years in descending order of opening year.
CREATE TABLE schedule (cinema_id number,film_id number,date text,show_times_per_day number,price number)CREATE TABLE film (film_id number,rank_in_series number,number_in_season number,title text,directed_by text,original_air_date text,production_code text)CREATE TABLE cinema (cinema_id number,name text,openning_year nu...
SELECT name, openning_year FROM cinema ORDER BY openning_year DESC
How many dead patients were less than 41 years of age?
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 WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41"
For those employees who was hired before 2002-06-21, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart, sort the average of manager id in asc order.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decima...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID)
What was the score of the French Open?
CREATE TABLE table_name_7 (score_in_the_final VARCHAR,championship VARCHAR)
SELECT score_in_the_final FROM table_name_7 WHERE championship = "french open"
What's the total of Year that's got a Team of Porsche Kremer Racing?
CREATE TABLE table_6251 ("Year" real,"Class" text,"Team" text,"Chassis" text,"Tyre" text,"Laps" real)
SELECT SUM("Year") FROM table_6251 WHERE "Team" = 'porsche kremer racing'
What was the score of Game 48?
CREATE TABLE table_name_33 (score VARCHAR,game VARCHAR)
SELECT score FROM table_name_33 WHERE game = 48
Which class is easiest to fulfill the MDE requirement for me ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program_course (program_id int,cour...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
list all DAILY flights between OAKLAND and BOSTON using AA
CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE flight_stop (fli...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST...
body mass index > 30 kg / m2
CREATE TABLE table_train_271 ("id" int,"renal_disease" bool,"hepatic_disease" bool,"smoking" bool,"coronary_artery_disease_cad" bool,"serum_creatinine" float,"body_mass_index_bmi" float,"myocardial_infarction" bool,"NOUSE" float)
SELECT * FROM table_train_271 WHERE body_mass_index_bmi > 30
how many students are advised by each rank of faculty? List the rank and the number of students, order by the the total number from high to low.
CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),...
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY COUNT(*) DESC
what was this actor 's first television role ?
CREATE TABLE table_204_729 (id number,"year" text,"show" text,"role" text,"channel" text,"notes" text)
SELECT "role" FROM table_204_729 ORDER BY "year" LIMIT 1
count the number of patients whose death status is 1 and days of hospital stay is greater than 14?
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 text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "14"
What was the vote when the air date is 4 october 1997?
CREATE TABLE table_25016824_2 (vote VARCHAR,air_date VARCHAR)
SELECT vote FROM table_25016824_2 WHERE air_date = "4 October 1997"
Average response time by tags. The average response time for most popular tags (with at least one vote)
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 Votes (Id number,PostId number,VoteTypeId number,UserId number,...
SELECT COUNT(DISTINCT Id) AS responses, AVG(CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 24.0 AS INT)) AS average_response_time_in_hours FROM Posts WHERE CreationDate >= '2020-09-2' AND ClosedDate <= '2020-09-28'
What day is their record 13-15?
CREATE TABLE table_37347 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_37347 WHERE "Record" = '13-15'
Who was the writer for the show titled 'and the rocky goes to...'?
CREATE TABLE table_26033 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text)
SELECT "Written by" FROM table_26033 WHERE "Title" = 'And the Rocky Goes To...'
what's the doubles w-l with years played value of 1 (1968)
CREATE TABLE table_10023387_1 (doubles_w_l VARCHAR,years_played VARCHAR)
SELECT doubles_w_l FROM table_10023387_1 WHERE years_played = "1 (1968)"
Name the straight to number 1 for tribal king
CREATE TABLE table_3763 ("Artist" text,"Country" text,"Number-one single(s)" text,"Year" real,"Weeks at #1" real,"Straight to #1 ?" text)
SELECT "Straight to #1 ?" FROM table_3763 WHERE "Artist" = 'Tribal King'
how many patients marital status is divorced and diagnoses is pressure ulcer, stage i?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Pressure ulcer, stage I"