instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Which player played for Western Kentucky?
CREATE TABLE table_46049 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text)
SELECT "Player" FROM table_46049 WHERE "School/Club Team" = 'western kentucky'
Which League Goals have FA Cup Apps of 2, and Total Goals smaller than 0?
CREATE TABLE table_13792 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"Total Apps" text,"Total Goals" real)
SELECT AVG("League Goals") FROM table_13792 WHERE "FA Cup Apps" = '2' AND "Total Goals" < '0'
Who is the manufacturer of the mini jet red baron ride that opened before 2001?
CREATE TABLE table_15465 ("Ride Name" text,"Type" text,"Opened in" real,"Themed Land" text,"Manufacture" text)
SELECT "Manufacture" FROM table_15465 WHERE "Opened in" < '2001' AND "Type" = 'mini jet red baron'
On how many locations is there a church named Askrova Bedehuskapell, built in 1957?
CREATE TABLE table_178381_1 (location_of_the_church VARCHAR,year_built VARCHAR,church_name VARCHAR)
SELECT COUNT(location_of_the_church) FROM table_178381_1 WHERE year_built = "1957" AND church_name = "Askrova bedehuskapell"
For those records from the products and each product's manufacturer, draw a scatter chart about the correlation between code and revenue , and group by attribute founder.
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.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
What is the production code for the episode with 5.5 million u.s. viewers?
CREATE TABLE table_28195898_1 (production_code VARCHAR,us_viewers__millions_ VARCHAR)
SELECT production_code FROM table_28195898_1 WHERE us_viewers__millions_ = "5.5"
What was the average number of 'goals for', scored in the club Real Oviedo that had a 'goal difference' lower than -16 and fewer than 9 wins?
CREATE TABLE table_name_68 (goals_for INTEGER,wins VARCHAR,goal_difference VARCHAR,club VARCHAR)
SELECT AVG(goals_for) FROM table_name_68 WHERE goal_difference < -16 AND club = "real oviedo" AND wins < 9
male or female 20 _ 75 years of age inclusive.
CREATE TABLE table_train_195 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"allergy_to_perflutren" bool,"heart_disease" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_195 WHERE (gender = 'male' OR gender = 'female') AND (age >= 20 AND age <= 75)
What is them two (the two) when we two is ngalbelpa?
CREATE TABLE table_15990 ("Case/Suffix" text,"we two" text,"you and I" text,"you two" text,"them two (the two)" text,"who-two" text)
SELECT "them two (the two)" FROM table_15990 WHERE "we two" = 'ngalbelpa'
What is the number of ships?
CREATE TABLE ship (ship_id number,name text,type text,nationality text,tonnage number)CREATE TABLE mission (mission_id number,ship_id number,code text,launched_year number,location text,speed_knots number,fate text)
SELECT COUNT(*) FROM ship
list patient identifications of patients who were diagnosed with hx-rectal & anal malign in 2101.
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE inputevents_cv (row_id number,subject_id number...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-rectal & anal malign') AND STRFTIME('%y', diagnoses_icd.charttime) = '2...
Who was the opponent of the match in round sf with a result of 0-0?
CREATE TABLE table_10873 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_10873 WHERE "Round" = 'sf' AND "Result" = '0-0'
Members by Rep in Ireland.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance t...
SELECT DisplayName, Reputation, Location FROM Users WHERE UPPER(Location) LIKE '%IRELAND%' ORDER BY Reputation DESC
what were the drugs which were added to patient 2518 today compared to the ones yesterday?
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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE chartevents (row_id number,s...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE ...
What is the hometown of trinity high school?
CREATE TABLE table_315 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT "Hometown" FROM table_315 WHERE "School" = 'Trinity High School'
when did patient 031-24513 last receive a ultrasonography - abdomen, until 2104?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND treatment.treatmentname = 'ultrasonography - abd...
Which Drawn has a Lost larger than 0, and Points smaller than 11, and Games smaller than 7?
CREATE TABLE table_name_98 (drawn INTEGER,games VARCHAR,lost VARCHAR,points VARCHAR)
SELECT AVG(drawn) FROM table_name_98 WHERE lost > 0 AND points < 11 AND games < 7
until 3 years ago what were the top three most frequent procedures that patients received within the same month after being diagnosed with ac myl leuk wo achv rmsn?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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,ro...
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...
Bar chart x axis customer status code y axis the total number
CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50))CREATE TABLE Lessons (lesson_id INTEGER,customer_id INTEGER,lesson_status_code VARCHAR(15),staff_id INTEGER,vehicle_id INTEGER,lesson_date DATETIM...
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
what are all flights from DENVER to PHILADELPHIA on saturday
CREATE TABLE airline (airline_code varchar,airline_name text,note text)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 code_description (code varchar,description text)CREATE ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 26 AND date_day.month_number = 7 ...
WHAT IS THE WORST SCORE WHEN THE BEST SCORE WAS 8.8 AND AVERAGE WAS LARGER THAN 6.2?
CREATE TABLE table_8632 ("Place" real,"Star" text,"Average" real,"Best score" real,"Worst score" real)
SELECT COUNT("Worst score") FROM table_8632 WHERE "Best score" = '8.8' AND "Average" > '6.2'
since 4 years ago, how many patients were prescribed simvastatin 40 mg po tabs?
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'simvastatin 40 mg po tabs' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year'))
What is the original air date of the episode with the production code 1115?
CREATE TABLE table_18367694_2 (original_air_date VARCHAR,production_code VARCHAR)
SELECT original_air_date FROM table_18367694_2 WHERE production_code = 1115
what is the gdp ( bn ) where capital is capital?
CREATE TABLE table_12108_1 (gdp___bn__ VARCHAR)
SELECT gdp___bn__ FROM table_12108_1 WHERE "capital" = "capital"
who is the tallest member of estonia 's men 's national volleyball team ?
CREATE TABLE table_203_116 (id number,"no." number,"player" text,"birth date" text,"weight" number,"height" number,"position" text,"current club" text)
SELECT "player" FROM table_203_116 ORDER BY "height" DESC LIMIT 1
the 2009 asian championships were located in guangzhou , china . what city and country were the asian championships held in before guangzhou , china ?
CREATE TABLE table_203_436 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT "venue" FROM table_203_436 WHERE "competition" = 'asian championships' AND "year" < 2009
What was the 1st leg for Team 2, Slovan Liberec?
CREATE TABLE table_name_79 (team_2 VARCHAR)
SELECT 1 AS st_leg FROM table_name_79 WHERE team_2 = "slovan liberec"
Average Score of posts created within two days of user creation date in 2019.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name te...
SELECT Posts.Score FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.CreationDate < DATEADD(Day, 2, Users.CreationDate) AND YEAR(Users.CreationDate) = 2019
How many weeks are shown for the champion of john mcenroe 6 2, 6 3?
CREATE TABLE table_24492 ("Week of" text,"Tournament" text,"Champion" text,"Runner-up" text,"Semifinalists" text,"Quarterfinalists" text)
SELECT COUNT("Week of") FROM table_24492 WHERE "Champion" = 'John McEnroe 6–2, 6–3'
what is the monthly maximum value of patient 25796's monocytes until 4 years ago?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (r...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25796) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'monocytes') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '...
Can you tell me the average Figures that has the Placings of 34, and the Total larger than 1247.51?
CREATE TABLE table_name_63 (figures INTEGER,placings VARCHAR,total VARCHAR)
SELECT AVG(figures) FROM table_name_63 WHERE placings = 34 AND total > 1247.51
What is the lowest pick number for Arturo McDowell, who plays the OF position for the San Francisco Giants?
CREATE TABLE table_name_13 (pick INTEGER,player VARCHAR,position VARCHAR,team VARCHAR)
SELECT MIN(pick) FROM table_name_13 WHERE position = "of" AND team = "san francisco giants" AND player = "arturo mcdowell"
Who played against the away team hereford united?
CREATE TABLE table_name_16 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_16 WHERE away_team = "hereford united"
What was the Result of the game on December 14, 1986 after Week 11?
CREATE TABLE table_name_10 (result VARCHAR,week VARCHAR,date VARCHAR)
SELECT result FROM table_name_10 WHERE week > 11 AND date = "december 14, 1986"
Round of 9 involved what name?
CREATE TABLE table_69683 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "Name" FROM table_69683 WHERE "Round" = '9'
What is the year of the ceremony with a not nominated result and ni iji sin as the original title?
CREATE TABLE table_name_12 (year__ceremony_ VARCHAR,result VARCHAR,original_title VARCHAR)
SELECT year__ceremony_ FROM table_name_12 WHERE result = "not nominated" AND original_title = "ničiji sin"
how many patients have undergone aortocor bypas-2 cor art within 2 months during this year after the previous procedure of parent infus nutrit sub?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_proce...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'parent infu...
Who is the visitor on the date december 31?
CREATE TABLE table_name_95 (visitor VARCHAR,date VARCHAR)
SELECT visitor FROM table_name_95 WHERE date = "december 31"
Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart, list facility_code from high to low order.
CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartment_Facilities (apt_id ...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY facility_code DESC
Who is the driver from 1969?
CREATE TABLE table_name_42 (driver VARCHAR,year VARCHAR)
SELECT driver FROM table_name_42 WHERE year = "1969"
How many were in attendance when the league position was 16th and the score was F A of 0 3?
CREATE TABLE table_37371 ("Date" text,"League position" text,"Opponents" text,"Venue" text,"Result" text,"Score F\u2013A" text,"Attendance" real)
SELECT COUNT("Attendance") FROM table_37371 WHERE "League position" = '16th' AND "Score F\u2013A" = '0–3'
when was the last microbiological test of patient 031-3355 performed in 12/2105?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2...
has patient 027-95744 been diagnosed with anything since 2105.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-95744')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105'
Name the number of date for dallas
CREATE TABLE table_22893781_6 (date VARCHAR,team VARCHAR)
SELECT COUNT(date) FROM table_22893781_6 WHERE team = "Dallas"
What kind of surface was the tournament at Pune played on?
CREATE TABLE table_name_56 (surface VARCHAR,tournament VARCHAR)
SELECT surface FROM table_name_56 WHERE tournament = "pune"
What team played the Jazz at game 68?
CREATE TABLE table_47814 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Team" FROM table_47814 WHERE "Game" = '68'
what's the name of the drug that patient 41393's been prescribed two or more times until 03/2103?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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,langu...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 41393) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-03' GROUP BY prescriptions.drug) AS t1 WHERE t1.c...
List the lowest number of assists.
CREATE TABLE table_28617 ("#" real,"Player" text,"Points" real,"Rebounds" real,"Assists" real,"Opponent" text,"Date" text)
SELECT MIN("Assists") FROM table_28617
Who was the home team when Hawthorn was the away team?
CREATE TABLE table_32498 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_32498 WHERE "Away team" = 'hawthorn'
how many patients admitted before the year 2156 have diagnosis icd9 code 76518?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2156" AND diagnoses.icd9_code = "76518"
Show sum of budget in each year and bin creation time by year in a line chart, and could you rank from low to high by the X?
CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)
SELECT Creation, SUM(Budget_in_Billions) FROM department ORDER BY Creation
What is the latest founding date?
CREATE TABLE table_2331 ("School" text,"Location(s)" text,"Control" text,"Type" text,"Enrollment (2005)" text,"Founded" real)
SELECT MAX("Founded") FROM table_2331
what was the last diagnostic time of pneumonia - community-acquired of patient 017-49375 since 2105?
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 allergy (allergyid number,patientunitstayid number,drugname text,allergyna...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49375')) AND diagnosis.diagnosisname = 'pneumonia - community...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and salary in a bar chart.
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 PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Positive scored questions without answers for c++ tags.
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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos...
SELECT Id AS "Post Link", * FROM Posts WHERE AnswerCount = 0 AND Tags LIKE '%c++%' AND Score > 0 AND ClosedDate IS NULL ORDER BY Score DESC
Posts with minimum answercount,score.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body ...
SELECT CAST((JULIANDAY(ClosedDate) - JULIANDAY(CreationDate)) * 86400.0 AS INT) AS Total_Time, Tags, Title, FavoriteCount, AnswerCount, Score, CommentCount, Posts.Id FROM Posts, PostTypes WHERE NOT ClosedDate IS NULL AND Posts.PostTypeId = PostTypes.Id AND PostTypes.Name = 'Question' ORDER BY Total_Time LIMIT 10
What is the venue with a competition in 1964?
CREATE TABLE table_name_15 (venue VARCHAR,year VARCHAR)
SELECT venue FROM table_name_15 WHERE year = 1964
what are the three most frequently given diagnoses until 1 year ago for patients who were previously diagnosed with fluid overload nec within the same month?
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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREAT...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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 = admissions...
What are the headquarters without companies that are in the banking industry?
CREATE TABLE gas_station (station_id number,open_year number,location text,manager_name text,vice_manager_name text,representative_name text)CREATE TABLE company (company_id number,rank number,company text,headquarters text,main_industry text,sales_billion number,profits_billion number,assets_billion number,market_valu...
SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
What is the total number of Against, when Losses is less than 52, when Matches is greater than 4, and when Draw is less than 2?
CREATE TABLE table_name_66 (against VARCHAR,draw VARCHAR,losses VARCHAR,matches VARCHAR)
SELECT COUNT(against) FROM table_name_66 WHERE losses < 52 AND matches > 4 AND draw < 2
number of cities in new jersey where the korean population is greater than 15 %
CREATE TABLE table_204_190 (id number,"rank" number,"city" text,"county" text,"state" text,"percentage" text)
SELECT COUNT("city") FROM table_204_190 WHERE "state" = 'new jersey' AND "percentage" > 15
What is the id and name of the employee with the highest salary?
CREATE TABLE certificate (eid number,aid number)CREATE TABLE flight (flno number,origin text,destination text,distance number,departure_date time,arrival_date time,price number,aid number)CREATE TABLE employee (eid number,name text,salary number)CREATE TABLE aircraft (aid number,name text,distance number)
SELECT eid, name FROM employee ORDER BY salary DESC LIMIT 1
Who was the team captain for Crystal Palace?
CREATE TABLE table_name_56 (captain VARCHAR,team VARCHAR)
SELECT captain FROM table_name_56 WHERE team = "crystal palace"
What is the city of the Museum that houses the specimen discovered by Jane Solem?
CREATE TABLE table_67482 ("Name" text,"Discovered" real,"Museum" text,"Museum city" text,"Discoverer" text,"Formation" text,"Location" text)
SELECT "Museum city" FROM table_67482 WHERE "Discoverer" = 'jane solem'
A bar chart shows the distribution of All_Home and School_ID , and group by attribute ACC_Home.
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_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home
Give the distinct names of wines made before 2000 or after 2010.
CREATE TABLE appellations (no number,appelation text,county text,state text,area text,isava text)CREATE TABLE wine (no number,grape text,winery text,appelation text,state text,name text,year number,price number,score number,cases number,drink text)CREATE TABLE grapes (id number,grape text,color text)
SELECT DISTINCT name FROM wine WHERE year < 2000 OR year > 2010
What was the home team for the 2nd leg for the match having a 1st leg score of 2-1?
CREATE TABLE table_38614 ("Home (1st leg)" text,"Home (2nd leg)" text,"1st Leg" text,"2nd leg" text,"Aggregate" text)
SELECT "Home (2nd leg)" FROM table_38614 WHERE "1st Leg" = '2-1'
What is the program where the focus is general management?
CREATE TABLE table_17730 ("Program" text,"Degree" text,"Focus" text,"Teaching language" text,"Duration (years)" text,"full-time/part-time" text,"ECTS Credit Points" real)
SELECT "Program" FROM table_17730 WHERE "Focus" = 'General Management'
what is the genre of the last title on this chart ?
CREATE TABLE table_204_480 (id number,"title" text,"alternate title(s)" text,"year" number,"manufacturer" text,"genre(s)" text,"max. players" number)
SELECT "genre(s)" FROM table_204_480 ORDER BY id DESC LIMIT 1
what is the name of the oldest map/catalog ?
CREATE TABLE table_204_281 (id number,"map or catalog" text,"creator" text,"time created" text,"contets" text,"links" text)
SELECT "map or catalog" FROM table_204_281 ORDER BY id LIMIT 1
Who was the spokesperson for France in 1970?
CREATE TABLE table_1368649_9 (spokesperson VARCHAR,year_s_ VARCHAR)
SELECT spokesperson FROM table_1368649_9 WHERE year_s_ = 1970
In what settlement is the population 1114?
CREATE TABLE table_27838 ("Settlement" text,"Cyrillic Name" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text)
SELECT "Settlement" FROM table_27838 WHERE "Population (2011)" = '1114'
during the previous year, what was the five most common medications prescribed to male patients 20s during the same month after they had been diagnosed with dmii wo cmp nt st uncntr?
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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREAT...
SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
What are the notes of the patience theme?
CREATE TABLE table_name_76 (notes VARCHAR,theme VARCHAR)
SELECT notes FROM table_name_76 WHERE theme = "patience"
what is the number of patients whose diagnoses icd9 code is 9951?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "9951"
give me the number of patients whose death status is 0 and procedure short title is arterial catheterization?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Arterial catheterization"
how many patients this year were staying in the ward 29?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_i...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 29 AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
Name the james e. holmes for duane hensley
CREATE TABLE table_25330991_3 (james_e_holmes VARCHAR,western_rockingham_middle_school VARCHAR)
SELECT james_e_holmes FROM table_25330991_3 WHERE western_rockingham_middle_school = "Duane Hensley"
What is the sum of the stages for category 1 races after the year 2003?
CREATE TABLE table_name_73 (stage INTEGER,category VARCHAR,year VARCHAR)
SELECT SUM(stage) FROM table_name_73 WHERE category = "1" AND year > 2003
count the number of patients whose short title of diagnosis is hx-ven thrombosis/embols and stayed in hospital for more than 7 days.
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.short_title = "Hx-ven thrombosis/embols"
On September 7 what was the record?
CREATE TABLE table_69057 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Record" FROM table_69057 WHERE "Date" = 'september 7'
Who was the home team on January 8?
CREATE TABLE table_67248 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Home" FROM table_67248 WHERE "Date" = 'january 8'
which author had a poem on this list with the first line as it fell upon day and also a poem that starts with if music and sweet poetry agree .
CREATE TABLE table_201_31 (id number,"number" number,"author" text,"first line" text,"notes" text)
SELECT "author" FROM table_201_31 WHERE "first line" = '"as it fell upon a day"'
Is there another person besides Prof. Etzion that teaches Leading Non-Profit Organizations ?
CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id in...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Leading Non-Profit Organizations%' AND NOT instructor.name LIKE '%Etzion%' AND offering_instructor.instru...
How many candidates won the election in the district whose incumbent is Bud Shuster?
CREATE TABLE table_18295 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT COUNT("Candidates") FROM table_18295 WHERE "Incumbent" = 'Bud Shuster'
When was Alexey Kuleshov born?
CREATE TABLE table_23427 ("Shirt No" real,"Nationality" text,"Player" text,"Birth Date" text,"Height" real,"Position" text)
SELECT "Birth Date" FROM table_23427 WHERE "Player" = 'Alexey Kuleshov'
when did new zealand last compete?
CREATE TABLE table_14308895_2 (last_competed INTEGER,country_territory VARCHAR)
SELECT MAX(last_competed) FROM table_14308895_2 WHERE country_territory = "New Zealand"
Name the guest for 1.64m ratings
CREATE TABLE table_29135051_2 (guest_s_ VARCHAR,ratings VARCHAR)
SELECT guest_s_ FROM table_29135051_2 WHERE ratings = "1.64m"
which high school left the same year as fenton high school ?
CREATE TABLE table_203_591 (id number,"high school" text,"join\nyear" text,"from" text,"left" text,"league left to" text)
SELECT "high school" FROM table_203_591 WHERE "high school" <> 'fenton' AND "left" = (SELECT "left" FROM table_203_591 WHERE "high school" = 'fenton')
Show all ministers who do not belong to Progress Party, and count them by a bar chart, and could you show total number from high to low order?
CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party_events (E...
SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY COUNT(Minister) DESC
What season number was assigned to the episode identified with the production code 401?
CREATE TABLE table_30278 ("Series no." real,"Season no." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text)
SELECT "Season no." FROM table_30278 WHERE "Production code" = '401'
How many reserves were established on 19740329 29.03.1974?
CREATE TABLE table_26013618_1 (nsg_nr VARCHAR,date_established VARCHAR)
SELECT COUNT(nsg_nr) FROM table_26013618_1 WHERE date_established = "19740329 29.03.1974"
What's the catalog number for a record from columbia formatted in a cd/dvd that's from the United States region?
CREATE TABLE table_55146 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Catalog" FROM table_55146 WHERE "Label" = 'columbia' AND "Region" = 'united states' AND "Format" = 'cd/dvd'
what is the number of patients whose drug code is ris1l and lab test fluid is pleural?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "RIS1L" AND lab.fluid = "Pleural"
Which Brazil scorers have a Result of w, and a Competition of world cup qualifying, and a Date of february 28, 1954?
CREATE TABLE table_name_5 (brazil_scorers VARCHAR,date VARCHAR,result VARCHAR,competition VARCHAR)
SELECT brazil_scorers FROM table_name_5 WHERE result = "w" AND competition = "world cup qualifying" AND date = "february 28, 1954"
How many weeks are there?
CREATE TABLE table_16216 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real)
SELECT MAX("Week") FROM table_16216
Who was the Elevator of Giacomo Colonna?
CREATE TABLE table_name_21 (elevator VARCHAR,elector VARCHAR)
SELECT elevator FROM table_name_21 WHERE elector = "giacomo colonna"
What was the position in 1959-1960 for the Sporting De Braga club?
CREATE TABLE table_61487 ("Clubs" text,"Seasons at this level" text,"Settlements" text,"Season joined league" text,"Position in 1959\u20131960" text)
SELECT "Position in 1959\u20131960" FROM table_61487 WHERE "Clubs" = 'sporting de braga'
What are the different role codes for users, and how many users have each Show bar chart, and rank in desc by the bars.
CREATE TABLE Images (image_id INTEGER,image_alt_text VARCHAR(80),image_name VARCHAR(40),image_url VARCHAR(255))CREATE TABLE Functional_Areas (functional_area_code VARCHAR(15),parent_functional_area_code VARCHAR(15),functional_area_description VARCHAR(80))CREATE TABLE Documents (document_code VARCHAR(15),document_struct...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY role_code DESC
Search for symbols in question body.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate ti...
SELECT p.Score, p.Id AS "post_link" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'sh' AND p.Body LIKE '%${@%'