instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Name the least events for number 7 | CREATE TABLE table_24108789_6 (events INTEGER,_number VARCHAR) | SELECT MIN(events) FROM table_24108789_6 WHERE _number = 7 |
What are names of patients who made an appointment, and count them by a bar chart, I want to rank by the Y in desc. | CREATE TABLE Physician (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),SSN INTEGER)CREATE TABLE Block (BlockFloor INTEGER,BlockCode INTEGER)CREATE TABLE Stay (StayID INTEGER,Patient INTEGER,Room INTEGER,StayStart DATETIME,StayEnd DATETIME)CREATE TABLE Medication (Code INTEGER,Name VARCHAR(30),Brand VARCHAR(30... | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC |
Who is the team captain of Regenboogstadion? | CREATE TABLE table_46432 ("Club" text,"Location" text,"Current manager" text,"Team captain" text,"Stadium" text,"Capacity" real) | SELECT "Team captain" FROM table_46432 WHERE "Stadium" = 'regenboogstadion' |
What is the least total when there are more than 2 golds and fewer than 0 silver? | CREATE TABLE table_name_6 (total INTEGER,gold VARCHAR,silver VARCHAR) | SELECT MIN(total) FROM table_name_6 WHERE gold > 2 AND silver < 0 |
what is the college when the overall is more than 76 for brian mitchell? | CREATE TABLE table_47903 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "College" FROM table_47903 WHERE "Overall" > '76' AND "Name" = 'brian mitchell' |
On what Date were the Results 4:0? | CREATE TABLE table_38130 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text) | SELECT "Date" FROM table_38130 WHERE "Results\u00b9" = '4:0' |
Return a bar chart about the distribution of date_address_to and the amount of date_address_to bin date_address_to by time. | CREATE TABLE Student_Addresses (student_id INTEGER,address_id INTEGER,date_address_from DATETIME,date_address_to DATETIME,monthly_rental DECIMAL(19,4),other_details VARCHAR(255))CREATE TABLE Assessment_Notes (notes_id INTEGER,student_id INTEGER,teacher_id INTEGER,date_of_notes DATETIME,text_of_notes VARCHAR(255),other_... | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC |
Who made the decision in the game played on December 26? | CREATE TABLE table_27537518_6 (decision VARCHAR,date VARCHAR) | SELECT decision FROM table_27537518_6 WHERE date = "December 26" |
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, list y-axis in desc order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DA... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC |
What is the release date of the episode named Mouse-Placed Kitten with an episode number less than 1495 directed by Robert McKimson? | CREATE TABLE table_name_93 (release_date VARCHAR,title VARCHAR,production_number VARCHAR,director VARCHAR) | SELECT release_date FROM table_name_93 WHERE production_number < 1495 AND director = "robert mckimson" AND title = "mouse-placed kitten" |
Which team started 2010? | CREATE TABLE table_1652 ("Season" text,"Series" text,"Team Name" text,"Races" real,"Poles" real,"Wins" real,"Points" real,"Final Placing" text) | SELECT "Team Name" FROM table_1652 WHERE "Season" = '2010' |
Who had the most assists and how many did they have on October 5? | CREATE TABLE table_27704187_2 (high_assists VARCHAR,date VARCHAR) | SELECT high_assists FROM table_27704187_2 WHERE date = "October 5" |
What is the 2010 population of the municipality with 31 barangays? | CREATE TABLE table_255829_1 (population__2010_ VARCHAR,no_of_barangays VARCHAR) | SELECT population__2010_ FROM table_255829_1 WHERE no_of_barangays = 31 |
what is the competition when the result is won and the date is september 13, 1996? | CREATE TABLE table_name_87 (competition VARCHAR,result VARCHAR,date VARCHAR) | SELECT competition FROM table_name_87 WHERE result = "won" AND date = "september 13, 1996" |
Tell me the player with econ of 4.23 | CREATE TABLE table_56736 ("Player" text,"Overs" text,"Runs" text,"Wkts" text,"Mdns" text,"Econ" text) | SELECT "Player" FROM table_56736 WHERE "Econ" = '4.23' |
When was the kickoff time of the SB XXXVI? | CREATE TABLE table_32534 ("Week" text,"Kickoff" text,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game site" text,"Attendance" text) | SELECT "Kickoff" FROM table_32534 WHERE "Week" = 'sb xxxvi' |
Users with most Edits per Post. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseRea... | WITH Edits AS (SELECT RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, UserId AS "user_link", COUNT(*) AS NumRevisions FROM PostHistory WHERE PostHistoryTypeId BETWEEN 4 AND 9 GROUP BY UserId) SELECT Rank, 'user_link', NumRevisions FROM Edits WHERE Rank < 100 OR 'user_link' = '##UserID##' ORDER BY Rank |
how many male patients have private health insurance? | 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Private" |
was any of the organisms found in patient 031-1337's last urine, catheter specimen test? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | 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-1337')) AND microlab.culturesite = 'urine, catheter specimen' ORDER BY mic... |
Name the stellar age for f3v | CREATE TABLE table_2296507_1 (stellar_age__myr_ VARCHAR,stellar_classification VARCHAR) | SELECT stellar_age__myr_ FROM table_2296507_1 WHERE stellar_classification = "F3V" |
Show the authors of submissions and the acceptance results of their submissions. | CREATE TABLE acceptance (Result VARCHAR,Submission_ID VARCHAR)CREATE TABLE submission (Author VARCHAR,Submission_ID VARCHAR) | SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID |
What is the Margin of victory on aug 11, 2002? | CREATE TABLE table_name_41 (margin_of_victory VARCHAR,date VARCHAR) | SELECT margin_of_victory FROM table_name_41 WHERE date = "aug 11, 2002" |
what number of patients were admitted in urgent care for poisoning by penicillins? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Poisoning by penicillins" |
when did patient 73075 first have a laboratory test in 12/2104? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,ite... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73075) AND STRFTIME('%y-%m', labevents.charttime) = '2104-12' ORDER BY labevents.charttime LIMIT 1 |
What is the sum of week(s) with an attendance of 30,751? | CREATE TABLE table_32570 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT SUM("Week") FROM table_32570 WHERE "Attendance" = '30,751' |
Which money is the highest one that has a To par of 1, and a Score of 73-70-73-71=287? | CREATE TABLE table_name_56 (money___ INTEGER,to_par VARCHAR,score VARCHAR) | SELECT MAX(money___) AS $__ FROM table_name_56 WHERE to_par = "–1" AND score = 73 - 70 - 73 - 71 = 287 |
Which result featured the Indianapolis Colts as opponents? | CREATE TABLE table_name_72 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_72 WHERE opponent = "indianapolis colts" |
In the Tournament during which Ji Nov k made it to the 1st round(1R) in 1995, how did he do in 2001? | CREATE TABLE table_name_32 (Id VARCHAR) | SELECT 2001 FROM table_name_32 WHERE 1995 = "1r" |
Can ARABIC 201 count as Other ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varcha... | SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'ARABIC' AND course.number = 201 AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
what are the allergy types and how many allergies correspond to each one?, could you display in desc by the Y-axis please? | 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))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20)) | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) DESC |
What was the duration of Daniela Ryf's swimming stage? | CREATE TABLE table_21264 ("Athlete" text,"Event" text,"Swim (1.5km)" text,"Trans 1" text,"Bike (40km)" text,"Trans 2" text,"Run (10km)" text,"Total Time" text,"Rank" real) | SELECT "Swim (1.5km)" FROM table_21264 WHERE "Athlete" = 'Daniela Ryf' |
what was the number of drugs patient 30509 was prescribed until 1 year ago? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,disc... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30509) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year') |
When the Tier is listed as tier iii, who is the Winner? | CREATE TABLE table_name_79 (winner VARCHAR,tier VARCHAR) | SELECT winner FROM table_name_79 WHERE tier = "tier iii" |
What is the mountain classification name if the winner is Bernhard Eisel? | CREATE TABLE table_22941863_19 (mountains_classification VARCHAR,winner VARCHAR) | SELECT mountains_classification FROM table_22941863_19 WHERE winner = "Bernhard Eisel" |
what is the number of patients whose insurance is private and procedure short title is remov biliary/liver tube? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Remov biliary/liver tube" |
Comments moved to chat in the last 90 days. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,D... | SELECT COUNT(*) AS threads FROM Comments WHERE Text LIKE 'Comments are not for extended discussion%' AND CreationDate > CURRENT_TIMESTAMP() - '##days?90##' |
How much points were received by the NL league's most valuable player winner in 1990? | CREATE TABLE player_award_vote (award_id text,year number,league_id text,player_id text,points_won number,points_max number,votes_first text)CREATE TABLE player (player_id text,birth_year text,birth_month text,birth_day text,birth_country text,birth_state text,birth_city text,death_year text,death_month text,death_day ... | SELECT T2.points_won FROM player_award AS T1 JOIN player_award_vote AS T2 ON T1.player_id = T2.player_id WHERE T1.league_id = "NL" AND T1.award_id = "Most Valuable Player" AND T1.year = "1990" AND T2.league_id = "NL" AND T2.year = "1990" |
What is the Place of the Player with a To par of +4 and Score of 70-76-71=217? | CREATE TABLE table_9154 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_9154 WHERE "To par" = '+4' AND "Score" = '70-76-71=217' |
What position did Jimmy Oliver of the United States play? | CREATE TABLE table_name_75 (position VARCHAR,nationality VARCHAR,player VARCHAR) | SELECT position FROM table_name_75 WHERE nationality = "united states" AND player = "jimmy oliver" |
what was the first time that patient 95986 had the maximum value of metamyelocytes in 05/2105? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'metamyelocytes') AND STRFTIME('%y-%m', labevents.charttime) = '2105-05' ORDER B... |
have patient 012-40970's been normal until 56 months ago in respiration? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,d... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-40970')) AND vitalperiodic.respiration BETWEEN respiration_lower... |
What is the winning score with a margin of victory of 4 strokes for the NEC Invitational tournament? | CREATE TABLE table_name_93 (winning_score VARCHAR,margin_of_victory VARCHAR,tournament VARCHAR) | SELECT winning_score FROM table_name_93 WHERE margin_of_victory = "4 strokes" AND tournament = "nec invitational" |
What date was the game played at Princes Park? | CREATE TABLE table_10308 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_10308 WHERE "Venue" = 'princes park' |
What is the position of the player who is from the United States and has 30 minutes? | CREATE TABLE table_23963781_3 (position VARCHAR,nationality VARCHAR,minutes VARCHAR) | SELECT position FROM table_23963781_3 WHERE nationality = "United States" AND minutes = 30 |
Closed Questions with -2 score or less.. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostNoticeTypes ... | SELECT q.Score AS Score, q.Id AS "post_link", CASE h.Comment WHEN '1' THEN 'Exact Duplicate' WHEN '2' THEN 'Off-topic' WHEN '3' THEN 'Subjective and argumentative' WHEN '4' THEN 'Not a real question' WHEN '7' THEN 'Too localized' WHEN '10' THEN 'General reference' WHEN '20' THEN 'Noise or pointless (Meta sites only)' W... |
what was the first year the event was held at the pick congress hotel in chicago ? | CREATE TABLE table_204_823 (id number,"dates" text,"location" text,"attendance" text,"official guests" text,"notes" text) | SELECT MIN("dates") FROM table_204_823 WHERE "location" = 'chicago' |
What was the theme when the issue price was $508.95? | CREATE TABLE table_name_72 (theme VARCHAR,issue_price VARCHAR) | SELECT theme FROM table_name_72 WHERE issue_price = "$508.95" |
Name the date for margalita chakhnashvili salome devidze | CREATE TABLE table_16893837_4 (date VARCHAR,opponents VARCHAR) | SELECT date FROM table_16893837_4 WHERE opponents = "Margalita Chakhnashvili Salome Devidze" |
What is the record of the opponent that has a bye? | CREATE TABLE table_71410 ("Week" real,"Date" text,"Opponent" text,"Score" text,"Result" text,"Attendance" text,"Record" text) | SELECT "Record" FROM table_71410 WHERE "Opponent" = 'bye' |
How many laps are associated with a time of + 1:39.591? | CREATE TABLE table_name_37 (laps VARCHAR,time_retired VARCHAR) | SELECT laps FROM table_name_37 WHERE time_retired = "+ 1:39.591" |
Who was the loser of the heavyweight division fight that lasted a time of 2:24? | CREATE TABLE table_36610 ("Weight Division" text,"Winner" text,"Loser" text,"Method" text,"Round" real,"Time" text) | SELECT "Loser" FROM table_36610 WHERE "Weight Division" = 'heavyweight' AND "Time" = '2:24' |
What score did Ed Furgol get to come in at T6? | CREATE TABLE table_48606 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real) | SELECT "Score" FROM table_48606 WHERE "Place" = 't6' AND "Player" = 'ed furgol' |
Which season had 0 wins and 5 losses for the Surrey team? | CREATE TABLE table_name_61 (season VARCHAR,team VARCHAR,wins VARCHAR,losses VARCHAR) | SELECT season FROM table_name_61 WHERE wins = "0" AND losses = "5" AND team = "surrey" |
get me the number of patients diagnosed with diverticulosis of colon with hemorrhage who had blood fluid lab test. | 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,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Diverticulosis of colon with hemorrhage" AND lab.fluid = "Blood" |
What was the home team score at VFL Park? | CREATE TABLE table_58261 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_58261 WHERE "Venue" = 'vfl park' |
what was the first value of the sao2 of patient 030-8973 on 12/28/2104? | 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 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-8973')) AND NOT vitalperiodic.sao2 IS NULL AND STRFTIME('%... |
state the wins of the team with 2 top 10 | CREATE TABLE table_2012187_1 (wins VARCHAR,top_10 VARCHAR) | SELECT COUNT(wins) FROM table_2012187_1 WHERE top_10 = 2 |
what is the number of patients whose primary disease is hypertension;rule out coronary artery disease\cardiac cath and procedure icd9 code is 7761? | 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,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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND procedures.icd9_code = "7761" |
count the number of times that since 961 days ago patient 015-56556 had taken total. | 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 intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... |
Return the names and locations of shops, ordered by name in alphabetical order. | CREATE TABLE shop (shop_id number,shop_name text,location text,open_date text,open_year number)CREATE TABLE device (device_id number,device text,carrier text,package_version text,applications text,software_platform text)CREATE TABLE stock (shop_id number,device_id number,quantity number) | SELECT shop_name, location FROM shop ORDER BY shop_name |
i need a flight from NEW YORK to MONTREAL THURSDAY 5 24 arriving before 1200 | 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.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 AS DAYS_0, days AS DAYS_1, flight WHERE (((DAYS_1.day_name = 'THURSDAY' AND flight.arrival_time <= 1200 AND flight.flight_days = DAYS_1.days_code) AND date_day... |
For CS majors what are the upper level electives offered ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_p... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
What is the average opening at Stadyum Samsun with a capacity smaller than 34,658? | CREATE TABLE table_52025 ("Stadium" text,"Capacity" real,"City" text,"Club" text,"Opening" real) | SELECT AVG("Opening") FROM table_52025 WHERE "Stadium" = 'stadyum samsun' AND "Capacity" < '34,658' |
For all employees who have the letters D or S in their first name, a line chart shows the trend of department_id over hire_date . | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
what is the total 1/2ns ivf consumption amount that patient 015-96048 has received on 10/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 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 = '015-96048')) AND intakeoutput.celllabel = '1/2ns... |
What is the total net profit when earnings per share is 27.4, and profit/loss befor tax was smaller than 194.6 million? | CREATE TABLE table_50331 ("Year ended" text,"Revenue (\u00a3million)" real,"Profit/(loss) before tax (\u00a3m)" real,"Net profit (\u00a3m)" real,"Earnings per share (p)" real) | SELECT SUM("Net profit (\u00a3m)") FROM table_50331 WHERE "Earnings per share (p)" = '27.4' AND "Profit/(loss) before tax (\u00a3m)" < '194.6' |
What is the highest Bodyweight associated with a Clean & jerk larger than 120, and a Total (kg) of 245? | CREATE TABLE table_name_37 (bodyweight INTEGER,total__kg_ VARCHAR,clean_ VARCHAR,_jerk VARCHAR) | SELECT MAX(bodyweight) FROM table_name_37 WHERE clean_ & _jerk > 120 AND total__kg_ = 245 |
What is the earliest week that the Texans played at the Cleveland Browns Stadium? | CREATE TABLE table_name_10 (week INTEGER,game_site VARCHAR) | SELECT MIN(week) FROM table_name_10 WHERE game_site = "cleveland browns stadium" |
Which of the lowest FA Trophys involved the Forest Green Rovers club when the play-offs number was bigger than 0? | CREATE TABLE table_name_8 (fa_trophy INTEGER,club VARCHAR,play_offs VARCHAR) | SELECT MIN(fa_trophy) FROM table_name_8 WHERE club = "forest green rovers" AND play_offs > 0 |
how many patients in 2103 were staying at careunit tsicu? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id nu... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2103') |
What are the names of all the Japanese constructors that have earned more than 5 points, and count them by a bar chart | CREATE TABLE seasons (year INTEGER,url TEXT)CREATE TABLE driverStandings (driverStandingsId INTEGER,raceId INTEGER,driverId INTEGER,points REAL,position INTEGER,positionText TEXT,wins INTEGER)CREATE TABLE constructorStandings (constructorStandingsId INTEGER,raceId INTEGER,constructorId INTEGER,points REAL,position INTE... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name |
When westcott 1935 is in division two how many leagues are in division three? | CREATE TABLE table_24575253_4 (division_three VARCHAR,division_two VARCHAR) | SELECT COUNT(division_three) FROM table_24575253_4 WHERE division_two = "Westcott 1935" |
Draw a bar chart about the distribution of name and ID , and I want to display x-axis in ascending order please. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT name, ID FROM swimmer ORDER BY name |
Partner Aurelija Misevi i t had an outcome of runner-up in what tournament? | CREATE TABLE table_12170 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Tournament" FROM table_12170 WHERE "Outcome" = 'runner-up' AND "Partner" = 'aurelija misevičiūtė' |
What was the attendance when VFL played MCG? | CREATE TABLE table_name_11 (crowd INTEGER,venue VARCHAR) | SELECT MAX(crowd) FROM table_name_11 WHERE venue = "mcg" |
what was the 'output' patient 013-38992 got on the current intensive care unit visit for the first time? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992') AND patient.unitdischargetime IS NULL) AND intak... |
What is the city in India with an airport named Sardar Vallabhbhai Patel International Airport? | CREATE TABLE table_name_58 (city VARCHAR,country VARCHAR,airport VARCHAR) | SELECT city FROM table_name_58 WHERE country = "india" AND airport = "sardar vallabhbhai patel international airport" |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about department_id over the email , and order from low to high by the y-axis please. | 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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS... | SELECT EMAIL, 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 |
What nationality is Kentucky and the player Tayshaun Prince? | CREATE TABLE table_50097 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text) | SELECT "Nationality" FROM table_50097 WHERE "School/Club Team" = 'kentucky' AND "Player" = 'tayshaun prince' |
What was the highest grid for a time/retired of +19.1 secs? | CREATE TABLE table_name_50 (grid INTEGER,time_retired VARCHAR) | SELECT MAX(grid) FROM table_name_50 WHERE time_retired = "+19.1 secs" |
How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed? | CREATE TABLE staff (staff_id number,staff_address_id number,nickname text,first_name text,middle_name text,last_name text,date_of_birth time,date_joined_staff time,date_left_staff time)CREATE TABLE vehicles (vehicle_id number,vehicle_details text)CREATE TABLE customer_payments (customer_id number,datetime_payment time,... | SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed" |
marc dos santos started as coach the same year as what other coach ? | CREATE TABLE table_204_832 (id number,"name" text,"nationality" text,"club" text,"from" number,"until" text) | SELECT "name" FROM table_204_832 WHERE "name" <> 'marc dos santos' AND "from" = (SELECT "from" FROM table_204_832 WHERE "name" = 'marc dos santos') |
Name the most losst for corinthians | CREATE TABLE table_20014 ("Position" real,"Team" text,"Points" real,"Played" real,"Won" real,"Drawn" real,"Lost" real,"For" real,"Against" real,"Difference" text) | SELECT MIN("Lost") FROM table_20014 WHERE "Team" = 'Corinthians' |
tell me about flights from SALT LAKE CITY to ST. PETERSBURG | 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 class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_fare (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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
what is the difference between patient 016-18575's sao2 second measured on the current icu visit compared to the first value measured on the current icu visit? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT (SELECT 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 = '016-18575') AND patient.unitdischargetime IS NULL) AND... |
Find the name of the first 5 customers. | CREATE TABLE products (product_id number,product_name text,product_price number,product_description text)CREATE TABLE customer_addresses (customer_id number,address_id number,date_from time,address_type text,date_to time)CREATE TABLE order_deliveries (location_code text,actual_order_id number,delivery_status_code text,... | SELECT customer_name FROM customers ORDER BY date_became_customer LIMIT 5 |
Name the 2008/09 with 2004/05 of ranking tournaments | CREATE TABLE table_80371 ("2002/ 03" text,"2004/ 05" text,"2006/ 07" text,"2007/ 08" text,"2008/ 09" text,"2009/ 10" text,"2010/ 11" text,"2011/ 12" text,"2012/ 13" text) | SELECT "2008/ 09" FROM table_80371 WHERE "2004/ 05" = 'ranking tournaments' |
How many papers in 1986 | CREATE TABLE field (fieldid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE cite (... | SELECT DISTINCT COUNT(1) FROM paper WHERE year = 1986 |
does flight DL 323 / DL 229 from BOSTON to DENVER stop in PHILADELPHIA | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE equipment_sequence (aircraft_code_sequence v... | SELECT DISTINCT flight_stop.flight_id, flight_stop.stop_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg, flight_stop WHERE ((FLIGHT_1.flight_nu... |
What were the last 10 meetings when the opponent's venue was mu, 11-7? | CREATE TABLE table_49385 ("Missouri vs." text,"Overall Record" text,"at Columbia" text,"at Opponent's Venue" text,"at Neutral Site" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text) | SELECT "Last 10 Meetings" FROM table_49385 WHERE "at Opponent's Venue" = 'mu, 11-7' |
What is the set 5 if the Date is jun 7, and a Set 4 is 21-25? | CREATE TABLE table_name_65 (set_5 VARCHAR,date VARCHAR,set_4 VARCHAR) | SELECT set_5 FROM table_name_65 WHERE date = "jun 7" AND set_4 = "21-25" |
When jim is eliminated what is the finish? | CREATE TABLE table_1893276_2 (finish VARCHAR,eliminated VARCHAR) | SELECT finish FROM table_1893276_2 WHERE eliminated = "Jim" |
based on the table , which locomotive was built first ? | CREATE TABLE table_203_223 (id number,"name" text,"gauge" text,"builder" text,"type" text,"date" number,"works number" number,"notes" text) | SELECT "name" FROM table_203_223 ORDER BY "date" LIMIT 1 |
What is the Catalog with a Date that is march 13, 2002? | CREATE TABLE table_name_9 (catalog VARCHAR,date VARCHAR) | SELECT catalog FROM table_name_9 WHERE date = "march 13, 2002" |
What was the average week of a game with a result of l 10-7 attended by 37,500? | CREATE TABLE table_38720 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT AVG("Week") FROM table_38720 WHERE "Result" = 'l 10-7' AND "Attendance" < '37,500' |
How many years was Pontiac the manufacturer for Joe Gibbs Racing? | CREATE TABLE table_25247 ("Year" text,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" real,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text) | SELECT COUNT("Year") FROM table_25247 WHERE "Team" = 'Joe Gibbs Racing' AND "Manufacturer" = 'Pontiac' |
Find the dates of the tests taken with result 'Pass', and count them by a bar chart, and list in descending by the y-axis. | CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY COUNT(date_test_taken) DESC |
Can 182 be taken by undergrads ? | CREATE TABLE semester (semester_id int,semester varchar,year int)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 va... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 182 |
what is the discharge time for the patient id 65759? | 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 demographic.dischtime FROM demographic WHERE demographic.subject_id = "65759" |
How many games occur on the date December 12? | CREATE TABLE table_17325580_6 (game VARCHAR,date VARCHAR) | SELECT COUNT(game) FROM table_17325580_6 WHERE date = "December 12" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.