instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Who was the home team that the Clippers played?
CREATE TABLE table_name_64 (home VARCHAR,visitor VARCHAR)
SELECT home FROM table_name_64 WHERE visitor = "clippers"
Event number 38m was held on which date?
CREATE TABLE table_24729 ("Date" text,"Event #" text,"Event" text,"Winner" text,"Prize" text,"Entries" text,"Prize Pool" text,"Elapsed Time" text)
SELECT "Date" FROM table_24729 WHERE "Event #" = '38M'
What time slot had an adult rating of 0.6?
CREATE TABLE table_1998 ("Season" real,"Timeslot" text,"Season premiere" text,"Season finale" text,"TV season" text,"Rank" text,"U.S. viewers (in millions)" text,"Rating (adults 18\u201349)" text)
SELECT "Timeslot" FROM table_1998 WHERE "Rating (adults 18\u201349)" = '0.6'
Which Trident version has a Gecko value of 19.0?
CREATE TABLE table_name_57 (trident VARCHAR,gecko VARCHAR)
SELECT trident FROM table_name_57 WHERE gecko = "19.0"
what is the number of patients whose marital status is married and lab test name is calculated tbg?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Calculated TBG"
What was the original name for the song performed by Brad Kavanagh?
CREATE TABLE table_8772 ("Song" text,"Original Name" text,"Country" text,"Language" text,"Singer(s)" text)
SELECT "Original Name" FROM table_8772 WHERE "Singer(s)" = 'brad kavanagh'
give me the number of patients whose discharge location is home health care and procedure icd9 code is 5771?
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.discharge_location = "HOME HEALTH CARE" AND procedures.icd9_code = "5771"
What round does Duncan Tappy drive in?
CREATE TABLE table_25927 ("SF Round" real,"Country" text,"Location" text,"Date" text,"Driver" text,"Race 1(pts)" real,"Race 2(pts)" real,"Race 3" text,"Race Total(pts)" real)
SELECT MAX("SF Round") FROM table_25927 WHERE "Driver" = 'Duncan Tappy'
did patient 007-6603 get a diagnosis of brain tumor - cns lymphoma in 2105?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayi...
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 = '007-6603')) AND diagnosis.diagnosisname = 'brain tumor - cns lymphoma' AND S...
When the away team scored 7.13 (55), who were they playing?
CREATE TABLE table_55097 ("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_55097 WHERE "Away team score" = '7.13 (55)'
what is the maximum hospital cost for a procedure that involves cl reduc disloc-elbow in 2104?
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 patients (row_id number,subject_id number,...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cl reduc disloc-elbow')) AND STRFTIME('%y', cost.chargeti...
Which Wins have a Rank of 3?
CREATE TABLE table_name_77 (wins INTEGER,rank VARCHAR)
SELECT AVG(wins) FROM table_name_77 WHERE rank = 3
How tall is the player from farmington, ky?
CREATE TABLE table_26916717_1 (height VARCHAR,home_town VARCHAR)
SELECT height FROM table_26916717_1 WHERE home_town = "Farmington, KY"
What ship size had a cargo value of $46,000 in 2006?
CREATE TABLE table_42580 ("Ship size" text,"Cargo" text,"2004" text,"2005" text,"2006" text)
SELECT "Ship size" FROM table_42580 WHERE "2006" = '$46,000'
where stanier, 2 cylinder is 43, what is the stanier, 3 cylinder
CREATE TABLE table_2226 ("Year" real,"Fowler" real,"Stanier,3 cylinder" real,"Stanier,2 cylinder" real,"Fairburn" real,"BR Standard" real,"Total" real)
SELECT COUNT("Stanier, 3 cylinder") FROM table_2226 WHERE "Stanier, 2 cylinder" = '43'
when did patient 27964 get a sputum microbiology test for the last time until 11/2105?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE prescriptio...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27964) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2105-11' ORDER BY microbiologyevents.ch...
what is the number of patients whose age is less than 86 and procedure short title is endosc destruc esoph les?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "86" AND procedures.short_title = "Endosc destruc esoph les"
what's the record with result being w 21 7
CREATE TABLE table_14951643_1 (record VARCHAR,result VARCHAR)
SELECT record FROM table_14951643_1 WHERE result = "W 21–7"
What venue did group g play at on Mar 8, 1998?
CREATE TABLE table_name_42 (venue VARCHAR,stage VARCHAR,date VARCHAR)
SELECT venue FROM table_name_42 WHERE stage = "group g" AND date = "mar 8, 1998"
What is the total number of Game, when Record is '11-17-7'?
CREATE TABLE table_name_34 (game VARCHAR,record VARCHAR)
SELECT COUNT(game) FROM table_name_34 WHERE record = "11-17-7"
what is the average total cost for the hospital involving a procedure called therapeutic antibacterials - third generation cephalosporin the previous year?
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 diagnosis (diagnosisid number,patientunitstayid numbe...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - third generatio...
Find Deleted Questions by User. shows all deleted answers for the specified user
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE Posts (Id number,...
SELECT p.Id AS "post_link", * FROM Posts AS p WHERE DeletionDate > 0
A bar chart about how many wines are there for each grape?, rank by the bars from high to low.
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 grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC
How many colleges in total?
CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)
SELECT COUNT(*) FROM college
Can you highlight the courses that grant 12 credits upon completion ?
CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id ...
SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS'
What theme has special notes from calgary flames gift set?
CREATE TABLE table_67145 ("Year" real,"Theme" text,"Artist" text,"Issue price" real,"Special notes" text)
SELECT "Theme" FROM table_67145 WHERE "Special notes" = 'from calgary flames gift set'
Name the courses in Digital Studio that satisfy the MDE requirement .
CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement v...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Digital Studio%' OR course.description LIKE '%Digital Studio%' OR course.name LIKE '%Digital Stu...
Eclipse vs IntelliJ IDEA by year.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,Post...
SELECT t.TagName AS Tag, YEAR(p.CreationDate) AS y, COUNT(p.Id) AS NumPosts FROM Tags AS t JOIN PostTags AS pt ON pt.TagId = t.Id JOIN Posts AS p ON p.Id = pt.PostId WHERE (t.TagName = 'eclipse' OR t.TagName = 'intellij-idea') AND YEAR(p.CreationDate) >= 2015 GROUP BY t.TagName, YEAR(p.CreationDate) ORDER BY y, Tag DES...
Who was the home team at Princes Park?
CREATE TABLE table_name_41 (home_team VARCHAR,venue VARCHAR)
SELECT home_team AS score FROM table_name_41 WHERE venue = "princes park"
how many patients are born before 2098 and diagnosed with procedure icd9 code 40?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2098" AND procedures.icd9_code = "40"
How many tries for did the club with a 3 losing bonus and 45 points have?
CREATE TABLE table_name_12 (tries_for VARCHAR,losing_bonus VARCHAR,points VARCHAR)
SELECT tries_for FROM table_name_12 WHERE losing_bonus = "3" AND points = "45"
provide the number of patients whose gender is f and procedure short title is suture bladder lacerat?
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Suture bladder lacerat"
Find the last names of teachers teaching in classroom 109.
CREATE TABLE teachers (lastname VARCHAR,classroom VARCHAR)
SELECT lastname FROM teachers WHERE classroom = 109
Find meter_200 and the sum of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, and show by the X from low to high.
CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time ...
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
Which player had a score of 72-69=141?
CREATE TABLE table_49167 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Player" FROM table_49167 WHERE "Score" = '72-69=141'
What is Away Team, when Date is '25 January 1986', and when Tie No is '6'?
CREATE TABLE table_name_64 (away_team VARCHAR,date VARCHAR,tie_no VARCHAR)
SELECT away_team FROM table_name_64 WHERE date = "25 january 1986" AND tie_no = "6"
what is the 'normalized' transliteration for Roman i
CREATE TABLE table_name_9 (roman_equivalent VARCHAR)
SELECT "normalised" AS _transliteration FROM table_name_9 WHERE roman_equivalent = "i"
What is the Record of the Game on January 20 with Visitor Toronto Maple Leafs with a Score of 3 1?
CREATE TABLE table_8131 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_8131 WHERE "Score" = '3–1' AND "Visitor" = 'toronto maple leafs' AND "Date" = 'january 20'
How many times was the rebuilt data cannot handle non-empty timestamp argument! 1934?
CREATE TABLE table_12113888_1 (number VARCHAR,rebuilt VARCHAR)
SELECT COUNT(number) FROM table_12113888_1 WHERE rebuilt = "Cannot handle non-empty timestamp argument! 1934"
A bar chart shows the distribution of date_address_to and the average of monthly_rental bin date_address_to by time.
CREATE TABLE Ref_Address_Types (address_type_code VARCHAR(15),address_type_description VARCHAR(80))CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),student_id INTEGER,date_incident_start DAT...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
how many patients stayed in hospital for more than 1 day and used the drug name aspirin ec?
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.days_stay > "1" AND prescriptions.drug = "Aspirin EC"
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
what are the hospital admission times in the previous year for patient 70473?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,lab...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 70473 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
What is the Elector with a Nationality with roman, and an Elevator of urban iv, and an Elevated with 1261, december 17?
CREATE TABLE table_56637 ("Elector" text,"Nationality" text,"Faction" text,"Order and Title" text,"Elevated" text,"Elevator" text)
SELECT "Elector" FROM table_56637 WHERE "Nationality" = 'roman' AND "Elevator" = 'urban iv' AND "Elevated" = '1261, december 17'
since 2103, what was the top five most frequent diagnoses patients were diagnosed with within 2 months after receiving opn chest cardiac massag?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_procedures...
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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by time, display in desc by the the average of employee id.
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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC
Name the most # of total votes with % of popular vote of 32.41% and # of seats won more than 95
CREATE TABLE table_name_31 (_number_of_total_votes INTEGER,_percentage_of_popular_vote VARCHAR,_number_of_seats_won VARCHAR)
SELECT MAX(_number_of_total_votes) FROM table_name_31 WHERE _percentage_of_popular_vote = "32.41%" AND _number_of_seats_won > 95
Where did Rick Mears win, after starting in Pole Position?
CREATE TABLE table_32331 ("Race Name" text,"Circuit" text,"City/Location" text,"Date" text,"Pole position" text,"Winning driver" text,"Winning team" text,"Report" text)
SELECT "City/Location" FROM table_32331 WHERE "Pole position" = 'rick mears' AND "Winning driver" = 'rick mears'
What is the average points of the drivers before 1964?
CREATE TABLE table_name_73 (points INTEGER,year INTEGER)
SELECT AVG(points) FROM table_name_73 WHERE year < 1964
what fleet is associated with the number L4?
CREATE TABLE table_name_61 (fleet VARCHAR,number VARCHAR)
SELECT fleet FROM table_name_61 WHERE number = "l4"
Bar chart x axis nominee y axis the total number, and display from low to high by the x axis.
CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee
which model with a screen size of 3 inches did not weigh less than 210 g ?
CREATE TABLE table_204_878 (id number,"model" text,"release date" text,"sensor\nres.,size" text,"lens (35 mm equiv.)\nzoom,aperture" text,"screen\nsize,pixels" text,"dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text,"weight" text,"features" text)
SELECT "model" FROM table_204_878 WHERE "screen\nsize, pixels" = 3 AND "weight" >= 210
How many grids correspond to more than 24 laps?
CREATE TABLE table_name_18 (grid INTEGER,laps INTEGER)
SELECT MAX(grid) FROM table_name_18 WHERE laps > 24
What is the average value in the 100s category when the high score is 196?
CREATE TABLE table_9314 ("Player" text,"Team" text,"Matches" real,"Innings" real,"Runs" real,"Average" real,"Highest Score" text,"100s" real)
SELECT AVG("100s") FROM table_9314 WHERE "Highest Score" = '196'
Which lowest goals for number had a played number of less than 34?
CREATE TABLE table_name_95 (goals_for INTEGER,played INTEGER)
SELECT MIN(goals_for) FROM table_name_95 WHERE played < 34
Which Score has Opponents in the final of john bromwich frank sedgman?
CREATE TABLE table_76944 ("Year" real,"Championship" text,"Partner" text,"Opponents in the final" text,"Score" text)
SELECT "Score" FROM table_76944 WHERE "Opponents in the final" = 'john bromwich frank sedgman'
Name the least Laps for accident and gird more than 13
CREATE TABLE table_52068 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MIN("Laps") FROM table_52068 WHERE "Time/Retired" = 'accident' AND "Grid" > '13'
Average Score and Close count Percentage By Year, Month.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT AVG(CAST(Score AS FLOAT(10, 5))) AS Avg_Score, CAST(SUM(CASE WHEN NOT ClosedDate IS NULL THEN 1 ELSE 0 END) AS FLOAT(15, 5)) / CAST(COUNT(Id) AS FLOAT(15, 5)) AS CloseCountPercentage, MONTH(CreationDate) AS month, YEAR(CreationDate) AS year FROM Posts AS p WHERE PostTypeId = 1 GROUP BY MONTH(CreationDate), YEAR(...
What area has a % Other of , and a % Muslim of 95%?
CREATE TABLE table_name_83 (area VARCHAR,_percentage_other VARCHAR,_percentage_muslim VARCHAR)
SELECT area FROM table_name_83 WHERE _percentage_other = "–" AND _percentage_muslim = "95%"
Who is the incumbent of district pa-8?
CREATE TABLE table_28188239_1 (incumbent VARCHAR,district VARCHAR)
SELECT incumbent FROM table_28188239_1 WHERE district = "PA-8"
Which event won by KCLMS in 2008 has KCLMS as the winner and less than 10 wins by KCL?
CREATE TABLE table_name_74 (events_won_by_kcl VARCHAR,year VARCHAR,winner VARCHAR,events_won_by_kclMS VARCHAR)
SELECT events_won_by_kcl FROM table_name_74 WHERE winner = "kclms" AND events_won_by_kclMS < 10 AND year = 2008
Which professors , besides Prof. Abraham Acosta teach 470 ?
CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqna...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 470 AND NOT instructor.name LIKE '%Abraham Acosta%' AND offering_instructor.instructor_id = instructor.instructor_id AND off...
Is the team force india allowed to race?
CREATE TABLE table_1431 ("Year" text,"Event" text,"Pole position time" text,"107% time" text,"Driver" text,"Team" text,"Time" text,"% of pole" text,"Allowed to race?" text)
SELECT "Allowed to race?" FROM table_1431 WHERE "Team" = 'Force India'
find the number of medicare patients who have mechanical complication due to other implant and other device, not elsewhere classified diagnoses.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Malfunc oth device/graft"
how long is anton lyuboslavskiy 's fartherst show in a competition ?
CREATE TABLE table_203_677 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text)
SELECT "notes" FROM table_203_677 ORDER BY "notes" DESC LIMIT 1
What is the attendance for august 29?
CREATE TABLE table_69100 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Attendance" FROM table_69100 WHERE "Date" = 'august 29'
heart attack or heart failure, or a stroke
CREATE TABLE table_dev_39 ("id" int,"gender" string,"random_serum_glucose" int,"glycated_hemoglobin" bool,"heart_disease" bool,"stroke" bool,"diabetes_mellitus" bool,"hgba1c" float,"diabetic" string,"fasting_blood_glucose_fbg" float,"fasting_plasma_glucose" int,"serum_creatinine" float,"kidney_disease" bool,"NOUSE" flo...
SELECT * FROM table_dev_39 WHERE heart_disease = 1 OR heart_disease = 1 OR stroke = 1
Calculate the number of patients admitted on phys referral/normal deli who had aortic insufficiency/re-do sternotomy aortic valve replacement as their primary disease.
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_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
What is the average number of metres for the Dzelzavas Street 74?
CREATE TABLE table_name_61 (metres INTEGER,name VARCHAR)
SELECT AVG(metres) FROM table_name_61 WHERE name = "dzelzavas street 74"
Which venue was melbourne the away team of?
CREATE TABLE table_55371 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_55371 WHERE "Away team" = 'melbourne'
What is the total number of episodes where hugh laurie was the 3rd performer?
CREATE TABLE table_name_70 (episode VARCHAR,performer_3 VARCHAR)
SELECT COUNT(episode) FROM table_name_70 WHERE performer_3 = "hugh laurie"
what are the dates where democrat john kerry is 63% and poll source is rasmussen reports?
CREATE TABLE table_72804 ("Poll Source" text,"Dates administered" text,"Democrat: John Kerry" text,"Republican: Jeff Beatty" text,"Lead Margin" real)
SELECT "Dates administered" FROM table_72804 WHERE "Democrat: John Kerry" = '63%' AND "Poll Source" = 'Rasmussen Reports'
what is the rank when assumed office on 12 may 1857?
CREATE TABLE table_66168 ("Rank:" real,"Premier:" text,"Party:" text,"Assumed Office:" text,"Left Office:" text,"TOTAL Time in Office:" text)
SELECT SUM("Rank:") FROM table_66168 WHERE "Assumed Office:" = '12 may 1857'
Show the title and director for all films.
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 number,capacity number,location text)CREATE TABLE schedule (cinema_id number,film_id number,date text,show...
SELECT title, directed_by FROM film
provide the number of patients whose marital status is single and admission year is less than 2176?
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.marital_status = "SINGLE" AND demographic.admityear < "2176"
Name the points for car number 4
CREATE TABLE table_25794532_1 (points VARCHAR,car_no VARCHAR)
SELECT points FROM table_25794532_1 WHERE car_no = 4
Name all the date of designations for kurume
CREATE TABLE table_20344 ("Name" text,"Japanese" text,"Date of designation" text,"Date of reclassification" text,"Region" text,"Prefecture" text)
SELECT "Date of designation" FROM table_20344 WHERE "Name" = 'Kurume'
What is the highest score with 0 wins and more than 2 Byes?
CREATE TABLE table_name_4 (against INTEGER,wins VARCHAR,byes VARCHAR)
SELECT MAX(against) FROM table_name_4 WHERE wins = 0 AND byes > 2
what is the least number of no decisions for scott feldman category:articles with hcards
CREATE TABLE table_2179 ("Pitcher" text,"Starts" real,"Wins" real,"Losses" real,"No decisions" real,"Winning %" text,"Seasons" text)
SELECT MIN("No decisions") FROM table_2179 WHERE "Pitcher" = 'Scott Feldman Category:Articles with hCards'
What circuit was on the date 4 May?
CREATE TABLE table_17525 ("Round" real,"Date" text,"Grand Prix" text,"Circuit" text,"125cc winner" text,"250cc winner" text,"MotoGP winner" text,"Report" text)
SELECT "Circuit" FROM table_17525 WHERE "Date" = '4 May'
Which description is dated 1962?
CREATE TABLE table_name_56 (description VARCHAR,date VARCHAR)
SELECT description FROM table_name_56 WHERE date = "1962"
Which Video has a Channel smaller than 35.66, and a Programming of nhk world?
CREATE TABLE table_name_1 (video VARCHAR,channel VARCHAR,programming VARCHAR)
SELECT video FROM table_name_1 WHERE channel < 35.66 AND programming = "nhk world"
What is the highest rank for ben crenshaw after winning more than 14 times?
CREATE TABLE table_name_65 (rank INTEGER,player VARCHAR,wins VARCHAR)
SELECT MAX(rank) FROM table_name_65 WHERE player = "ben crenshaw" AND wins > 14
give the number of patients whose diagnoses long title is personal history of malignant neoplasm of bladder and lab test abnormal status is abnormal.
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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Personal history of malignant neoplasm of bladder" AND lab.flag = "abnormal"
Which Nationality has a Fate of sunk, and a Name of alderamin?
CREATE TABLE table_name_67 (nationality VARCHAR,fate VARCHAR,name VARCHAR)
SELECT nationality FROM table_name_67 WHERE fate = "sunk" AND name = "alderamin"
Which 1995's tournament was the French Open?
CREATE TABLE table_name_61 (tournament VARCHAR)
SELECT 1995 FROM table_name_61 WHERE tournament = "french open"
What is the total of the ranks that did not participate?
CREATE TABLE table_57436 ("Games" text,"Gold" text,"Silver" text,"Bronze" text,"Total" text,"Rank" text)
SELECT "Total" FROM table_57436 WHERE "Rank" = 'did not participate'
when points against is points again, which are the drawn?
CREATE TABLE table_23692 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Bonus Points" text,"Points" text)
SELECT "Drawn" FROM table_23692 WHERE "Points against" = 'Points against'
how many years consecutive featured the 20 km event ?
CREATE TABLE table_203_28 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text)
SELECT COUNT(DISTINCT "year") FROM table_203_28 WHERE "event" = '20 km'
what is the average tournaments played when cuts made is 14?
CREATE TABLE table_name_63 (tournaments_played INTEGER,cuts_made VARCHAR)
SELECT AVG(tournaments_played) FROM table_name_63 WHERE cuts_made = 14
what was the three most commonly carried out specimen tests until 2104?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
How many termini are there that have 'east west' listed in their direction section, 'none' listed in their junction section, and have a route name of 'sh 202'?
CREATE TABLE table_72184 ("Route Name" text,"Direction" text,"Termini" text,"Junctions" text,"Length" text,"Population Area" text,"Remarks" text)
SELECT COUNT("Termini") FROM table_72184 WHERE "Direction" = 'East West' AND "Junctions" = 'none' AND "Route Name" = 'SH 202'
among patients with other preterm infants 1,750-1,999 grams how many of them were male?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title 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.gender = "M" AND diagnoses.long_title = "Other preterm infants, 1,750-1,999 grams"
What is the average year of events that took place in Antwerp, Belgium?
CREATE TABLE table_name_97 (year INTEGER,venue VARCHAR)
SELECT AVG(year) FROM table_name_97 WHERE venue = "antwerp, belgium"
when was the last time the arterial bp [systolic] of patient 10278 was less than 129.0, until 10/20/2105?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueu...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10278)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
Top 100 Lowest Rated Posts.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT Posts.Id AS "post_link", Posts.Score AS "score" FROM Posts WHERE 'posttypeid' = 1 AND 'score' < 0 ORDER BY 'score' LIMIT 100
What is the record for the loss in UFC 62?
CREATE TABLE table_47470 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text)
SELECT "Record" FROM table_47470 WHERE "Res." = 'loss' AND "Event" = 'ufc 62'
give me the number of patients whose admission year is less than 2155 and diagnoses long title is other specified gastritis, with hemorrhage?
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 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 < "2155" AND diagnoses.long_title = "Other specified gastritis, with hemorrhage"
what are the lines served where station users is 210076?
CREATE TABLE table_14748457_1 (lines_served VARCHAR,station_users_2008_9 VARCHAR)
SELECT lines_served FROM table_14748457_1 WHERE station_users_2008_9 = "210076"
What was the location of the game on February 2?
CREATE TABLE table_46773 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text)
SELECT "Location/Attendance" FROM table_46773 WHERE "Date" = 'february 2'