instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name by a bar chart, could you display from high to low by the Y-axis?
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEP...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
At which tournament did william renshaw begin his lead when he had won 7 titles?
CREATE TABLE table_26048 ("Years led" text,"Span of years led" real,"Player" text,"Titles won at point of lead" real,"Total Career titles" real,"Tournament at which lead began" text)
SELECT "Tournament at which lead began" FROM table_26048 WHERE "Player" = 'William Renshaw' AND "Titles won at point of lead" = '7'
which tie number did not have any attendance ?
CREATE TABLE table_204_846 (id number,"tie no" number,"home team" text,"score" text,"away team" text,"attendance" number)
SELECT "tie no" FROM table_204_846 WHERE "attendance" IS NULL
How many episodes had a production code of 5m13?
CREATE TABLE table_24027 ("Ep." real,"Season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. Code" text)
SELECT COUNT("Ep.") FROM table_24027 WHERE "Prod. Code" = '5M13'
WHAT IS THE 4:30PM WITH AN 8:00AM CBS THIS MORNING?
CREATE TABLE table_61659 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"10:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"4:00 pm" text,"4:30 pm" text,"5:00 pm" text,"6:30 pm" text)
SELECT "4:30 pm" FROM table_61659 WHERE "8:00 am" = 'cbs this morning'
What was the number of males that had the number females 62 331?
CREATE TABLE table_71100 ("Language" text,"Number" text,"percentage (%)" text,"males" text,"females" text)
SELECT "males" FROM table_71100 WHERE "females" = '62 331'
tell me both the short title and long title of diagnoses for patient josette orr.
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 procedures (subject_id text,hadm_id te...
SELECT diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr"
Which players have a pick number of 27?
CREATE TABLE table_10975034_4 (player VARCHAR,pick__number VARCHAR)
SELECT player FROM table_10975034_4 WHERE pick__number = 27
What is the original air date of the episode that was directed by Bruce Seth Green?
CREATE TABLE table_31250 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT "Original air date" FROM table_31250 WHERE "Directed by" = 'Bruce Seth Green'
Count the number of patients admitted to the hospital before year 2157 whose procedure long title is open reduction of fracture with internal fixation, femur.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2157" AND procedures.long_title = "Open reduction of fracture with internal fixation, femur"
How many locations have the call signs dxjp-fm?
CREATE TABLE table_21748 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Location" text)
SELECT COUNT("Location") FROM table_21748 WHERE "Callsign" = 'DXJP-FM'
when has patient 59275 first had the minimum value of rdw until 40 months ago?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icust...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59275) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-40 month'...
What is the lowest Overall for the wide receiver in a round less than 2?
CREATE TABLE table_name_93 (overall INTEGER,position VARCHAR,round VARCHAR)
SELECT MIN(overall) FROM table_name_93 WHERE position = "wide receiver" AND round < 2
show me times for flights from SAN FRANCISCO to ATLANTA
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE code_description (code varchar,description text)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 compartment_clas...
SELECT DISTINCT flight.arrival_time, 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_cod...
what is the frequency (hz) when the g ( s/km) is 53.205?
CREATE TABLE table_261642_3 (frequency__hz_ VARCHAR,g__μs_km_ VARCHAR)
SELECT frequency__hz_ FROM table_261642_3 WHERE g__μs_km_ = "53.205"
tell me the maximum cost for a hospital with cerebral mass of unknown etiology?
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 patient (uniquepid text,patienthealthsystemstayi...
SELECT MAX(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 diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'cerebral mass of unknown etiology')) GROUP B...
when was the first time patient 26799 was having less than 18.0 respiratory rate on 09/20/last year?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE microbiologyev...
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 = 26799)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat...
until 2104 how many patients were diagnosed with cor ath unsp vsl ntv/gft and didn't come back to the hospital within 2 months?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cor ath un...
How many object dates have origin in Samoa?
CREATE TABLE table_29635868_1 (object_date VARCHAR,origin VARCHAR)
SELECT COUNT(object_date) FROM table_29635868_1 WHERE origin = "Samoa"
For the problem whose id is 10, bin the log_entry_date into the weekday interval and count the date, and return a bar chart, display by the Y from high to low.
CREATE TABLE Staff (staff_id INTEGER,staff_first_name VARCHAR(80),staff_last_name VARCHAR(80),other_staff_details VARCHAR(255))CREATE TABLE Product (product_id INTEGER,product_name VARCHAR(80),product_details VARCHAR(255))CREATE TABLE Problem_Log (problem_log_id INTEGER,assigned_to_staff_id INTEGER,problem_id INTEGER,p...
SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) DESC
What is the position when the points were less than 34, draws of 7, and a Club of sd eibar?
CREATE TABLE table_name_53 (position INTEGER,club VARCHAR,points VARCHAR,draws VARCHAR)
SELECT AVG(position) FROM table_name_53 WHERE points < 34 AND draws = 7 AND club = "sd eibar"
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, could you list by the total number in asc?
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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY)
I need to see my transcript .
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,studen...
SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1
What is the fewest wins that has fewer than 23 goals scored, team of 2 de Mayo, and fewer than 7 draws?
CREATE TABLE table_name_16 (wins INTEGER,draws VARCHAR,scored VARCHAR,team VARCHAR)
SELECT MIN(wins) FROM table_name_16 WHERE scored < 23 AND team = "2 de mayo" AND draws < 7
List the number of invoices from the US, grouped by state by a bar chart, show by the Y-axis from low to high.
CREATE TABLE playlists (id INTEGER,name VARCHAR(120))CREATE TABLE invoice_lines (id INTEGER,invoice_id INTEGER,track_id INTEGER,unit_price NUMERIC(10,2),quantity INTEGER)CREATE TABLE employees (id INTEGER,last_name VARCHAR(20),first_name VARCHAR(20),title VARCHAR(30),reports_to INTEGER,birth_date TIMESTAMP,hire_date TI...
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*)
What are the highest cost, lowest cost and average cost of procedures?
CREATE TABLE procedures (cost INTEGER)
SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures
how many more seats does at & t stadium have than ford field ?
CREATE TABLE table_204_392 (id number,"#" number,"stadium" text,"capacity" number,"city" text,"country" text,"domed or retractable roof" text)
SELECT (SELECT "capacity" FROM table_204_392 WHERE "stadium" = 'at&t stadium') - (SELECT "capacity" FROM table_204_392 WHERE "stadium" = 'ford field')
What were the results when the incumbent was John Breaux?
CREATE TABLE table_1341690_18 (result VARCHAR,incumbent VARCHAR)
SELECT result FROM table_1341690_18 WHERE incumbent = "John Breaux"
what was the name of the last lab test that patient 006-133605 had on this hospital visit?
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 treatment (treatmentid number,patientunitstayid number,treatmentname...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL)) ORDER BY lab.labresulttime DESC L...
What is the enrollment ratio for preschool in the region where enrollment ratio for tertiary is 29.55?
CREATE TABLE table_27313 ("Region" text,"Preschool (0\u20135 years)" text,"Primary (6\u201313 years)" text,"Secondary (14\u201317 years)" text,"Tertiary (18\u201324 years)" text)
SELECT "Preschool (0\u20135 years)" FROM table_27313 WHERE "Tertiary (18\u201324 years)" = '29.55'
What's the score of the friendly competition?
CREATE TABLE table_name_18 (score VARCHAR,competition VARCHAR)
SELECT score FROM table_name_18 WHERE competition = "friendly"
what is the total number dallara chassis listed in the table ?
CREATE TABLE table_203_99 (id number,"season" number,"date" text,"driver" text,"team" text,"chassis" text,"engine" text,"race distance\nlaps" number,"race distance\nmiles (km)" text,"race time" text,"average speed\n(mph)" number,"report" text)
SELECT COUNT(*) FROM table_203_99 WHERE "chassis" = 'dallara'
What is the lowest rank for the team that raced a time of 6:17.62 and a notes of sa/b?
CREATE TABLE table_name_87 (rank INTEGER,notes VARCHAR,time VARCHAR)
SELECT MIN(rank) FROM table_name_87 WHERE notes = "sa/b" AND time = "6:17.62"
Name the most attendance for november 17, 1946 and week more than 8
CREATE TABLE table_name_21 (attendance INTEGER,date VARCHAR,week VARCHAR)
SELECT MAX(attendance) FROM table_name_21 WHERE date = "november 17, 1946" AND week > 8
Which players have the position of centre and play for the nhl team new york rangers
CREATE TABLE table_1213511_7 (player VARCHAR,position VARCHAR,nhl_team VARCHAR)
SELECT player FROM table_1213511_7 WHERE position = "Centre" AND nhl_team = "New York Rangers"
What is the date of the Los Angeles open?
CREATE TABLE table_5934 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" real)
SELECT "Date" FROM table_5934 WHERE "Tournament" = 'los angeles open'
what was the team record during the 10th week of the season ?
CREATE TABLE table_203_522 (id number,"week" number,"date" text,"opponent" text,"results\nfinal score" text,"results\nteam record" text,"venue" text,"attendance" number)
SELECT "results\nteam record" FROM table_203_522 WHERE "week" = 10
Which Opponent has a Date of march 16?
CREATE TABLE table_name_42 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_42 WHERE date = "march 16"
what is the yearly average of heart rate for patient 25796 until 49 months ago?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time...
SELECT AVG(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 = 25796)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear...
Who is the forward from Grambling State?
CREATE TABLE table_name_24 (player VARCHAR,position VARCHAR,school_club_team VARCHAR)
SELECT player FROM table_name_24 WHERE position = "forward" AND school_club_team = "grambling state"
What was the format when the label was loen entertainment?
CREATE TABLE table_name_20 (format VARCHAR,label VARCHAR)
SELECT format FROM table_name_20 WHERE label = "loen entertainment"
What was the lowest in the 1930s, has more than 1 in the 1940s, 0 in the 1990s, and a total to date of less than 17?
CREATE TABLE table_7586 ("1900s" real,"1920s" real,"1930s" real,"1940s" real,"1950s" real,"1960s" real,"1970s" real,"1980s" real,"1990s" real,"2000s to date" real,"Total to date" real)
SELECT MIN("1930s") FROM table_7586 WHERE "1940s" > '1' AND "1990s" < '1' AND "Total to date" < '17'
What is the San Javier municipality percentage if the Cuatro Ca adas municipality percentage is 202?
CREATE TABLE table_23472 ("Language" text,"Concepci\u00f3n Municipality (%)" real,"San Javier Municipality (%)" real,"San Ram\u00f3n Municipality (%)" real,"San Juli\u00e1n Municipality (%)" real,"San Antonio de Lomer\u00edo Municipality (%)" text,"Cuatro Ca\u00f1adas Municipality (%)" text)
SELECT "San Javier Municipality (%)" FROM table_23472 WHERE "Cuatro Ca\u00f1adas Municipality (%)" = '202'
provide the number of patients with diagnoses icd9 code v1009 who were admitted before the year 2135.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2135" AND diagnoses.icd9_code = "V1009"
after the 1994/95 season , how many first place finishes did the club have ?
CREATE TABLE table_204_415 (id number,"season" text,"tier" number,"division" text,"place" text)
SELECT COUNT(*) FROM table_204_415 WHERE "season" > '1994/95' AND "place" = 1
What is Score, when Player is 'Vijay Singh'?
CREATE TABLE table_name_41 (score VARCHAR,player VARCHAR)
SELECT score FROM table_name_41 WHERE player = "vijay singh"
In what Year did Yugoslavia have 4 Competitors with 0 medals Total?
CREATE TABLE table_name_78 (year VARCHAR,total VARCHAR,competitors VARCHAR)
SELECT year FROM table_name_78 WHERE total = "0" AND competitors = "4"
Which Country that has a IATA of bal?
CREATE TABLE table_name_83 (country VARCHAR,iata VARCHAR)
SELECT country FROM table_name_83 WHERE iata = "bal"
For each year, return the year and the average number of attendance at home games, and I want to list by the X in desc please.
CREATE TABLE hall_of_fame (player_id TEXT,yearid INTEGER,votedby TEXT,ballots NUMERIC,needed NUMERIC,votes NUMERIC,inducted TEXT,category TEXT,needed_note TEXT)CREATE TABLE pitching (player_id TEXT,year INTEGER,stint INTEGER,team_id TEXT,league_id TEXT,w INTEGER,l INTEGER,g INTEGER,gs INTEGER,cg INTEGER,sho INTEGER,sv ...
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students Plot them as bar chart, sort bar from low to high order.
CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),STU_PHONE varchar(4),PROF_NUM int)CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CO...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME
Who was in external affairs when Jakki Doyle was in Human Resources & Operations?
CREATE TABLE table_name_81 (external_affairs VARCHAR,human_resources_ VARCHAR,_operations VARCHAR)
SELECT external_affairs FROM table_name_81 WHERE human_resources_ & _operations = "jakki doyle"
what is primary disease and procedure icd9 code of subject id 4589?
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 demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4589"
What was the Record of the game with a Score of 118 105?
CREATE TABLE table_name_10 (record VARCHAR,score VARCHAR)
SELECT record FROM table_name_10 WHERE score = "118–105"
which train name arrives in lonavla at 17:45
CREATE TABLE table_29301050_1 (train_name VARCHAR,arrival_lonavla VARCHAR)
SELECT train_name FROM table_29301050_1 WHERE arrival_lonavla = "17:45"
What nation with Rank 1 won the fewest gold medals while winning more than 11 silver but fewer than 7 bronze medals?
CREATE TABLE table_name_47 (gold INTEGER,bronze VARCHAR,silver VARCHAR,rank VARCHAR)
SELECT MIN(gold) FROM table_name_47 WHERE silver > 11 AND rank = "1" AND bronze < 7
What was the result and score of the game on February 22?
CREATE TABLE table_name_5 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_5 WHERE date = "february 22"
provide the number of patients whose primary disease is st elevated myocardial infarction\cardiac cath and admission year is less than 2197?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2197"
What player has 289 as the total?
CREATE TABLE table_78765 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "Player" FROM table_78765 WHERE "Total" = '289'
Which report corresponds to the State Sports Centre?
CREATE TABLE table_name_89 (report VARCHAR,venue VARCHAR)
SELECT report FROM table_name_89 WHERE venue = "state sports centre"
is glucagon prescribed since 6 years ago to patient 28099?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28099) AND prescriptions.drug = 'glucagon' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-6 year')
A bar chart showing how many debates are held for each venue, and I want to show y-axis in asc order.
CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int)CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY COUNT(Venue)
provide the number of patients whose primary disease is hyperglycemia and procedure icd9 code is 4576.
CREATE TABLE procedures (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_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND procedures.icd9_code = "4576"
How many patients with opn rt hemicolectomy nec remained admitted in hospital for more than 7 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 procedures (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,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.short_title = "Opn rt hemicolectomy NEC"
Which Player has a Score of 72-69-73=214?
CREATE TABLE table_name_71 (player VARCHAR,score VARCHAR)
SELECT player FROM table_name_71 WHERE score = 72 - 69 - 73 = 214
What is run time when there were 7.4 million viewers?
CREATE TABLE table_1723080_1 (run_time VARCHAR,viewers__in_millions_ VARCHAR)
SELECT run_time FROM table_1723080_1 WHERE viewers__in_millions_ = "7.4"
When galaxy angel aa is the title what was the series?
CREATE TABLE table_1626 ("Series" text,"Title" text,"Broadcasts (TV) 1" real,"Episodes (TV+extra) 2" text,"Directors" text,"Aired in Japan 3" text,"US Release Date" text)
SELECT "Series" FROM table_1626 WHERE "Title" = 'Galaxy Angel AA'
Failures larger than 0, and a Successes of 1 has what lowest partial failures?
CREATE TABLE table_name_64 (partial_failures INTEGER,failures VARCHAR,successes VARCHAR)
SELECT MIN(partial_failures) FROM table_name_64 WHERE failures > 0 AND successes = 1
Which runner(s)-up had a Winning score of 13 (68-70-66-71=275) and a Margin of victory of 3 strokes?
CREATE TABLE table_name_78 (runner_s__up VARCHAR,margin_of_victory VARCHAR,winning_score VARCHAR)
SELECT runner_s__up FROM table_name_78 WHERE margin_of_victory = "3 strokes" AND winning_score = –13(68 - 70 - 66 - 71 = 275)
What was home team North Melbourne's opponents score?
CREATE TABLE table_name_40 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team AS score FROM table_name_40 WHERE home_team = "north melbourne"
What is the status where the notes are possible jr synonym of sapeornis?
CREATE TABLE table_name_60 (status VARCHAR,notes VARCHAR)
SELECT status FROM table_name_60 WHERE notes = "possible jr synonym of sapeornis"
what was the number of endo polpectomy lrge int procedures that were performed since 1 year ago?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icusta...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endo polpectomy lrge int') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
how many patients since 2 years ago were prescribed vancomycin 1 gm in ns 250 ml ivpb after parenteral feeds - tpn within 2 months?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'parenteral feeds - tpn' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 ...
What about the average amounts of payments by each method code? You can give me a bar chart, sort from high to low by the y-axis.
CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATE,End_Date DATE)CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Date_Payment_Made DATE,Amount_Payment INTEGER)CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INT...
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY AVG(Amount_Payment) DESC
What is the label of the Year before 1979?
CREATE TABLE table_name_16 (label VARCHAR,year INTEGER)
SELECT label FROM table_name_16 WHERE year < 1979
who is the tallest player born in july ?
CREATE TABLE table_204_490 (id number,"position" text,"name" text,"height" text,"weight" text,"birthdate" text,"birthplace" text,"2009-10 team" text)
SELECT "name" FROM table_204_490 WHERE "birthdate" = 7 ORDER BY "height" DESC LIMIT 1
Draw a bar chart for what are all the different product names, and how many complains has each received?, sort in desc by the bars.
CREATE TABLE Complaints (complaint_id INTEGER,product_id INTEGER,customer_id INTEGER,complaint_outcome_code VARCHAR(20),complaint_status_code VARCHAR(20),complaint_type_code VARCHAR(20),date_complaint_raised DATETIME,date_complaint_closed DATETIME,staff_id INTEGER)CREATE TABLE Staff (staff_id INTEGER,gender VARCHAR(1),...
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name DESC
how many patients whose discharge location is disch-tran to psych hosp and primary disease is ruq pain?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "RUQ PAIN"
What college was founded in 1967?
CREATE TABLE table_71009 ("Institution" text,"Main Campus Location" text,"Founded" real,"Mascot" text,"School Colors" text)
SELECT "Main Campus Location" FROM table_71009 WHERE "Founded" = '1967'
Which Nationality has a Rank larger than 1, and a Time smaller than 22.12, and a Lane smaller than 4, and a Name of ashley callus?
CREATE TABLE table_name_99 (nationality VARCHAR,name VARCHAR,lane VARCHAR,rank VARCHAR,time VARCHAR)
SELECT nationality FROM table_name_99 WHERE rank > 1 AND time < 22.12 AND lane < 4 AND name = "ashley callus"
what is date of birth and gender of subject name bessie giordano?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Bessie Giordano"
What season has a 6th north finish and more than 21 points?
CREATE TABLE table_name_18 (season VARCHAR,points VARCHAR,finish VARCHAR)
SELECT season FROM table_name_18 WHERE points > 21 AND finish = "6th north"
The next 6 semesters , what classes will be offered ?
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.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
Find the distinct last names of the students who have class president votes.
CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)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 nu...
SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.class_president_vote
How many episodes titled 'Blue in the face' were directed by Sean McNamara?
CREATE TABLE table_29659 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" real,"U.S. viewers (millions)" text)
SELECT COUNT("Series #") FROM table_29659 WHERE "Directed by" = 'Sean McNamara' AND "Title" = 'Blue in the Face'
What is the away team at lake oval?
CREATE TABLE table_12020 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_12020 WHERE "Venue" = 'lake oval'
How many different results for red (e8) does the model with parchment/saddle interior/roof have?
CREATE TABLE table_2066296_5 (red__e8_ VARCHAR,interior_roof VARCHAR)
SELECT COUNT(red__e8_) FROM table_2066296_5 WHERE interior_roof = "Parchment/saddle"
What venue is in Wantagh, New York?
CREATE TABLE table_1844 ("Date(s)" text,"Venue" text,"City,state" text,"Ticket price(s)" text,"Ticket sold / available" text,"Ticket grossing" text)
SELECT "Venue" FROM table_1844 WHERE "City, state" = 'Wantagh, New York'
Name the power provided for transfer speed mb/s is 1250
CREATE TABLE table_174151_5 (power_provided VARCHAR,transfer_speed__mb_s_ VARCHAR)
SELECT power_provided FROM table_174151_5 WHERE transfer_speed__mb_s_ = "1250"
What is the highest position for Nelson, with a played entry of more than 24?
CREATE TABLE table_name_10 (position INTEGER,team VARCHAR,played VARCHAR)
SELECT MAX(position) FROM table_name_10 WHERE team = "nelson" AND played > 24
when is patient 032-754 receiving an intake for the first time on 05/30/last year?
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 medication (medicationid number,patientunitstayid number,drugname text,dos...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND intakeoutput.cellpath LIKE '%intake%' ...
how many days have passed since patient 12775 first stayed in their current hospital encounter in the ward 23?
CREATE TABLE diagnoses_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,discharge_location text,insurance text,language text,marital_status t...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL)) AND transfers....
Which Indicia has anEnd month in feb-75?
CREATE TABLE table_name_52 (indicia VARCHAR,end_month VARCHAR)
SELECT indicia FROM table_name_52 WHERE end_month = "feb-75"
Tell me the wekk for eastern #2 of houston
CREATE TABLE table_56899 ("Week" real,"EASTERN #1" text,"Eastern #2" text,"WESTERN #1" text,"Western #2" text)
SELECT "Week" FROM table_56899 WHERE "Eastern #2" = 'houston'
provide the procedure short title and drug code of subject id 24425.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT procedures.short_title, prescriptions.formulary_drug_cd FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425"
The order # is what for the week # Top 10?
CREATE TABLE table_28506 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text)
SELECT "Order #" FROM table_28506 WHERE "Week #" = 'Top 10'
Who conducted the poll with sample size of 2000 that shows 18% undecided?
CREATE TABLE table_23812 ("Date of opinion poll" text,"Conductor" text,"Sample size" real,"For" text,"Against" text,"Undecided" text)
SELECT "Conductor" FROM table_23812 WHERE "Undecided" = '18%' AND "Sample size" = '2000'
Name the total number of tests won by australia for series 10
CREATE TABLE table_27755 ("Series" real,"Season" text,"Played in" text,"First Match" text,"Tests played (sched)" text,"Tests won by Australia" real,"Tests won by England" real,"Tests drawn" real,"Series result" text,"Holder at series end" text)
SELECT COUNT("Tests won by Australia") FROM table_27755 WHERE "Series" = '10'
Which date has a Stage of 12?
CREATE TABLE table_name_68 (date VARCHAR,stage VARCHAR)
SELECT date FROM table_name_68 WHERE stage = "12"
How many matches where played with Jim Pugh?
CREATE TABLE table_1028356_3 (opponents VARCHAR,partner VARCHAR)
SELECT COUNT(opponents) FROM table_1028356_3 WHERE partner = "Jim Pugh"
If the national trophy/rookie is Gerrard Barrabeig, what is the name of the second?
CREATE TABLE table_3305 ("Season" real,"Champion" text,"Second" text,"Third" text,"Team Champion" text,"National Trophy/Rookie" text)
SELECT "Second" FROM table_3305 WHERE "National Trophy/Rookie" = 'Gerrard Barrabeig'