instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
HOW MANY YEARS WAS IT FOR THE SCORE (76-73-79-72=300)?
CREATE TABLE table_72642 ("Year" real,"Championship" text,"54 holes" text,"Winning score" text,"Margin" text,"Runner-up" text)
SELECT COUNT("Year") FROM table_72642 WHERE "Winning score" = '(76-73-79-72=300)'
Tell me the number of patients born before 2056 who had a cerebrospinal fluid lab test done.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
what is the largest year listed ?
CREATE TABLE table_203_185 (id number,"season" text,"a\ntechnical" text,"b\nscientific" text,"c\nfine arts" text,"d\nimprovisational" text,"e\nstructural" text,"rising stars!\u00ae" text,"po\nprojectoutreach\u00ae" text,"university level" text)
SELECT MAX("season") FROM table_203_185
How many episodes were written by Tom Scharpling and Daniel Dratch?
CREATE TABLE table_28046 ("Series no." real,"No. in season" real,"Title" text,"Written by" text,"Directed by" text,"Original air date" text)
SELECT COUNT("No. in season") FROM table_28046 WHERE "Written by" = 'Tom Scharpling and Daniel Dratch'
What is the format for the label Mightier than Sword on January 12, 2010 in the United States?
CREATE TABLE table_name_50 (format VARCHAR,label VARCHAR,region VARCHAR,date VARCHAR)
SELECT format FROM table_name_50 WHERE region = "united states" AND date = "january 12, 2010" AND label = "mightier than sword"
WHo has a Country of united states and a To par of 3?
CREATE TABLE table_62395 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real)
SELECT "Player" FROM table_62395 WHERE "Country" = 'united states' AND "To par" = '–3'
what is the laps when the driver is tony rolt and the grid is less than 10?
CREATE TABLE table_name_99 (laps INTEGER,driver VARCHAR,grid VARCHAR)
SELECT SUM(laps) FROM table_name_99 WHERE driver = "tony rolt" AND grid < 10
To declare a major in OMS , what classes do I need to take ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%OMS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
How many documents for different document name? Draw a bar chart, could you show in desc by the Y-axis please?
CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_T...
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY COUNT(Document_Name) DESC
Show the number of apartment bookings in each day and group by booking end date with a line chart.
CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name VARCHAR(80),guest_last_name VARCHAR(80),date_of_birth DATETIME)CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date
what are the SUNDAY flights from OAKLAND to WASHINGTON
CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time...
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AN...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and list by the y-axis in asc please.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 job_history (EMPLOYEE_ID decimal(6,...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY)
who was the only driver that had an accident ?
CREATE TABLE table_204_584 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "driver" FROM table_204_584 WHERE "time/retired" = 'accident'
What is the Pole Position of the Portuguese Grand Prix?
CREATE TABLE table_56345 ("Grand Prix" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Constructor" text,"Report" text)
SELECT "Pole Position" FROM table_56345 WHERE "Grand Prix" = 'portuguese grand prix'
how many patients whose religion is jehovah's witness and lab test fluid is urine?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND lab.fluid = "Urine"
Return a bar chart about the distribution of All_Neutral and ACC_Percent .
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_Neutral, ACC_Percent FROM basketball_match
Which Score has a Date of 28 february 1953, and a Tie no of 3?
CREATE TABLE table_name_14 (score VARCHAR,date VARCHAR,tie_no VARCHAR)
SELECT score FROM table_name_14 WHERE date = "28 february 1953" AND tie_no = "3"
When Yale is listed as the regular season winner, what tournament venue is given?
CREATE TABLE table_28365816_2 (tournament_venue__city_ VARCHAR,regular_season_winner VARCHAR)
SELECT tournament_venue__city_ FROM table_28365816_2 WHERE regular_season_winner = "Yale"
is there any record of the microbiology test in their current hospital encounter for patient 031-3355?
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(*) > 0 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 patient.hospitaldischargetime IS NULL))
how many patients were staying in csru careunits a year before?
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 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)CREA...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
What place has manfred kokot as the athlete?
CREATE TABLE table_62925 ("Rank" real,"Time" text,"Athlete" text,"Date" text,"Place" text)
SELECT "Place" FROM table_62925 WHERE "Athlete" = 'manfred kokot'
Which professors do n't utilize labs in their courses ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comm...
SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr...
What is the launch site of the delta iv rocket with an unknown date and a gps iif-10 satellite?
CREATE TABLE table_41146 ("Date" text,"Rocket" text,"Type" text,"Launch site" text,"Satellite" text)
SELECT "Launch site" FROM table_41146 WHERE "Date" = 'unknown' AND "Rocket" = 'delta iv' AND "Satellite" = 'gps iif-10'
Questions per day on Stack Exchange since 2015-07-31.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Comments (...
SELECT DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)), COUNT(*) FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 AND DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)) > '2015-07-31 00:00:00' GROUP BY DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)) ORDER BY DATEADD(d, 0, DATEDIFF(d, 0, CreationDat...
Which Call sign has a Frequency of 102.5 fm?
CREATE TABLE table_47533 ("Frequency" text,"Call sign" text,"Location" text,"Name / Format" text,"Owner" text)
SELECT "Call sign" FROM table_47533 WHERE "Frequency" = '102.5 fm'
what is the medication that patient 004-64091 was prescribed with within 2 days after receiving the palliative care consultation this month?
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 microlab (microlabid number,patientunitstayid number,culturesite text,orga...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091') AND treatment.treatme...
What team was the home team when Richmond was the away team?
CREATE TABLE table_4735 ("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_4735 WHERE "Away team" = 'richmond'
What is the external weapon with a ramhead cart?
CREATE TABLE table_name_59 (external_weapon VARCHAR,cart VARCHAR)
SELECT external_weapon FROM table_name_59 WHERE cart = "ramhead cart"
What is the average Year that has the Group, Logie Award, the Award, Most Outstanding Actor, and the Result, nominated?
CREATE TABLE table_name_79 (year INTEGER,result VARCHAR,group VARCHAR,award VARCHAR)
SELECT AVG(year) FROM table_name_79 WHERE group = "logie award" AND award = "most outstanding actor" AND result = "nominated"
What 2011 has 4r as the 2008?
CREATE TABLE table_name_68 (Id VARCHAR)
SELECT 2011 FROM table_name_68 WHERE 2008 = "4r"
How many parties is Tom Foley a member of?
CREATE TABLE table_709 ("District" text,"Incumbent" text,"Party" text,"Elected" real,"Status" text,"Opponent" text)
SELECT COUNT("Party") FROM table_709 WHERE "Incumbent" = 'Tom Foley'
What event had a time of 6:37.73?
CREATE TABLE table_name_42 (event VARCHAR,time VARCHAR)
SELECT event FROM table_name_42 WHERE time = "6:37.73"
What is the number of wins when the goals against is larger than 41, points is 29, and draws are larger than 5?
CREATE TABLE table_79021 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT COUNT("Wins") FROM table_79021 WHERE "Goals against" > '41' AND "Points" = '29' AND "Draws" > '5'
Who plays the position of forward-center?
CREATE TABLE table_15621965_2 (player VARCHAR,position VARCHAR)
SELECT player FROM table_15621965_2 WHERE position = "Forward-Center"
WHAT IS THE PLAYER WITH TOTAL LESS THAN 151, TO PAR OF 8?
CREATE TABLE table_name_41 (player VARCHAR,total VARCHAR,to_par VARCHAR)
SELECT player FROM table_name_41 WHERE total < 151 AND to_par = 8
how did patient 017-20711 get admitted to the hospital since 2105 first?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,...
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '017-20711' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime LIMIT 1
Which player had the highest points in game 79?
CREATE TABLE table_17311797_10 (high_points VARCHAR,game VARCHAR)
SELECT high_points FROM table_17311797_10 WHERE game = 79
hba1c > 6 %
CREATE TABLE table_train_175 ("id" int,"lipid_lowering_therapy" bool,"hemoglobin_a1c_hba1c" float,"diabetic" string,"fasting_serum_triglycerides" int,"gilbert_syndrome" bool,"age" float,"alanine_aminotransferase" bool,"NOUSE" float)
SELECT * FROM table_train_175 WHERE hemoglobin_a1c_hba1c > 6
Find the time of admission and date of death for the patient with patient id 94762.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT demographic.dod, demographic.admittime FROM demographic WHERE demographic.subject_id = "94762"
What class fulfills the MDE requirement with the least effort ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_...
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...
provide the number of patients whose gender is m and drug code is bag?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "BAG"
What was the score on saturday, 26 june 7:10pm?
CREATE TABLE table_29033869_3 (score__collingwoods_score_is_in_bold_ VARCHAR,date VARCHAR)
SELECT score__collingwoods_score_is_in_bold_ FROM table_29033869_3 WHERE date = "Saturday, 26 June 7:10pm"
Visualize a scatter chart about the correlation between CID and Credits .
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Department (DNO INTEGER,Division VARCHAR(2),DName VARCHAR(25),Room VARCHAR(5),Building VARCHAR(13),DPhone INTEGER)CREATE TABLE Enrolled_in (StuID INTEGER,CID...
SELECT CID, Credits FROM Course ORDER BY Credits
What tyre had Sergio Mantovani as a driver?
CREATE TABLE table_name_91 (tyre VARCHAR,driver VARCHAR)
SELECT tyre FROM table_name_91 WHERE driver = "sergio mantovani"
what is the minimum value of the sao2 of patient 030-52327 since 688 days ago?
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 cost (costid number,uniquepid text,patienthealthsystemstayid number,eventt...
SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.sao2 IS NULL AND DATET...
What years was the jersey number(s) smaller than 3?
CREATE TABLE table_45993 ("Player" text,"Nationality" text,"Jersey Number(s)" real,"Position" text,"Years" text,"From" text)
SELECT "Years" FROM table_45993 WHERE "Jersey Number(s)" < '3'
what's the race winner with location being jacarepagu
CREATE TABLE table_16711 ("Rnd" real,"Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text)
SELECT "Race Winner" FROM table_16711 WHERE "Location" = 'Jacarepaguá'
what is drug type and drug name of drug code pant40?
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 prescriptions.drug_type, prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "PANT40"
what is the number of patients whose drug route is oral?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "ORAL"
Which Date has a Record of 11 10 2?
CREATE TABLE table_name_92 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_92 WHERE record = "11–10–2"
Which District has a First elected of 1856, and an Incumbent of william kellogg?
CREATE TABLE table_6558 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text)
SELECT "District" FROM table_6558 WHERE "First elected" = '1856' AND "Incumbent" = 'william kellogg'
Who is the 92.5 with the press of 282.5?
CREATE TABLE table_8024 ("World Record" text,"Press" text,"92.5" text,"Hans W\u00f6lpert" text,"Mannheim (GER)" text)
SELECT "92.5" FROM table_8024 WHERE "Press" = '282.5'
How many rooms does the Lamberton building have?
CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE section (course_id text,sec_id text,seme...
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
What is the date of game 9?
CREATE TABLE table_name_61 (date VARCHAR,game VARCHAR)
SELECT date FROM table_name_61 WHERE game = 9
Show me a bar chart for what is the average song rating for each language?, list by the names from low to high please.
CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre varchar2(50))CREATE TABLE song (song_name varchar2(50),artist_name varchar2(50),country varchar2(20),f_id number(10),genre_is varchar2(20),rating number(10),languages varchar2(20),releasedate Date,resolution number(10...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages
By City in Reputation Range.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,Paren...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Age, LastAccessDate, Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##Country##%') AND Reputation > '##reputation:int##' ORDER BY Reputation DESC
What is the total number of the value Others#, when the county is Langlade, and when the value Bush# is greater than 6,235?
CREATE TABLE table_name_94 (others_number VARCHAR,county VARCHAR,bush_number VARCHAR)
SELECT COUNT(others_number) FROM table_name_94 WHERE county = "langlade" AND bush_number > 6 OFFSET 235
give me the number of patients whose year of birth is less than 2182?
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 WHERE demographic.dob_year < "2182"
How many points were won where new points was 1680?
CREATE TABLE table_27615896_18 (points INTEGER,new_points VARCHAR)
SELECT MIN(points) AS won FROM table_27615896_18 WHERE new_points = 1680
how many collaborations did key release during 2010 ?
CREATE TABLE table_204_243 (id number,"year" number,"album" text,"song" text,"duration" text,"artist" text)
SELECT COUNT(*) FROM table_204_243 WHERE "year" = 2010
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
what number is us viewers in season 12?
CREATE TABLE table_24018430_3 (us_viewers__millions_ VARCHAR,no_in_season VARCHAR)
SELECT us_viewers__millions_ FROM table_24018430_3 WHERE no_in_season = 12
What are the names of the dorm that does not have a TV Lounge?
CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE dorm_amenity (amenid number,amenity_name text)CRE...
SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'
count the number of patients whose diagnoses long title is tietze's disease and drug type is base?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Tietze's disease" AND prescriptions.drug_type = "BASE"
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, and I want to sort Y in asc order please.
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, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID)
What chassis does Gary Bettenhausen use?
CREATE TABLE table_4609 ("Team" text,"Chassis" text,"Engine" text,"Tires" text,"Drivers" text)
SELECT "Chassis" FROM table_4609 WHERE "Drivers" = 'gary bettenhausen'
Show me a bar chart for what is the id and trade name of the medicines can interact with at least 3 enzymes?
CREATE TABLE enzyme (id int,name text,Location text,Product text,Chromosome text,OMIM int,Porphyria text)CREATE TABLE medicine_enzyme_interaction (enzyme_id int,medicine_id int,interaction_type text)CREATE TABLE medicine (id int,name text,Trade_Name text,FDA_approved text)
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id
what is the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA"
What was the Attendance on September 26, 1971?
CREATE TABLE table_name_86 (attendance INTEGER,date VARCHAR)
SELECT AVG(attendance) FROM table_name_86 WHERE date = "september 26, 1971"
Name the number of nationality is tom hilde
CREATE TABLE table_19322 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" text,"2nd (m)" text,"Points" text,"Overall NT points" text,"Overall WC points (Rank)" text)
SELECT COUNT("Nationality") FROM table_19322 WHERE "Name" = 'Tom Hilde'
Percentage of questions with accepted answer depending on the weekday when the question was posted.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,...
WITH tmp AS (SELECT Id, AcceptedAnswerId AS Acc, Period = TIME_TO_STR(CreationDate, '%W') FROM Posts WHERE PostTypeId = 1) SELECT Period, ROUND((COUNT(Acc)) * 100.0 / (COUNT(*)), 2) AS percentage FROM tmp GROUP BY Period ORDER BY Period
A scatter chart shows the correlation between Team_ID and All_Games_Percent , and group by attribute ACC_Regular_Season.
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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
Find the names and average salaries of all departments whose average salary is greater than 42000.
CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE teaches (ID varchar(5),course_id varchar(8),...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name
what is the total number from column 1 for all face values ?
CREATE TABLE table_204_44 (id number,"face value" number,"\u20ac0.01" number,"\u20ac0.02" number,"\u20ac0.05" number,"\u20ac0.10" number,"\u20ac0.20" number,"\u20ac0.50" number,"\u20ac1.00" number,"\u20ac2.00" number)
SELECT SUM("\u20ac0.01") FROM table_204_44
in DALLAS FORT WORTH i would like information on ground transportation
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_...
SELECT DISTINCT ground_service.transport_type FROM city AS CITY_0, city AS CITY_1, ground_service WHERE (ground_service.city_code = CITY_0.city_code AND CITY_0.city_name = 'DALLAS') OR (ground_service.city_code = CITY_1.city_code AND CITY_1.city_name = 'FORT WORTH')
give me the number of patients whose primary disease is transient ischemic attack and lab test fluid is blood?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND lab.fluid = "Blood"
Questions with one tag on [pets.se]. Find all the questions on [pets.se] that have exactly one tag, with the premise that they need more to classify (at least) pet type and the problem.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,Suggeste...
WITH singletons AS (SELECT PostId FROM PostTags GROUP BY PostId HAVING COUNT(PostTags.TagId) = 1) SELECT Id, Id AS "post_link", Tags FROM Posts INNER JOIN singletons ON singletons.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND Posts.ClosedDate IS NULL ORDER BY Posts.Id
calculate the probability of survival for three year among the patients diagnosed with increased intracranial pressure - from hydrocephalus.
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patient...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
What is the sum of the serial numbers for narowal city?
CREATE TABLE table_64010 ("Serial No." real,"District" text,"Headquartered City" text,"City Population (2009)" real,"City Area(km 2)" real)
SELECT SUM("Serial No.") FROM table_64010 WHERE "Headquartered City" = 'narowal city'
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and department_id , and order by the y-axis from high to low.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))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,JO...
SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
What are the high rebounds in the 45 game?
CREATE TABLE table_29889 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High rebounds" FROM table_29889 WHERE "Game" = '45'
what are the three most commonly ordered procedures for patients who have previously been diagnosed with mitral valve disorder, which occurred within the same month last year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)C...
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...
For those employees who was hired before 2002-06-21, find hire_date and the sum of manager_id bin hire_date by time, and visualize them by a bar chart, display in ascending by the Y-axis please.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25)...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID)
Bar chart x axis acc road y axis the average of school id, and rank in desc by the Y please.
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 ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) DESC
Name the Time which has Laps of 19, and a Grid larger than 19, and a Manufacturer of ktm, and a Rider of randy krummenacher?
CREATE TABLE table_51108 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real)
SELECT "Time" FROM table_51108 WHERE "Laps" = '19' AND "Grid" > '19' AND "Manufacturer" = 'ktm' AND "Rider" = 'randy krummenacher'
what is the type of lithium when rubidium is nabr (1.9)?
CREATE TABLE table_name_54 (lithium VARCHAR,rubidium VARCHAR)
SELECT lithium FROM table_name_54 WHERE rubidium = "nabr (1.9)"
what is the production in 2010 with rank of 8?
CREATE TABLE table_67332 ("Rank" text,"Country" text,"2009" text,"2010" text,"2011" text)
SELECT "2010" FROM table_67332 WHERE "Rank" = '8'
Who had the most assist and how many on July 26?
CREATE TABLE table_22612 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text)
SELECT "High assists" FROM table_22612 WHERE "Date" = 'July 26'
what is the admission location and diagnosis icd9 code for patient id 2560?
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 demographic.admission_location, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
Which E. Greenberg has a T. Wyka of 10,793 (70%)?
CREATE TABLE table_name_34 (e_greenberg VARCHAR,t_wyka VARCHAR)
SELECT e_greenberg FROM table_name_34 WHERE t_wyka = "10,793 (70%)"
when was patient 006-97726 first prescribed with ondansetron and lorazepam 0.5 mg po tabs at the same time in 02/2104?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultur...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ondansetron' AND patient.uniquepid = '006-97726' AND STRFTIME('%y-%m', medication.drugstarttime) = '2104-02') AS t1 JOIN ...
What is the sum of Yellow, when Category is Bugre (Indian), and when Amerindian is less than 50,00?
CREATE TABLE table_name_76 (yellow INTEGER,category VARCHAR,amerindian VARCHAR)
SELECT SUM(yellow) FROM table_name_76 WHERE category = "bugre (indian)" AND amerindian < 50 OFFSET 00
What is the highest top-25 of the tournament with less than 22 events and more than 1 top-10?
CREATE TABLE table_7106 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MAX("Top-25") FROM table_7106 WHERE "Events" < '22' AND "Top-10" > '1'
How many political parties had a %2006 rating of 43.5?
CREATE TABLE table_21132404_1 (political_parties VARCHAR,_percentage_2006 VARCHAR)
SELECT COUNT(political_parties) FROM table_21132404_1 WHERE _percentage_2006 = "43.5"
what did patient 87733 first have as an output until 947 days ago?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,item...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733)) AND DATETIME(outputevents.charttim...
what were the three most frequent diagnoses for the patients of 40s since 6 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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,even...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
What studio had the director Peter Lord Nick Park before 2004?
CREATE TABLE table_64247 ("Year" real,"Title" text,"Director" text,"Studio(s)" text,"Notes" text)
SELECT "Studio(s)" FROM table_64247 WHERE "Year" < '2004' AND "Director" = 'peter lord nick park'
The canadian airdate of 11 february 2008 applied to what series number?
CREATE TABLE table_72137 ("No. in season" real,"No. in series" real,"Title" text,"Canadian airdate" text,"US airdate" text,"Production code" real)
SELECT COUNT("No. in series") FROM table_72137 WHERE "Canadian airdate" = '11 February 2008'
Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.
CREATE TABLE medicine_enzyme_interaction (enzyme_id number,medicine_id number,interaction_type text)CREATE TABLE enzyme (id number,name text,location text,product text,chromosome text,omim number,porphyria text)CREATE TABLE medicine (id number,name text,trade_name text,fda_approved text)
SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'
What is every pole position for the Castle Combe circuit and Robbie Kerr is the winning driver?
CREATE TABLE table_26137666_3 (pole_position VARCHAR,circuit VARCHAR,winning_driver VARCHAR)
SELECT pole_position FROM table_26137666_3 WHERE circuit = "Castle Combe" AND winning_driver = "Robbie Kerr"