instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
which years did chile place silver or bronze ? | CREATE TABLE table_204_360 (id number,"year" number,"host" text,"gold" text,"silver" text,"bronze" text) | SELECT "year" FROM table_204_360 WHERE "silver" = 'chile' OR "bronze" = 'chile' |
what is the number of patients whose marital status is single and procedure long title is insertion of one vascular stent? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Insertion of one vascular stent" |
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE ... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' |
calculate the difference between patient 010-1155's total output and the total input on the last icu visit. | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayi... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND NOT patient.unitdischarge... |
what is minimum age of patients whose admission type is emergency and primary disease is st elevated myocardial infarction\cardiac cath? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" |
what are the five most frequently performed procedures for a patient who was previously diagnosed with osteomyelitis - extremity within 2 months? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'osteomyelitis - extremity') AS t1 JOIN (... |
What is the lowest ranking associated with a total of 23? | CREATE TABLE table_74958 ("Ranking" real,"Nationality" text,"Name" text,"Years" text,"ICFC" real,"FCWC" real,"Total" real) | SELECT MIN("Ranking") FROM table_74958 WHERE "Total" = '23' |
For those employees who was hired before 2002-06-21, return a scatter chart about the correlation between employee_id and department_id . | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varc... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' |
provide the number of patients whose ethnicity is hispanic/latino - puerto rican and procedure short title is oth periton adhesiolysis? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Oth periton adhesiolysis" |
Name the city for athous lavrensis | CREATE TABLE table_name_22 (city VARCHAR,name VARCHAR) | SELECT city FROM table_name_22 WHERE name = "athous lavrensis" |
When the venue is away and the opponents are the bracknell bees, what is the competition? | CREATE TABLE table_name_88 (competition VARCHAR,venue VARCHAR,opponent VARCHAR) | SELECT competition FROM table_name_88 WHERE venue = "away" AND opponent = "bracknell bees" |
What was the best bowling score when the average was 23.33? | CREATE TABLE table_20896 ("Player" text,"Team" text,"Matches" real,"Wickets" real,"Average" text,"Best Bowling" text) | SELECT "Best Bowling" FROM table_20896 WHERE "Average" = '23.33' |
Who holds the time of 17:11.572? | CREATE TABLE table_name_88 (race VARCHAR,time VARCHAR) | SELECT race FROM table_name_88 WHERE time = "17:11.572" |
all flights from BOSTON to WASHINGTON on 11 10 | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fl... | 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 = 'WASHINGTON' AND date_day.day_number = 10 AND date_day.month_number = 11 A... |
What is 1st Leg, when 2nd Leg is 0-1? | CREATE TABLE table_47673 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "1st leg" FROM table_47673 WHERE "2nd leg" = '0-1' |
Name the chassis for alta | CREATE TABLE table_21977704_1 (chassis VARCHAR,constructor VARCHAR) | SELECT chassis FROM table_21977704_1 WHERE constructor = "Alta" |
what is the round when the college is north carolina and the overall is more than 124? | CREATE TABLE table_46491 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT SUM("Round") FROM table_46491 WHERE "College" = 'north carolina' AND "Overall" > '124' |
Name the original name for the one from bulgaria | CREATE TABLE table_name_4 (original_name VARCHAR,country VARCHAR) | SELECT original_name FROM table_name_4 WHERE country = "bulgaria" |
What is the result for the distance of 10f, and a winner or 2nd of Lampra? | CREATE TABLE table_name_30 (result VARCHAR,distance VARCHAR,winner_or_2nd VARCHAR) | SELECT result FROM table_name_30 WHERE distance = "10f" AND winner_or_2nd = "lampra" |
What are the names and ids of the different categories? Show me the bar chart, sort from low to high by the X-axis. | CREATE TABLE actor (actor_id SMALLINT UNSIGNED,first_name VARCHAR(45),last_name VARCHAR(45),last_update TIMESTAMP)CREATE TABLE store (store_id TINYINT UNSIGNED,manager_staff_id TINYINT UNSIGNED,address_id SMALLINT UNSIGNED,last_update TIMESTAMP)CREATE TABLE payment (payment_id SMALLINT UNSIGNED,customer_id SMALLINT UNS... | SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id ORDER BY T2.name |
was the respiration value of patient 027-120551 last measured on the last icu visit greater than the value second to last measured on the last icu visit? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120551') AND NOT patient.unitdischargetime ... |
count the number of patients who were admitted in urgent care and stayed in the hospital for 6 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay = "6" |
What horse for jara? | CREATE TABLE table_name_43 (horse VARCHAR,jockey VARCHAR) | SELECT horse FROM table_name_43 WHERE jockey = "jara" |
what is the number of patients whose ethnicity is white - russian and procedure long title is dorsal and dorsolumbar fusion of the posterior column, posterior technique? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Dorsal and dorsolumbar fusion of the posterior column, posterior technique" |
patient 70267 was diagnosed with a cl skul base fx/brf coma? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 ... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cl skul base fx/brf coma') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267) |
Name the report for 6 may | CREATE TABLE table_name_82 (report VARCHAR,date VARCHAR) | SELECT report FROM table_name_82 WHERE date = "6 may" |
SELECT Id, DisplayName, WebsiteUrl, Location, AccountId FROM Users;. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id nu... | SELECT Id, DisplayName, WebsiteUrl, Location, AccountId FROM Users |
What IHSAA Football Class has 20 elkhart as the county? | CREATE TABLE table_79233 ("School" text,"Mascot" text,"Location" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"County" text) | SELECT "IHSAA Football Class" FROM table_79233 WHERE "County" = '20 elkhart' |
who is the the high points with score being w 117 93 | CREATE TABLE table_13480122_5 (high_points VARCHAR,score VARCHAR) | SELECT high_points FROM table_13480122_5 WHERE score = "W 117–93" |
Unique users with post that contain {mhchem}. | 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 VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (... | SELECT DISTINCT OwnerUserId FROM Posts WHERE 'body' LIKE '%{mhchem}%' |
what was the dose of insulin that during their first hospital encounter patient 66015 was last prescribed? | CREATE TABLE diagnoses_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 cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREA... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 66015 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'insulin' ORDER BY prescriptions.startdate DESC LIMIT 1 |
What is the away team at victoria park? | CREATE TABLE table_name_69 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_69 WHERE venue = "victoria park" |
find out the number of alive patients who have been diagnosed with abscess of intestine. | 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Abscess of intestine" |
What are the number of the distinct move in dates of the residents?, could you show in ascending by the total number? | CREATE TABLE Timed_Locations_of_Things (thing_id INTEGER,Date_and_Time DATETIME,Location_Code CHAR(15))CREATE TABLE Customer_Events (Customer_Event_ID INTEGER,customer_id INTEGER,date_moved_in DATETIME,property_id INTEGER,resident_id INTEGER,thing_id INTEGER)CREATE TABLE Residents (resident_id INTEGER,property_id INTEG... | SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) |
What is American, when Initial-Syllable Open/Semi-Open Unstressed Vowels is 'y /a , /'? | CREATE TABLE table_name_7 (american VARCHAR,initial_syllable_open_semi_open_unstressed_vowels VARCHAR) | SELECT american FROM table_name_7 WHERE initial_syllable_open_semi_open_unstressed_vowels = "y /aɪ, ɨ/" |
Who is the leading lady in a yank in the r.a.f.? | CREATE TABLE table_10840 ("Year" real,"Title" text,"Role" text,"Leading Lady" text,"Director" text) | SELECT "Leading Lady" FROM table_10840 WHERE "Title" = 'a yank in the r.a.f.' |
What is the home team with the ny rangers as the visitor team? | CREATE TABLE table_45770 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Home" FROM table_45770 WHERE "Visitor" = 'ny rangers' |
What is the cable rank for episode no. 4? | CREATE TABLE table_73659 ("Episode no." real,"Airdate" text,"Viewers" real,"BBC Three weekly ranking" text,"Cable rank" text) | SELECT "Cable rank" FROM table_73659 WHERE "Episode no." = '4' |
On what date was the ship with a Pennant number of Q144 commissioned? | CREATE TABLE table_name_8 (commissioned VARCHAR,pennant_number VARCHAR) | SELECT commissioned FROM table_name_8 WHERE pennant_number = "q144" |
what is the average hospital cost that involves a procedure, called stress ulcer treatment - antacids until 2104? | 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 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 = 'stress ulcer treatment - antacids')) AND STR... |
has patient 48706 undergone any procedures the previous year? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_i... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 48706) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
what number of divorced patients have been daignosed with parapelgia? | 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 WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Paraplegia" |
how many judges were appointed by president carter ? | CREATE TABLE table_203_563 (id number,"#" number,"judge" text,"state" text,"born/died" text,"active" text,"chief" text,"senior" text,"appointed by" text,"reason for\ntermination" text) | SELECT COUNT("judge") FROM table_203_563 WHERE "appointed by" = 'carter' |
Display a line chart for what is the average prices of wines for each each? | CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT) | SELECT Year, AVG(Price) FROM wine GROUP BY Year |
Which Round has a Position of lw, and a College/Junior/Club Team (League) of swift current broncos (wchl)? | CREATE TABLE table_name_11 (round INTEGER,position VARCHAR,college_junior_club_team__league_ VARCHAR) | SELECT AVG(round) FROM table_name_11 WHERE position = "lw" AND college_junior_club_team__league_ = "swift current broncos (wchl)" |
who was the last opponent on the list , chronologically ? | CREATE TABLE table_204_376 (id number,"date" text,"venue" text,"opponents" text,"score" text,"competition" text) | SELECT "opponents" FROM table_204_376 ORDER BY "date" DESC LIMIT 1 |
Find [A] ([B] or [C]). Search questions by tags intersection and union. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE PostTags (Pos... | SELECT q.Id AS "post_link", q.Tags, q.LastActivityDate, q.Score, q.ViewCount, q.AnswerCount, q.OwnerUserId AS "user_link" FROM Posts AS q JOIN PostTags AS pt ON pt.PostId = q.Id JOIN PostTags AS pt2 ON pt2.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId JOIN Tags AS t2 ON t2.Id = pt2.TagId JOIN TagSynonyms AS ts ON ts.... |
Activity on Stack by Time. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswer... | SELECT COUNT(p.Id) AS count_of_feature, DATE(p.CreationDate) AS datetime, t.Name AS name FROM Posts AS p INNER JOIN PostTypes AS t ON p.PostTypeId = t.Id LEFT JOIN Posts AS pp ON p.ParentId = pp.Id WHERE (p.Tags LIKE '%##tagname##%') OR (pp.Tags LIKE '%##tagname##%') GROUP BY DATE(p.CreationDate), t.Name ORDER BY DATE(... |
A bar chart shows how many locations, and sort from high to low by the X. | CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE train_station (Train_ID int,Station_ID int) | SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY Location DESC |
what are the five most common specimen tests performed since 6 years ago? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_i... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 |
What's the post code of the county with the Chinese name / ? | CREATE TABLE table_1976898_1 (post_code INTEGER,chinese_name__simplified___traditional_ VARCHAR) | SELECT MIN(post_code) FROM table_1976898_1 WHERE chinese_name__simplified___traditional_ = "潜山县 / 潛山縣" |
what is the number of patients whose days of hospital stay is greater than 10 and drug name is phenytoin sodium? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "10" AND prescriptions.drug = "Phenytoin Sodium" |
What was the little league team from Michigan when the little league team from Indiana was Terre Haute North LL Terre Haute? | CREATE TABLE table_18461045_1 (michigan VARCHAR,indiana VARCHAR) | SELECT michigan FROM table_18461045_1 WHERE indiana = "Terre Haute North LL Terre Haute" |
Next semester , what ULCS courses are available ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = course... |
What was the lowes population of 2002 when the 2011 population was 30076? | CREATE TABLE table_2562572_8 (population__2002_ INTEGER,population__2011_ VARCHAR) | SELECT MIN(population__2002_) FROM table_2562572_8 WHERE population__2011_ = 30076 |
What is the total capacity of the airport ranked less than 7, has a capacity in use of 114.2%, and has less than 13,699,657 total passengers? | CREATE TABLE table_41451 ("Rank" real,"Location" text,"Total Passengers" real,"Annual change" text,"Capacity" real,"Capacity in use" text) | SELECT COUNT("Capacity") FROM table_41451 WHERE "Rank" < '7' AND "Capacity in use" = '114.2%' AND "Total Passengers" < '13,699,657' |
What are the first names of the professors who do not play Canoeing or Kayaking as activities? | CREATE TABLE activity (actid number,activity_name text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE participates_in (st... | SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' |
What are the classes that are available this Winter ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course_id int,name varchar,department varchar,numbe... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Who is the Finalist, when the Surface is Clay, and when the Semifinalist is Yevgeny Kafelnikov Juan Carlos Ferrero (2)? | CREATE TABLE table_9935 ("Tournament" text,"Surface" text,"Week" text,"Winner" text,"Finalist" text,"Semifinalists" text) | SELECT "Finalist" FROM table_9935 WHERE "Surface" = 'clay' AND "Semifinalists" = 'yevgeny kafelnikov juan carlos ferrero (2)' |
which dates had below 80,000 in attendance ? | CREATE TABLE table_204_55 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number) | SELECT "date" FROM table_204_55 WHERE "attendance" < 80000 |
among patients who were prescribed potassium chloride inj 2 meq/ml vial after having been diagnosed with acute respiratory distress calculate the four year survival rate. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunit... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... |
What was the Best score during the game played from 1971-1984? | CREATE TABLE table_22680 ("Name" text,"Career" text,"Matches" real,"Overs" text,"Maidens" real,"Runs" real,"Wickets" real,"Average" text,"Best" text,"5w" real,"10w" real) | SELECT "Best" FROM table_22680 WHERE "Career" = '1971-1984' |
What was the score of the league cup in the 2007-08 season? | CREATE TABLE table_name_90 (score VARCHAR,competition VARCHAR,season VARCHAR) | SELECT score FROM table_name_90 WHERE competition = "league cup" AND season = "2007-08" |
Which Derivative has a Launch Date of july 15, 1970; 15:05 gmt? | CREATE TABLE table_name_57 (derivatives VARCHAR,launch_date VARCHAR) | SELECT derivatives FROM table_name_57 WHERE launch_date = "july 15, 1970; 15:05 gmt" |
What is the total number of each ship type? Give me a bar chart, and list Type in desc order. | CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text) | SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY Type DESC |
Which country has the player Ted Schulz? | CREATE TABLE table_name_41 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_41 WHERE player = "ted schulz" |
What was the minimum vertical measurement if the aspect ratio is 16:9 and scanning is interlaced? | CREATE TABLE table_29361 ("Vertical" real,"Horizontal" real,"Aspect ratio" text,"Pixel aspect ratio" text,"Scanning" text,"Frame rate (Hz)" text) | SELECT MIN("Vertical") FROM table_29361 WHERE "Aspect ratio" = '16:9' AND "Scanning" = 'interlaced' |
What was the tie no when Oxford city was the away team? | CREATE TABLE table_name_39 (tie_no VARCHAR,away_team VARCHAR) | SELECT tie_no FROM table_name_39 WHERE away_team = "oxford city" |
Number of questions tagged with Jetbrains. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE T... | SELECT TagName AS Tag, Count FROM Tags WHERE TagName LIKE '%fhir%' |
When 2010 is the year what is the game? | CREATE TABLE table_74419 ("Name" text,"Country" text,"Years" text,"Games" real,"Minutes" real,"Conceded" real,"Shutouts" real,"Int. caps" real) | SELECT "Games" FROM table_74419 WHERE "Years" = '2010' |
How many Draws have Wins larger than 7, and a Wimmera FL of nhill, and Losses larger than 8? | CREATE TABLE table_66659 ("Wimmera FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT SUM("Draws") FROM table_66659 WHERE "Wins" > '7' AND "Wimmera FL" = 'nhill' AND "Losses" > '8' |
when did the first solar saros with a magnitude of greater than 1.00 occur ? | CREATE TABLE table_204_206 (id number,"saros" number,"member" number,"date" text,"time\n(greatest)\nutc" text,"type" text,"location\nlat,long" text,"gamma" number,"mag." number,"width\n(km)" number,"duration\n(min:sec)" text,"ref" number) | SELECT "date" FROM table_204_206 WHERE "mag." > 1.00 ORDER BY "date" LIMIT 1 |
Name the total number of moto2 winners for laguna seca | CREATE TABLE table_27948565_1 (moto2_winner VARCHAR,circuit VARCHAR) | SELECT COUNT(moto2_winner) FROM table_27948565_1 WHERE circuit = "Laguna Seca" |
so what's the maximum neutrophils value of patient 64519 in 07/2104? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64519) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'neutrophils') AND STRFTIME('%y-%m', labevents.charttime) = '2104-07' |
provide the number of patients whose admission year is less than 2120 and drug route is oral? | 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.admityear < "2120" AND prescriptions.route = "ORAL" |
What is the UN operation title with the UN operation name, Uncok? | CREATE TABLE table_15937 ("UN Operation name" text,"UN Operation title" text,"Location" text,"Dates of Australian involvement" text,"Number of Australians involved" text,"Australian role" text) | SELECT "UN Operation title" FROM table_15937 WHERE "UN Operation name" = 'UNCOK' |
What is the production code for Episode 153 in the series? | CREATE TABLE table_2767 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text) | SELECT MIN("Production code") FROM table_2767 WHERE "Series #" = '153' |
For those records from the products and each product's manufacturer, visualize the relationship between code and manufacturer , and group by attribute headquarter. | 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.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
what was the top thrust achieved by a lyul ` ka engine before 1980 ? | CREATE TABLE table_203_823 (id number,"model name" text,"date" text,"type" text,"thrust (kg) / power (eshp)" text,"fitted to" text) | SELECT "thrust (kg) / power (eshp)" FROM table_203_823 ORDER BY "thrust (kg) / power (eshp)" DESC LIMIT 1 |
What is total amount of points for the 2007 season? | CREATE TABLE table_name_69 (points INTEGER,season VARCHAR) | SELECT SUM(points) FROM table_name_69 WHERE season = 2007 |
A Round larger than 1, a College of Oklahoma state, and a average Pick # that has a Position of tight end is what? | CREATE TABLE table_name_44 (pick__number INTEGER,round VARCHAR,position VARCHAR,college VARCHAR) | SELECT AVG(pick__number) FROM table_name_44 WHERE position = "tight end" AND college = "oklahoma state" AND round > 1 |
What Grid has a Time/Retired of clutch? | CREATE TABLE table_name_2 (grid INTEGER,time_retired VARCHAR) | SELECT SUM(grid) FROM table_name_2 WHERE time_retired = "clutch" |
Which home team played at MCG? | CREATE TABLE table_name_93 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_93 WHERE venue = "mcg" |
Show the number of accounts for each customer in a bar chart grouping by customer's first name. | CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Financial_Transactions (transaction_id INTEGER,account_id INTEGER,invoice_number INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DECIMAL(19,4),transaction_comment VARCHAR(255),other_transa... | SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id |
BOSTON to PITTSBURGH | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)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 d... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... |
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday. | 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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' |
how many platforms did american mcgee 's grimm run on ? | CREATE TABLE table_203_836 (id number,"title" text,"year" number,"platforms" text,"developer" text,"publisher" text,"notes" text) | SELECT "platforms" FROM table_203_836 WHERE "title" = "american mcgee's grimm" |
what are the four most common medications that followed during the same month for patients who received antiviral therapy until 2101? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmen... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiviral therapy' AND STRFTIME('%y', treatment.tr... |
What is the winning score when 5 strokes is the margin of victory? | CREATE TABLE table_24530 ("No." real,"Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner(s)-up" text,"Winners share (\u20ac)" real) | SELECT "Winning score" FROM table_24530 WHERE "Margin of victory" = '5 strokes' |
Who is the top goalscorer for season 1998-99? | CREATE TABLE table_2429942_2 (top_goalscorer VARCHAR,season VARCHAR) | SELECT top_goalscorer FROM table_2429942_2 WHERE season = "1998-99" |
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, and could you list Y in desc order please? | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC |
what is patient 27739's monthly minimum value of arterial bp [diastolic] since 1068 days ago? | 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)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm... | SELECT MIN(chartevents.valuenum) 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 = 27739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... |
Visualize a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Home, show in asc by the Y-axis. | 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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID |
Who was featured in 20 questions when the subject of the interview was Mike Piazza? | CREATE TABLE table_20225 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text) | SELECT "20 Questions" FROM table_20225 WHERE "Interview subject" = 'Mike Piazza' |
Next semester which classes are available as PreMajor ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = co... |
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home, and sort in desc by the X-axis 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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC |
What did the Victoria park home team score? | CREATE TABLE table_name_1 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_1 WHERE venue = "victoria park" |
What is the highest water (sq mi) of the township glenila, which has more than 33.576 sq mi of land and a latitude greater than 48.832189? | CREATE TABLE table_65267 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" real,"Water (sqmi)" real,"Latitude" real,"Longitude" real,"GEO ID" real,"ANSI code" real) | SELECT MAX("Water (sqmi)") FROM table_65267 WHERE "Land ( sqmi )" > '33.576' AND "Township" = 'glenila' AND "Latitude" > '48.832189' |
give me the number of patients whose language is span and religion is jewish? | 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.language = "SPAN" AND demographic.religion = "JEWISH" |
What is the highest Pick number that had a road number that was less than 6, featured Bob Dailey as a player, and which had a Reg GP bigger than 257? | CREATE TABLE table_57716 ("Rd #" real,"Pick #" real,"Player" text,"Reg GP" real,"Pl GP" real) | SELECT MAX("Pick #") FROM table_57716 WHERE "Rd #" < '6' AND "Player" = 'bob dailey' AND "Reg GP" > '257' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.