instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
I want the NHL team for wade belak
CREATE TABLE table_4420 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "NHL team" FROM table_4420 WHERE "Player" = 'wade belak'
what is the difference in arterial bp [diastolic] in patient 3125's last measured on the current icu visit compared to the value first measured on the current icu visit.
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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE chartevents (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 = 3125) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
what is the number of victories this player has had on hard surfaces ?
CREATE TABLE table_204_868 (id number,"outcome" text,"no." number,"date" text,"tournament" text,"surface" text,"opponent" text,"score" text)
SELECT COUNT(*) FROM table_204_868 WHERE "surface" = 'hard'
what is the last flight leaving SAN FRANCISCO going to WASHINGTON on friday
CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE flight_stop (fli...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 25 AND date_day.month_number = 6 A...
provide the number of patients whose gender is f and procedure long title is atrial cardioversion?
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.gender = "F" AND procedures.long_title = "Atrial cardioversion"
Compare the lowest rating among all movies by each director using a bar chart.
CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)
SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director
What's the lince when Leclerc was Hp (kw)?
CREATE TABLE table_61162 ("Lince" text,"Leopard 2A4" text,"Leclerc" text,"M1A1 Abrams" text,"M60A3 Patton" text)
SELECT "Lince" FROM table_61162 WHERE "Leclerc" = 'hp (kw)'
Which Events has Earnings of $113,259, and an Average larger than 229.5?
CREATE TABLE table_name_22 (events INTEGER,earnings VARCHAR,average VARCHAR)
SELECT MAX(events) FROM table_name_22 WHERE earnings = "$113,259" AND average > 229.5
Which Circuit has an Event of international procar meeting?
CREATE TABLE table_12250 ("Round" real,"Date" text,"Event" text,"Circuit" text,"Winning Driver" text,"Winning Team" text)
SELECT "Circuit" FROM table_12250 WHERE "Event" = 'international procar meeting'
what is the diameter (km) of longitude 170.1e
CREATE TABLE table_16799784_7 (diameter__km_ VARCHAR,longitude VARCHAR)
SELECT diameter__km_ FROM table_16799784_7 WHERE longitude = "170.1E"
What is the low lap total for a grid of 14?
CREATE TABLE table_57955 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MIN("Laps") FROM table_57955 WHERE "Grid" = '14'
what was the ACC home game record for the team who's ACC winning percentage was .813?
CREATE TABLE table_16372911_1 (acc_home VARCHAR,acc__percentage VARCHAR)
SELECT acc_home FROM table_16372911_1 WHERE acc__percentage = ".813"
how many patients have undergone vaccination nec within 2 months after first receiving inj/inf platelet inhibit?
CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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 = 'inj/inf pla...
Name the most free throws for 4 steals
CREATE TABLE table_25695 ("Player" text,"Games Played" real,"Minutes" real,"Field Goals" real,"Three Pointers" real,"Free Throws" real,"Rebounds" real,"Assists" real,"Blocks" real,"Steals" real,"Points" real)
SELECT MAX("Free Throws") FROM table_25695 WHERE "Steals" = '4'
What's the crowd population of the home team located in Richmond?
CREATE TABLE table_55565 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT SUM("Crowd") FROM table_55565 WHERE "Home team" = 'richmond'
What are the distinct hometowns of gymnasts with total points more than 57.5?
CREATE TABLE people (Hometown VARCHAR,People_ID VARCHAR)CREATE TABLE gymnast (Gymnast_ID VARCHAR,Total_Points INTEGER)
SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5
pregnant or breast feeding female
CREATE TABLE table_train_70 ("id" int,"pregnancy_or_lactation" bool,"white_blood_cell_count_wbc" int,"systolic_blood_pressure_sbp" int,"mean_arterial_pressure_map" int,"temperature" float,"oliguria" bool,"surgery" bool,"heart_rate" int,"systemic_inflammatory_response" bool,"paco2" float,"burn_injury" int,"immature_form...
SELECT * FROM table_train_70 WHERE pregnancy_or_lactation = 1
What is the maximum population size in the town of Glengallen?
CREATE TABLE table_17723 ("Year" real,"Population (Region total)" real,"Population (Stanthorpe)" real,"Population (Warwick)" real,"Population (Allora)" real,"Population (Glengallan)" real,"Population (Rosenthal)" real)
SELECT MAX("Population (Glengallan)") FROM table_17723
What is the highest number of goals for for teams with 25 losses?
CREATE TABLE table_9511 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT MAX("Goals For") FROM table_9511 WHERE "Lost" = '25'
What is the region 4 release that has july 20, 2009 as the region 2?
CREATE TABLE table_36338 ("Volume" text,"Discs" real,"Episodes" real,"Region 1 release" text,"Region 2 release" text,"Region 4 release" text)
SELECT "Region 4 release" FROM table_36338 WHERE "Region 2 release" = 'july 20, 2009'
When was the Clubhouse built with a Sign-in/Bicker of bicker, and Named cannon club?
CREATE TABLE table_38396 ("Name" text,"Years of Operation" text,"Location" text,"Historical Photos" text,"Year Clubhouse Constructed" text,"Sign-in/Bicker" text,"Year co-ed" text)
SELECT "Year Clubhouse Constructed" FROM table_38396 WHERE "Sign-in/Bicker" = 'bicker' AND "Name" = 'cannon club'
Name the score for san diego
CREATE TABLE table_26418 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Score" FROM table_26418 WHERE "Championship" = 'San Diego'
What MDE classes are offered next Winter ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE co...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
calculate the minimum days for which patients who were admitted on or after 2179 were hospitalized.
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2179"
what is the title listed after parva ?
CREATE TABLE table_204_667 (id number,"year" number,"film title" text,"genre" text,"cast" text,"notes" text)
SELECT "film title" FROM table_204_667 WHERE id = (SELECT id FROM table_204_667 WHERE "film title" = 'parva') + 1
give the number of patients whose diagnosis icd9 code is v5416 and lab test fluid is pleural.
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V5416" AND lab.fluid = "Pleural"
count the number of patients who have already undergone a sputum, expectorated microbiology test until 1 year ago.
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(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND DATETIME(microlab.culturetakentime) <= DATETIME(CURRENT_TIME(), '-1 year'))
What is Visitor, when Date is 'May 9'?
CREATE TABLE table_62264 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Visitor" FROM table_62264 WHERE "Date" = 'may 9'
what is maximum age of patients whose insurance is self pay and primary disease is hypoxia?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "HYPOXIA"
what are the five most frequent lab tests patients have taken within the same month after being diagnosed with senile dementia uncomp?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 labevents (row_id number,subjec...
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...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of manager_id bin hire_date by time in a bar chart, and rank from high to low by the y axis.
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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decima...
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
Which Share of seats has Seats smaller than 52, and a Name of sdp liberal alliance, and a General election of 1983?
CREATE TABLE table_13606 ("General election" real,"Name" text,"Share of votes" text,"Seats" real,"Share of seats" text)
SELECT "Share of seats" FROM table_13606 WHERE "Seats" < '52' AND "Name" = 'sdp–liberal alliance' AND "General election" = '1983'
What attendance is dated february 27?
CREATE TABLE table_43858 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real)
SELECT AVG("Attendance") FROM table_43858 WHERE "Date" = 'february 27'
What is Born-Died, when Term Start is 4 December 1941?
CREATE TABLE table_name_25 (born_died VARCHAR,term_start VARCHAR)
SELECT born_died FROM table_name_25 WHERE term_start = "4 december 1941"
WhatTranslation has a Composer of jacques brel, rod mckuen?
CREATE TABLE table_name_61 (translation VARCHAR,composer VARCHAR)
SELECT translation FROM table_name_61 WHERE composer = "jacques brel, rod mckuen"
What is the name of the venue where the away team scored 17.12 (114)?
CREATE TABLE table_10305 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_10305 WHERE "Away team score" = '17.12 (114)'
What is the average round for players from california?
CREATE TABLE table_54569 ("Round" real,"Pick" real,"Player" text,"Position" text,"College" text)
SELECT AVG("Round") FROM table_54569 WHERE "College" = 'california'
Who was the opponent in week 6?
CREATE TABLE table_65044 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_65044 WHERE "Week" = '6'
charles zwolsman acquired the same number of points as who ?
CREATE TABLE table_203_519 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "driver" FROM table_203_519 WHERE "driver" <> 'charles zwolsman' AND "points" = (SELECT "points" FROM table_203_519 WHERE "driver" = 'charles zwolsman')
Which Score has a Visitor of toronto st. pats, and a Home of montreal canadiens, and a Record of 3 2 0?
CREATE TABLE table_8376 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Score" FROM table_8376 WHERE "Visitor" = 'toronto st. pats' AND "Home" = 'montreal canadiens' AND "Record" = '3–2–0'
what is the 1405 sibelius of asteroid which 1407 lindel f is 2020 ukko
CREATE TABLE table_21565 ("1391 Carelia" text,"1398 Donnera" text,"1405 Sibelius" text,"1406 Komppa" text,"1407 Lindel\u00f6f" text)
SELECT "1405 Sibelius" FROM table_21565 WHERE "1407 Lindel\u00f6f" = '2020 Ukko'
Who was the opponent on December 10, 2000?
CREATE TABLE table_11132 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_11132 WHERE "Date" = 'december 10, 2000'
What is the mean number of played when there are less than 18 points and the position is less than 8?
CREATE TABLE table_name_45 (played INTEGER,points VARCHAR,position VARCHAR)
SELECT AVG(played) FROM table_name_45 WHERE points < 18 AND position < 8
fasting c _ peptide greater than or equal to 0.8 ng / ml.
CREATE TABLE table_dev_14 ("id" int,"anemia" bool,"pulmonary_disease" bool,"c_peptide_level" float,"hemoglobin_a1c_hba1c" float,"renal_disease" bool,"cardiovascular_disease" bool,"estimated_glomerular_filtration_rate_egfr" int,"fasting_c_peptide" float,"organ_failure" bool,"body_mass_index_bmi" float,"hypertension" boo...
SELECT * FROM table_dev_14 WHERE fasting_c_peptide >= 0.8
what is the start source when started on 2 february?
CREATE TABLE table_name_47 (start_source VARCHAR,started VARCHAR)
SELECT start_source FROM table_name_47 WHERE started = "2 february"
how much is the change of systemicsystolic in patient 006-66713 last measured on the first intensive care unit visit compared to the first value measured on the first intensive care unit visit?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid numbe...
SELECT (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66713') AND NOT patient.unitdischarget...
What is the score of the competition on November 10?
CREATE TABLE table_41819 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_41819 WHERE "Date" = 'november 10'
Show me a scatter plot of destroyed by employee id and the total number for .
CREATE TABLE Ref_Locations (Location_Code CHAR(15),Location_Name VARCHAR(255),Location_Description VARCHAR(255))CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE All_Documents (Document_ID INTEGER,D...
SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID
What's the region for an item on November 10, 2007 that's a cd?
CREATE TABLE table_55145 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Region" FROM table_55145 WHERE "Date" = 'november 10, 2007' AND "Format" = 'cd'
Show all game names played by at least 1000 hours.
CREATE TABLE Plays_games (gameid VARCHAR)CREATE TABLE Video_games (gameid VARCHAR)
SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000
who are all the players for armwood high school
CREATE TABLE table_17093 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT "Player" FROM table_17093 WHERE "School" = 'Armwood High School'
How many points have more than 14 wins, a goal difference of 14, and more than 6 draws?
CREATE TABLE table_name_13 (points VARCHAR,draws VARCHAR,wins VARCHAR,goal_difference VARCHAR)
SELECT COUNT(points) FROM table_name_13 WHERE wins > 14 AND goal_difference = 14 AND draws > 6
Find the number of the physicians who are trained in a procedure that costs more than 5000, order by the Y from high to low.
CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE Procedures (Code INTEGER,Name VARCHAR(30),Cost REAL)CREATE TABLE Department (DepartmentID INTEGER,Name VARCHAR(30),Head INTEGER)CREATE TABLE On_Call (Nurse INTEGER,BlockFloor INTEGER,BlockCode INTEGER,OnCallStart ...
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC
What is Record, when Game is '24'?
CREATE TABLE table_name_24 (record VARCHAR,game VARCHAR)
SELECT record FROM table_name_24 WHERE game = 24
show me ground transportation information for SAN FRANCISCO
CREATE TABLE month (month_number int,month_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,lengt...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code
What year was best costume design the award category?
CREATE TABLE table_41383 ("Year" real,"Award" text,"Category" text,"Nominee" text,"Result" text)
SELECT "Year" FROM table_41383 WHERE "Category" = 'best costume design'
What is Score when Team is @ Kansas City-Omaha Kings?
CREATE TABLE table_48522 ("Game" real,"Date" text,"Team" text,"Score" text,"Record" text,"Streak" text)
SELECT "Score" FROM table_48522 WHERE "Team" = '@ kansas city-omaha kings'
How many ansi codes are there for latitude 48.142938?
CREATE TABLE table_18600760_20 (ansi_code VARCHAR,latitude VARCHAR)
SELECT COUNT(ansi_code) FROM table_18600760_20 WHERE latitude = "48.142938"
What is the name of call sign that uses a Frequency MHz of 91.1 fm?
CREATE TABLE table_67337 ("Call sign" text,"Frequency MHz" text,"City of license" text,"ERP W" real,"Class" text,"FCC info" text)
SELECT "Call sign" FROM table_67337 WHERE "Frequency MHz" = '91.1 fm'
Which date featured the Boston Patriots as the opponent?
CREATE TABLE table_name_96 (date VARCHAR,opponent VARCHAR)
SELECT date FROM table_name_96 WHERE opponent = "boston patriots"
In the Phoenix Open, what was the winning score?
CREATE TABLE table_40834 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Winning score" FROM table_40834 WHERE "Tournament" = 'phoenix open'
Which rec has Yards of 192, and a Touchdown smaller than 1?
CREATE TABLE table_name_52 (rec INTEGER,yards VARCHAR,s_touchdown VARCHAR)
SELECT AVG(rec) FROM table_name_52 WHERE yards = 192 AND s_touchdown < 1
did any phenytoin (suspension) ever been prescribed to patient 77980 until 4 years ago?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77980) AND prescriptions.drug = 'phenytoin (suspension)' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')
Before ANTHRCUL 461 , which courses do I need to take ?
CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
how many years was shodiev the top scorer ?
CREATE TABLE table_204_357 (id number,"year" number,"div." text,"pos." text,"cup" text,"top scorer (league)" text,"score" number)
SELECT COUNT("year") FROM table_204_357 WHERE "top scorer (league)" = 'vokhid shodiev'
Find all movies written and produced by ' Woody Allen
CREATE TABLE actor (aid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE writer (wid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE director (did int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE movie (mi...
SELECT movie.title FROM made_by, movie, producer, writer, written_by WHERE movie.mid = made_by.msid AND producer.name = 'Woody Allen' AND producer.pid = made_by.pid AND writer.name = 'Woody Allen' AND written_by.msid = movie.mid AND written_by.wid = writer.wid
What district had elections in 1964?
CREATE TABLE table_1341568_14 (district VARCHAR,elected VARCHAR)
SELECT district FROM table_1341568_14 WHERE elected = 1964
Show the proportion of each party in a pie chart.
CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,Co...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
give me the number of patients whose insurance is medicare and diagnoses long title is body mass index less than 19, adult?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.long_title = "Body Mass Index less than 19, adult"
alt and / or ast levels that are twice the upper limit of normal; bilirubin levels that exceed 2 mg / dl; serum creatinine > 1.5 mg / dl in male or > 1.4 mg / dl in female .
CREATE TABLE table_train_130 ("id" int,"gender" string,"systolic_blood_pressure_sbp" int,"right_bundle_branch_block" bool,"space_occupying_cerebral_lesion" bool,"huntington_disease" bool,"psychiatric_disease" bool,"mental_illness" bool,"treatment_regimen" bool,"psychotic_disorder" bool,"diastolic_blood_pressure_dbp" in...
SELECT * FROM table_train_130 WHERE bilirubin > 2 OR ((gender = 'male' AND serum_creatinine > 1.5) OR (gender = 'female' AND serum_creatinine > 1.4))
Name the total number of index weighting % at 17 january 2013 for bouygues
CREATE TABLE table_168274_1 (index_weighting___percentage__at_17_january_2013 VARCHAR,company VARCHAR)
SELECT COUNT(index_weighting___percentage__at_17_january_2013) FROM table_168274_1 WHERE company = "Bouygues"
How many of the patients with parent infus nutrit sub were transferred to a cancer/children hospital?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Parent infus nutrit sub"
A pie chart about how many male and female assistant professors do we have?
CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)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 Participates_in (stuid INTEG...
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex
Who are the opponents in the February 19, 1996 final?
CREATE TABLE table_64088 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text)
SELECT "Opponents in the final" FROM table_64088 WHERE "Date" = 'february 19, 1996'
What is the total when the A score was less than 6.6, and the B score was 8.925?
CREATE TABLE table_63202 ("Position" real,"Gymnast" text,"A score" real,"B score" real,"Total" real)
SELECT "Total" FROM table_63202 WHERE "A score" < '6.6' AND "B score" = '8.925'
Who was the artist for the origin Shake it, Europe?
CREATE TABLE table_23066 ("Draw" real,"Artist" text,"Original" text,"English Meaning" text,"Language" text,"Authors" text)
SELECT "Artist" FROM table_23066 WHERE "Original" = 'Shake It, Europe'
Can you tell me the Player that has the Country of united states, and the Score of 77-72-72=221?
CREATE TABLE table_46991 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real)
SELECT "Player" FROM table_46991 WHERE "Country" = 'united states' AND "Score" = '77-72-72=221'
What was the record when they played golden state?
CREATE TABLE table_23274514_9 (record VARCHAR,team VARCHAR)
SELECT record FROM table_23274514_9 WHERE team = "Golden State"
Who did the Trail Blazers play on January 2?
CREATE TABLE table_17058178_8 (team VARCHAR,date VARCHAR)
SELECT team FROM table_17058178_8 WHERE date = "January 2"
When marshmallow cookies is segment b what episode is it on netflix?
CREATE TABLE table_15187735_5 (netflix VARCHAR,segment_b VARCHAR)
SELECT netflix FROM table_15187735_5 WHERE segment_b = "Marshmallow Cookies"
Who is the head coach for the score of 4-3?
CREATE TABLE table_22165661_3 (head_coach VARCHAR,score VARCHAR)
SELECT head_coach FROM table_22165661_3 WHERE score = "4-3"
What is the highest to par with a place of t8 and West Germany as the country?
CREATE TABLE table_name_37 (to_par INTEGER,place VARCHAR,country VARCHAR)
SELECT MAX(to_par) FROM table_name_37 WHERE place = "t8" AND country = "west germany"
What are the names and number of hours spent training for each player who trains for less than 1500 hours Visualize by bar chart, rank y axis in descending order.
CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))
SELECT pName, HS FROM Player WHERE HS < 1500 ORDER BY HS DESC
Show me a bar chart for what are the ids and trade names of the medicine that can interact with at least 3 enzymes?, sort y-axis in desc order.
CREATE TABLE enzyme (id int,name text,Location text,Product text,Chromosome text,OMIM int,Porphyria text)CREATE TABLE medicine_enzyme_interaction (enzyme_id int,medicine_id int,interaction_type text)CREATE TABLE medicine (id int,name text,Trade_Name text,FDA_approved text)
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC
What is the percentage of down voting users?.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Review...
WITH DownVoterCount AS (SELECT DownVoterCount = CAST(COUNT(*) AS FLOAT) FROM Users WHERE Users.DownVotes > 0), UserCount AS (SELECT UserCount = CAST(COUNT(*) AS FLOAT) FROM Users), DownVoterPercentage AS (SELECT ROUND(((SELECT DownVoterCount FROM DownVoterCount) / (SELECT UserCount FROM UserCount)) * 100, 2) AS DownVot...
what is the daily maximum value of patient 017-83812's o2 sat (%) in 2105?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientun...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-83812')) AND lab.labname = 'o2 sat (%)' AND STRFTIME('%y', lab.labresulttime) ...
Which Points have an Opponent of calgary flames, and a January larger than 22?
CREATE TABLE table_name_90 (points INTEGER,opponent VARCHAR,january VARCHAR)
SELECT AVG(points) FROM table_name_90 WHERE opponent = "calgary flames" AND january > 22
give me the number of patients whose diagnoses long title is other chronic pain and lab test abnormal status is abnormal?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other chronic pain" AND lab.flag = "abnormal"
provide the number of patients whose marital status is divorced and lab test name is ph?
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 lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "pH"
Name the hits for years before 1883
CREATE TABLE table_name_86 (hits VARCHAR,year INTEGER)
SELECT hits FROM table_name_86 WHERE year < 1883
what is the organisation when the nominated work title is n/a in the year 2005?
CREATE TABLE table_51486 ("Year" real,"Organisation" text,"Award" text,"Nominated Work Title" text,"Result" text)
SELECT "Organisation" FROM table_51486 WHERE "Nominated Work Title" = 'n/a' AND "Year" = '2005'
what was the average daily number of patients who were diagnosed with platelet dysfunction until 2104?
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 AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'platelet dysfunction' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
on 11 23 what flights are available between BOSTON and DENVER
CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 11 AND d...
subjects with history of stroke , aneurysm, or cranial neurosurgery
CREATE TABLE table_train_138 ("id" int,"mini_mental_state_examination_mmse" int,"stroke" bool,"body_weight" float,"cranial_neurosurgery" bool,"first_degree_relative" bool,"seizure_disorder" bool,"alcohol_abuse" bool,"body_mass_index_bmi" float,"aneurysm" bool,"NOUSE" float)
SELECT * FROM table_train_138 WHERE stroke = 1 OR aneurysm = 1 OR cranial_neurosurgery = 1
What method was used in the match that went to round 1, and had a 6-3-1 record?
CREATE TABLE table_50135 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Method" FROM table_50135 WHERE "Round" = '1' AND "Record" = '6-3-1'
how many days have it been since patient 006-195316's last prescription of furosemide 40 mg tab in the 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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195...
what is the total number of lord of the rings games released since 1982 ?
CREATE TABLE table_204_398 (id number,"title" text,"year" number,"publisher" text,"developer" text,"platforms" text)
SELECT COUNT("title") FROM table_204_398 WHERE "year" > 1982
List the name for storms and the number of affected regions for each storm with a bar chart.
CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
Count the number of patients who stayed in room 112.
CREATE TABLE trained_in (physician number,treatment number,certificationdate time,certificationexpires time)CREATE TABLE patient (ssn number,name text,address text,phone text,insuranceid number,pcp number)CREATE TABLE nurse (employeeid number,name text,position text,registered boolean,ssn number)CREATE TABLE undergoes ...
SELECT COUNT(patient) FROM stay WHERE room = 112
What are the wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart, rank total number from low to high order.
CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name)