instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
count the number of times that patient 035-4428 had received a alt (sgpt) laboratory test in 01/last year. | 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 COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4428')) AND lab.labname = 'alt (sgpt)' AND DATETIME(lab.labresulttime, 'start of year') ... |
fares and flights from PITTSBURGH to PHILADELPHIA | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body var... | SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = A... |
What is the Singapore Cup when the S-League is 5 (14)? | CREATE TABLE table_43165 ("Rank" real,"Name" text,"S-League" text,"Singapore Cup" text,"Singapore League Cup" text,"Total" text) | SELECT "Singapore Cup" FROM table_43165 WHERE "S-League" = '5 (14)' |
please list the flight schedule from BALTIMORE to SAN FRANCISCO on FRIDAY nights | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE compartment_class (compartment v... | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE ((((FLIGHT_1.departure_time <= 2400 AND FLIGHT_1.departure_time >= 1800) AND days... |
how many patients died in the same hospital visit after being diagnosed since 1 year ago with hypotension / pressor dependent? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... |
What is the gender of the junior high school is 24mm? | CREATE TABLE table_13555999_1 (gender VARCHAR,junior_high_school__12_15_yrs_ VARCHAR) | SELECT gender FROM table_13555999_1 WHERE junior_high_school__12_15_yrs_ = "24mm" |
How many assists did the player with 54 penalty minutes have? | CREATE TABLE table_62352 ("Name" text,"Hometown" text,"Games" text,"Goals" text,"Assists" text,"Points" text,"Pen. Min." text) | SELECT "Assists" FROM table_62352 WHERE "Pen. Min." = '54' |
Which episode number drew in 3.84 million viewers in the U.S.? | CREATE TABLE table_72603 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT MAX("Series #") FROM table_72603 WHERE "U.S. viewers (million)" = '3.84' |
Who is every successor for the Washington 3rd District? | CREATE TABLE table_2159571_2 (successor VARCHAR,district VARCHAR) | SELECT successor FROM table_2159571_2 WHERE district = "Washington 3rd" |
Who was the opponent before week 8 when the result was l 28-17? | CREATE TABLE table_name_49 (opponent VARCHAR,week VARCHAR,result VARCHAR) | SELECT opponent FROM table_name_49 WHERE week < 8 AND result = "l 28-17" |
What team has a season of 2009-10? | CREATE TABLE table_60701 ("Season" text,"League" text,"Teams" text,"Home" text,"Away" text) | SELECT "Teams" FROM table_60701 WHERE "Season" = '2009-10' |
Name the vacator for reason for change died january 12, 1826 | CREATE TABLE table_225102_4 (vacator VARCHAR,reason_for_change VARCHAR) | SELECT vacator FROM table_225102_4 WHERE reason_for_change = "Died January 12, 1826" |
What home team played against Crystal Palace? | CREATE TABLE table_64099 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_64099 WHERE "Away team" = 'crystal palace' |
count the number of patients whose age is less than 80 and drug name is oseltamivir? | 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,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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.drug = "Oseltamivir" |
i want to go from DENVER to OAKLAND | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND... |
Group and count the city attribute of the location table to visualize a bar chart, show by the names from low to high. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANA... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY |
what was the name of the first race title ? | CREATE TABLE table_204_508 (id number,"no." number,"race title" text,"track" text,"date" text,"tv" text) | SELECT "race title" FROM table_204_508 ORDER BY "date" LIMIT 1 |
What are the destinations and number of flights to each one Visualize by bar chart, and sort y-axis in desc order. | CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid n... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC |
How many districts had crib damage of 1,164.50? | CREATE TABLE table_23715 ("Year" real,"District" real,"Blocks" real,"Panchayat" real,"Village" real,"Human (in Lakh)" text,"Animal (in Lakh)" text,"Total Area (in Lakh ha)" text,"Cropped area (in Lakh ha)" text,"Crop Damaged (in Lakh INR)" text,"House Affected" real,"Public Property Damaged (in Lakh INR)" text) | SELECT COUNT("District") FROM table_23715 WHERE "Crop Damaged (in Lakh INR )" = '1,164.50' |
show the top three most frequent output events until 2100? | 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 t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2100' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3 |
If the Indians are 8.2%, what is the salary range? | CREATE TABLE table_74075 ("Salary range" text,"Indians" text,"Pakistanis" text,"Nepalese" text,"Working force of HK" text) | SELECT "Salary range" FROM table_74075 WHERE "Indians" = '8.2%' |
i'm planning a trip to PITTSBURGH and i live in DENVER can you help me | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE time_zone (time_zo... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... |
What is every entry for epoch if periselene is 2,291.250? | CREATE TABLE table_206217_2 (epoch__utc_ VARCHAR,periselene__km_ VARCHAR) | SELECT epoch__utc_ FROM table_206217_2 WHERE periselene__km_ = "2,291.250" |
How many production codes are there for episode 10 in the season? | CREATE TABLE table_24425976_2 (production_code VARCHAR,season VARCHAR) | SELECT COUNT(production_code) FROM table_24425976_2 WHERE season = "10" |
What was the result of the game that was attended by 41,650 people? | CREATE TABLE table_58805 ("Date" text,"Opponent#" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_58805 WHERE "Attendance" = '41,650' |
What are the full names of employees who with in department 70 or 90? | CREATE TABLE jobs (job_id text,job_title text,min_salary number,max_salary number)CREATE TABLE employees (employee_id number,first_name text,last_name text,email text,phone_number text,hire_date time,job_id text,salary number,commission_pct number,manager_id number,department_id number)CREATE TABLE job_history (employe... | SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90 |
When was the game played if the attendance is less than 6427.0? | CREATE TABLE table_20557 ("#" real,"Date" text,"at/vs." text,"Opponent" text,"Score" text,"Attendance" real,"Record" text) | SELECT "Date" FROM table_20557 WHERE "Attendance" < '6427.0' |
what were the four most frequent microbiology tests ordered for a patient within 2 months after receiving paracentesis in this year? | 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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti... | SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'paracentesis' AND DATETIME(treatment.treatme... |
What nation had a medal total of less than 10, less than 1 bronze medal, in rank 11? | CREATE TABLE table_name_79 (nation VARCHAR,rank VARCHAR,total VARCHAR,bronze VARCHAR) | SELECT nation FROM table_name_79 WHERE total < 10 AND bronze < 1 AND rank = "11" |
What is the international mail with the lowest number to have less than 72 domestic freight, 0 domestic mail later than 2012 with total freight and mail more than 4,695? | CREATE TABLE table_45339 ("Year" real,"Domestic freight" real,"Domestic mail" real,"International freight" real,"International mail" real,"Total freight and mail" real,"Change" text) | SELECT MIN("International mail") FROM table_45339 WHERE "Domestic freight" < '72' AND "Domestic mail" = '0' AND "Year" < '2012' AND "Total freight and mail" > '4,695' |
how many patients whose admission location is clinic referral/premature underwent endoscopic sphincterotomy and papillotomy? | 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.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy" |
when do planes leave BOSTON for SAN FRANCISCO | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_n... | SELECT DISTINCT flight.departure_time 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 = 'SA... |
Who wrote series number 99? | CREATE TABLE table_11655 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real) | SELECT "Written by" FROM table_11655 WHERE "Series #" = '99' |
Which NHL team chose an American player from the United States Hockey League? | CREATE TABLE table_60522 ("Pick #" real,"Player" text,"Nationality" text,"Position" text,"NHL team" text,"Team from" text,"League from" text) | SELECT "NHL team" FROM table_60522 WHERE "Nationality" = 'united states' AND "League from" = 'united states hockey league' |
what were the four most frequently ordered laboratory tests for patients who had been diagnosed with dmii circ uncntrld previously in the same month,? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careu... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... |
Who was Canada's lead? | CREATE TABLE table_name_76 (lead VARCHAR,country VARCHAR) | SELECT lead FROM table_name_76 WHERE country = "canada" |
Has 154 been taught by Prof. Kristin Vaneyk many times ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE stude... | SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 154 AND instructor.name LIKE '%Kristin Vaneyk%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offe... |
calculate the average age of male patients who were admitted to hospital on an urgent basis. | 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 AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "URGENT" |
What is the score of the Devil Rays on April 24? | CREATE TABLE table_name_28 (score VARCHAR,opponent VARCHAR,date VARCHAR) | SELECT score FROM table_name_28 WHERE opponent = "devil rays" AND date = "april 24" |
hba1c between 7.5 % _ 10.5 % | CREATE TABLE table_dev_15 ("id" int,"hemoglobin_a1c_hba1c" float,"hepatic_enzymes" bool,"platelet_count" float,"liver_disease" bool,"hba1c" float,"triglyceride_tg" float,"NOUSE" float) | SELECT * FROM table_dev_15 WHERE hba1c >= 7.5 AND hemoglobin_a1c_hba1c <= 10.5 |
give me the number of patients whose admission year is less than 2123 and lab test category is blood gas? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2123" AND lab."CATEGORY" = "Blood Gas" |
Give me a pie chart to reflect the proportion of Team_Name and Team_ID. | 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_Name, Team_ID FROM basketball_match |
Name the date for washington | CREATE TABLE table_3865 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_3865 WHERE "Team" = 'Washington' |
A bar chart showing the number of first name for all female students. Their sex is F. | CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))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 Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20)) | SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname |
Find the distinct last names of all the students who have president votes and whose advisor is not 2192. | CREATE TABLE voting_record (stuid number,registration_date text,election_cycle text,president_vote number,vice_president_vote number,secretary_vote number,treasurer_vote number,class_president_vote number,class_senator_vote number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number... | SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = president_vote EXCEPT SELECT DISTINCT lname FROM student WHERE advisor = "2192" |
What is the name of the Senator in the O District who assumed office in 2013? | CREATE TABLE table_name_81 (name VARCHAR,assumed_office VARCHAR,district VARCHAR) | SELECT name FROM table_name_81 WHERE assumed_office = 2013 AND district = "o" |
Name the spouse for louise of hesse-kassel | CREATE TABLE table_name_83 (spouse VARCHAR,name VARCHAR) | SELECT spouse FROM table_name_83 WHERE name = "louise of hesse-kassel" |
List the episode whose number in the series is 111. | CREATE TABLE table_16881 ("No. in series" text,"No. in season" text,"Title" text,"Directed by" text,"Written by" text,"Featured character(s)" text,"Original air date" text,"U.S. viewers (million)" text) | SELECT "No. in season" FROM table_16881 WHERE "No. in series" = '111' |
What is the date of the game against the Lizards with a result of w 18-17? | CREATE TABLE table_name_18 (date VARCHAR,opponent VARCHAR,result VARCHAR) | SELECT date FROM table_name_18 WHERE opponent = "lizards" AND result = "w 18-17" |
On which date did Ger Loughnane from Team Clare have a match? | CREATE TABLE table_32395 ("Player" text,"Team" text,"Date" text,"Opposition" text,"Game" text) | SELECT "Date" FROM table_32395 WHERE "Team" = 'clare' AND "Player" = 'ger loughnane' |
What party does Bill McCollum belong to? | CREATE TABLE table_18142 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT "Party" FROM table_18142 WHERE "Incumbent" = 'Bill McCollum' |
What is the number range for the 56 quantity? | CREATE TABLE table_name_60 (number_range VARCHAR,quantity VARCHAR) | SELECT number_range FROM table_name_60 WHERE quantity = "56" |
What was the result of the game on October 6, 1974? | CREATE TABLE table_14954150_1 (result VARCHAR,date VARCHAR) | SELECT result FROM table_14954150_1 WHERE date = "October 6, 1974" |
What is Tom Kite's Place? | CREATE TABLE table_62252 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "Place" FROM table_62252 WHERE "Player" = 'tom kite' |
what are the flights from ATLANTA to BALTIMORE | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM... |
What is the best score of the dance freestyle? | CREATE TABLE table_39280 ("Dance" text,"Best dancer(s)" text,"Best score" text,"Worst dancer(s)" text,"Worst score" text) | SELECT "Best score" FROM table_39280 WHERE "Dance" = 'freestyle' |
What is the Official ITV1 rating for auditions 4? | CREATE TABLE table_name_96 (official_itv1_rating VARCHAR,episode VARCHAR) | SELECT official_itv1_rating FROM table_name_96 WHERE episode = "auditions 4" |
What is the 2004 value if the 1998 value is 35? | CREATE TABLE table_name_73 (Id VARCHAR) | SELECT 2004 FROM table_name_73 WHERE 1998 = "35" |
count the number of patients who had undergone loc exc bone lesion nec two times until 2103. | CREATE TABLE diagnoses_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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id n... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'loc exc bone lesion n... |
what's the minimum total with crop (kilotonnes) being s lupin | CREATE TABLE table_59 ("Crop (kilotonnes)" text,"New South Wales" real,"Victoria" real,"Queensland" real,"Western Australia" real,"South Australia" real,"Tasmania" real,"Total" real) | SELECT MIN("Total") FROM table_59 WHERE "Crop (kilotonnes)" = 's Lupin' |
had patient 006-195316 visited the emergency room on their current hospital visit? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '006-195316' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL |
show me flights from PITTSBURGH to ATLANTA on monday afternoon | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline te... | 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 (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_... |
What is the Margin, when Date is 19 July 2008 (Round 19)? | CREATE TABLE table_name_27 (margin VARCHAR,date VARCHAR) | SELECT margin FROM table_name_27 WHERE date = "19 july 2008 (round 19)" |
What years won when the To par is more than 13? | CREATE TABLE table_14480 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT "Year(s) won" FROM table_14480 WHERE "To par" > '13' |
how many patients less than age 89 years are widowed? | 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.marital_status = "WIDOWED" AND demographic.age < "89" |
how many people have no goals ? | CREATE TABLE table_203_121 (id number,"name" text,"pos." text,"caps" number,"goals" number,"club" text) | SELECT COUNT("name") FROM table_203_121 WHERE "goals" = 0 |
Which College has a Round of 11, and a Position of wr? | CREATE TABLE table_8912 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "College" FROM table_8912 WHERE "Round" = '11' AND "Position" = 'wr' |
The competition located in Northampton had a resulting score of what? | CREATE TABLE table_15693 ("Date" text,"Score" text,"Location" text,"Competition" text,"Serial No." text) | SELECT "Score" FROM table_15693 WHERE "Location" = 'northampton' |
What is the Tamil Name of the Thaipusam holiday? | CREATE TABLE table_name_96 (tamil_name VARCHAR,english_name VARCHAR) | SELECT tamil_name FROM table_name_96 WHERE english_name = "thaipusam" |
how much is hypertonic saline administration? | 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 lab (labid number,patientunitstayid number,labna... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'hypertonic saline administration') |
If you are a pilot officer in the commonwealth then what will you called as in the US air force? | CREATE TABLE table_1015521_2 (us_air_force_equivalent VARCHAR,commonwealth_equivalent VARCHAR) | SELECT us_air_force_equivalent FROM table_1015521_2 WHERE commonwealth_equivalent = "Pilot Officer" |
What is the highest Gold that has a Silver less than 7 and Bronze less than 0 | CREATE TABLE table_name_17 (gold INTEGER,silver VARCHAR,bronze VARCHAR) | SELECT MAX(gold) FROM table_name_17 WHERE silver < 7 AND bronze < 0 |
What was the venue when the home team was Fitzroy? | CREATE TABLE table_name_76 (venue VARCHAR,home_team VARCHAR) | SELECT venue FROM table_name_76 WHERE home_team = "fitzroy" |
How many listings under Melbourne has a distance at 15km? | CREATE TABLE table_2923917_4 (melbourne VARCHAR,distance VARCHAR) | SELECT COUNT(melbourne) FROM table_2923917_4 WHERE distance = "15km" |
Which winning song had a debut album in progress? | CREATE TABLE table_name_32 (winning_song VARCHAR,debut_album VARCHAR) | SELECT winning_song FROM table_name_32 WHERE debut_album = "in progress" |
has patient 027-3046 received a vasodilator - minoxidil in other hospitals? | 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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-3046' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-3046' AND patient.hospitaldischargetime IS NULL)) AND trea... |
What is the Week number with a Result of W 30-28? | CREATE TABLE table_43636 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT AVG("Week") FROM table_43636 WHERE "Result" = 'w 30-28' |
Who is the Candidate when the Riding is Hochelaga? | CREATE TABLE table_name_13 (candidate VARCHAR,riding VARCHAR) | SELECT candidate FROM table_name_13 WHERE riding = "hochelaga" |
What number(s) in the series was written by bo crese? | CREATE TABLE table_26565936_2 (no_in_series VARCHAR,written_by VARCHAR) | SELECT no_in_series FROM table_26565936_2 WHERE written_by = "Bo Crese" |
Show the premise type and address type code for all customer addresses. | CREATE TABLE premises (premises_type VARCHAR,premise_id VARCHAR)CREATE TABLE customer_addresses (address_type_code VARCHAR,premise_id VARCHAR) | SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id |
AA from PHOENIX to MILWAUKEE | CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_dist... | 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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHO... |
What is the nationality of the player who played 505 games? | CREATE TABLE table_name_37 (nationality VARCHAR,games VARCHAR) | SELECT nationality FROM table_name_37 WHERE games = "505" |
top users in el salvador. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDi... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##country##%') ORDER BY Reputation DESC |
What is the Label of the release with Catalog number LPM-2899? | CREATE TABLE table_name_87 (label VARCHAR,catalog VARCHAR) | SELECT label FROM table_name_87 WHERE catalog = "lpm-2899" |
What is the most rnd for watkins glen? | CREATE TABLE table_13643154_2 (rnd INTEGER,circuit VARCHAR) | SELECT MIN(rnd) FROM table_13643154_2 WHERE circuit = "Watkins Glen" |
How many titles had production code 1040? | CREATE TABLE table_73839 ("No. in season" real,"No. in series" real,"Title" text,"Canadian airdate" text,"US airdate" text,"Production code" real) | SELECT COUNT("Title") FROM table_73839 WHERE "Production code" = '1040' |
What is the highest lane value for a mark of 2:02.27 NR, with heats under 2? | CREATE TABLE table_50991 ("Heat" real,"Lane" real,"Name" text,"Country" text,"Mark" text) | SELECT MAX("Lane") FROM table_50991 WHERE "Mark" = '2:02.27 nr' AND "Heat" < '2' |
What are the names of climbers and the corresponding heights of the mountains that they climb Show bar chart, display from low to high by the bars please. | CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int)CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text) | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name |
what is patient 22648's minimum value of urea nitrogen, urine in this month? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen, urine') AND DATETIME(labevents.charttime, 'start of month') ... |
How many networks are there that include the judges pete goffe-wood andrew atkinson benny masekwameng? | CREATE TABLE table_28190363_1 (network VARCHAR,judges VARCHAR) | SELECT COUNT(network) FROM table_28190363_1 WHERE judges = "Pete Goffe-Wood Andrew Atkinson Benny Masekwameng" |
when did it last happen on the current icu visit that the heart rate of patient 18866 was less than 97.0? | CREATE TABLE procedures_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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CRE... | 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 = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... |
what is the number of patients whose primary disease is sdh and hospital stay is above 10 days? | 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SDH" AND demographic.days_stay > "10" |
DB2 tag - monthly totals. | 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 DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... |
what are three most frequent medications prescribed during the same hospital visit to the syringomyelia female patients of age 60 or above after they have been diagnosed with syringomyelia? | 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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'syringomyelia')... |
How many televotes are there where there is 4 jury votes? | CREATE TABLE table_23289 ("Draw" real,"Artist" text,"Song" text,"Jury votes" real,"Televotes" real,"Total votes" real,"Result" text) | SELECT "Televotes" FROM table_23289 WHERE "Jury votes" = '4' |
Answer score as a function of question score. Plots average answer score, +/- 1 standard deviation, as a function of binned question score.. Plots average answer score, +/- 1 standard deviation, as a function of binned question score. Increase the Q.Score cutoff to see more exaggerated but noisier trends. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,Crea... | SELECT AVG(Q.Score) AS QuestionScore, AVG(A.Score) AS AnswerScore, AVG(A.Score) + STDEV(A.Score) AS PlusOneSigma, AVG(A.Score) - STDEV(A.Score) AS MinusOneSigma FROM Posts AS A INNER JOIN Posts AS Q ON A.ParentId = Q.Id WHERE A.PostTypeId = 2 AND Q.Score <= 100 GROUP BY SIGN(Q.Score) * ROUND(SQRT(ABS(Q.Score) * 10), 0)... |
Name the total number of opponent in the final for 6 2, 6 1, 6 3 | CREATE TABLE table_73493 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Opponent in the final" text,"Score in the final" text) | SELECT COUNT("Opponent in the final") FROM table_73493 WHERE "Score in the final" = '6–2, 6–1, 6–3' |
what were the differences in arterial bp [systolic] of patient 28443 last measured on the current intensive care unit visit compared to the value second to last measured on the current intensive care unit visit? | 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 icustays (row_id number,subject_id number,hadm_id number,icust... | SELECT (SELECT 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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... |
what is the location on november 23? | CREATE TABLE table_name_58 (location VARCHAR,date VARCHAR) | SELECT location FROM table_name_58 WHERE date = "november 23" |
Which finish has a 99.550 Qual? | CREATE TABLE table_56668 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Finish" FROM table_56668 WHERE "Qual" = '99.550' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.