instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is every district for incumbent Joseph Desha? | CREATE TABLE table_28913 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text) | SELECT "District" FROM table_28913 WHERE "Incumbent" = 'Joseph Desha' |
provide the number of patients whose age is less than 56 and procedure icd9 code is 3533? | 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.age < "56" AND procedures.icd9_code = "3533" |
What is the position with a neutral H/A/N and more than 2 innings? | CREATE TABLE table_61518 ("Score" text,"Pos." real,"Inn." real,"Venue" text,"H/A/N" text) | SELECT AVG("Pos.") FROM table_61518 WHERE "H/A/N" = 'neutral' AND "Inn." > '2' |
what is the c (nf/km) when the l (mh/km) is 0.6099? | CREATE TABLE table_261642_3 (c__nf_km_ VARCHAR,l__mh_km_ VARCHAR) | SELECT c__nf_km_ FROM table_261642_3 WHERE l__mh_km_ = "0.6099" |
list the monthly minimum heartrate value of patient 030-67523. | 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 MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-67523')) AND NOT vitalperiodic.heartrate IS NULL... |
What round is highest and has a defensive tackle position and overall lower than 282? | CREATE TABLE table_4862 ("Round" real,"Overall" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT MAX("Round") FROM table_4862 WHERE "Position" = 'defensive tackle' AND "Overall" < '282' |
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a bar chart | CREATE TABLE Customers (customer_id INTEGER,coupon_id INTEGER,good_or_bad_customer VARCHAR(4),first_name VARCHAR(80),last_name VARCHAR(80),gender_mf VARCHAR(1),date_became_customer DATETIME,date_last_hire DATETIME)CREATE TABLE View_Product_Availability (product_id INTEGER,booking_id INTEGER,status_date DATETIME,availab... | SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' |
what are the top four most frequent diagnoses which patients were given in the same hospital visit after undergoing treatment of hypernatremia since 2104? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'treat... |
What is the most lost games for the team with a difference smaller than 86 and points of 32? | CREATE TABLE table_77959 ("Team" text,"Played" real,"Drew" real,"Lost" real,"Against" real,"Difference" real,"Points" real) | SELECT MAX("Lost") FROM table_77959 WHERE "Points" = '32' AND "Difference" < '86' |
What country won in 2004? | CREATE TABLE table_8551 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT "Country" FROM table_8551 WHERE "Year(s) won" = '2004' |
Votes: DownVote to UpVote Ratio. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostLinks (Id number,Creatio... | SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(CAST(UpVotes AS FLOAT) / DownVotes, 1) AS Ratio FROM Users WHERE Reputation > 250 AND DownVotes > 0 ORDER BY Ratio DESC LIMIT 50 |
Posts by day of the week. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,Tag... | SELECT TIME_TO_STR(CreationDate, '%W') AS D, COUNT(*) AS Posts FROM Posts GROUP BY TIME_TO_STR(CreationDate, '%A'), TIME_TO_STR(CreationDate, '%W') ORDER BY D |
Show me the total number by category in a histogram | CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID int)CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date t... | SELECT Category, COUNT(*) FROM music_festival GROUP BY Category |
What candidates ran in the election that included john shelley? | CREATE TABLE table_1341973_6 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_1341973_6 WHERE incumbent = "John Shelley" |
what is the monthly minimum amount of output (ml)-chest tube #1 mediastinal right lower;anterior that patient 031-22988 had until 11/2105? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs... | SELECT MIN(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 = '031-22988')) AND intakeoutput.celllabel = 'outpu... |
what was the length , in years , of leslie combs ' term ? | CREATE TABLE table_203_778 (id number,"representative" text,"title" text,"presentation\nof credentials" text,"termination\nof mission" text,"appointed by" text) | SELECT "termination\nof mission" - "presentation\nof credentials" FROM table_203_778 WHERE "representative" = 'leslie combs' |
Which Opposing Team has an Against smaller than 19, and a Date of 20/05/1979? | CREATE TABLE table_name_34 (opposing_team VARCHAR,against VARCHAR,date VARCHAR) | SELECT opposing_team FROM table_name_34 WHERE against < 19 AND date = "20/05/1979" |
How many clubs have total medals less than 10? | CREATE TABLE competition_result (competition_id number,club_id_1 number,club_id_2 number,score text)CREATE TABLE club_rank (rank number,club_id number,gold number,silver number,bronze number,total number)CREATE TABLE player (player_id number,name text,position text,club_id number,apps number,tries number,goals text,poi... | SELECT COUNT(*) FROM club_rank WHERE total < 10 |
On what Week was the Detroit Lions the Opponent? | CREATE TABLE table_34368 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real) | SELECT "Week" FROM table_34368 WHERE "Opponent" = 'detroit lions' |
Which workshop groups have bookings with status code 'stop'? Give me the names, and count them by a pie chart | CREATE TABLE Order_Items (Order_Item_ID INTEGER,Order_ID INTEGER,Product_ID INTEGER,Order_Quantity VARCHAR(288),Other_Item_Details VARCHAR(255))CREATE TABLE Invoices (Invoice_ID INTEGER,Order_ID INTEGER,payment_method_code CHAR(15),Product_ID INTEGER,Order_Quantity VARCHAR(288),Other_Item_Details VARCHAR(255),Order_Ite... | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name |
what is the total minimum cost of a hospital that includes a anion gap lab test since 5 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number... | SELECT MIN(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 lab.patientunitstayid FROM lab WHERE lab.labname = 'anion gap')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(... |
Which Outcome has a Surface of clay, and a Tournament of morocco f5, rabat , morocco? | CREATE TABLE table_name_79 (outcome VARCHAR,surface VARCHAR,tournament VARCHAR) | SELECT outcome FROM table_name_79 WHERE surface = "clay" AND tournament = "morocco f5, rabat , morocco" |
Which country is the athlete latt shwe zin with notes of sc/d from? | CREATE TABLE table_65158 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT "Country" FROM table_65158 WHERE "Notes" = 'sc/d' AND "Athlete" = 'latt shwe zin' |
What is the total number of Points with Wins larger than 0, a Position of 12th, and Poles larger than 0? | CREATE TABLE table_58631 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"Podiums" real,"Points" real,"Position" text) | SELECT SUM("Points") FROM table_58631 WHERE "Wins" > '0' AND "Position" = '12th' AND "Poles" > '0' |
What is the location of the station at Huntingdonshire with a station number of c17? | CREATE TABLE table_name_85 (location VARCHAR,district VARCHAR,station_number VARCHAR) | SELECT location FROM table_name_85 WHERE district = "huntingdonshire" AND station_number = "c17" |
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, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time, and order Y-axis in asc order. | 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, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) |
solid tumor with on going chemotherapy or radiotherapy | CREATE TABLE table_train_60 ("id" int,"corticosteroid_therapy" bool,"radiotherapy" bool,"immune_suppression" bool,"hiv_infection" bool,"cd4_count" int,"sargramostim" bool,"chemotherapy" bool,"immune_deficiency_disorder" bool,"tumor" bool,"receiving_prednisolone" int,"NOUSE" float) | SELECT * FROM table_train_60 WHERE tumor = 1 AND (chemotherapy = 1 OR radiotherapy = 1) |
What is the name when there are more than 161,219 electorates in 2009 and a constituency of 165? | CREATE TABLE table_66210 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT "Name" FROM table_66210 WHERE "Number of electorates (2009)" > '161,219' AND "Constituency number" = '165' |
what is the monthly minimum amount of vancomycin - random patient 030-47098 has until 08/2102? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientuni... | SELECT MIN(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 = '030-47098')) AND lab.labname = 'vancomycin - random' AND STRFTIME('%y-%m', lab.lab... |
Which run 2 with final of 5:24.47? | CREATE TABLE table_name_18 (run_2 VARCHAR,final VARCHAR) | SELECT run_2 FROM table_name_18 WHERE final = "5:24.47" |
how many patients with primary disease angioedema were born before 2076? | 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 = "ANGIOEDEMA" AND demographic.dob_year < "2076" |
Which player has less than 201 games, is ranked 2, and played between 2007-2012? | CREATE TABLE table_name_74 (player VARCHAR,years VARCHAR,games VARCHAR,rank VARCHAR) | SELECT player FROM table_name_74 WHERE games < 201 AND rank = 2 AND years = "2007-2012" |
what's the party with candidates jerry weller (r) 51.77% clem balanoff (d) 48.23% | CREATE TABLE table_18188 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text) | SELECT "Party" FROM table_18188 WHERE "Candidates" = 'Jerry Weller (R) 51.77% Clem Balanoff (D) 48.23%' |
Which score has a save of Smith (25)? | CREATE TABLE table_name_47 (score VARCHAR,save VARCHAR) | SELECT score FROM table_name_47 WHERE save = "smith (25)" |
What is the average rating star for each reviewer? | CREATE TABLE Reviewer (name VARCHAR,rID VARCHAR)CREATE TABLE Rating (stars INTEGER,rID VARCHAR) | SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name |
How many for percentages are there when the against percentage is 35,782 (69)? | CREATE TABLE table_1289762_1 (for___percentage_ VARCHAR,against___percentage_ VARCHAR) | SELECT for___percentage_ FROM table_1289762_1 WHERE against___percentage_ = "35,782 (69)" |
What time period had appearances of 219? | CREATE TABLE table_26944 ("Name" text,"Position" text,"Period" text,"Appearances\u00b9" real,"Goals\u00b9" real,"Nationality\u00b2" text) | SELECT "Period" FROM table_26944 WHERE "Appearances\u00b9" = '219' |
How many characteristics does the product named 'laurel' have? | CREATE TABLE product_characteristics (product_id VARCHAR,characteristic_id VARCHAR)CREATE TABLE products (product_id VARCHAR,product_name VARCHAR)CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR) | SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel" |
What Season, when Country is China, when Team is Dalian Shide, and when Goals are 0? | CREATE TABLE table_42659 ("Season" text,"Team" text,"Country" text,"Division" real,"Apps" real,"Goals" real) | SELECT "Season" FROM table_42659 WHERE "Country" = 'china' AND "Team" = 'dalian shide' AND "Goals" = '0' |
let me know the number of emergency hospital admission patients who have docusate sodium prescription. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Docusate Sodium" |
What champion has 1981 as the year? | CREATE TABLE table_67991 ("Year" text,"Date Final" text,"Venue" text,"Prize Money" text,"Champion" text,"Runner-up" text,"Score in final" text,"Commercial name" text) | SELECT "Champion" FROM table_67991 WHERE "Year" = '1981' |
What is the final score of the runner-up on 9 February 1992? | CREATE TABLE table_name_75 (score_in_final VARCHAR,outcome VARCHAR,date VARCHAR) | SELECT score_in_final FROM table_name_75 WHERE outcome = "runner-up" AND date = "9 february 1992" |
did there exist any microbiological tests for patient 1114's sputum since 11/2105? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttim... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2105-11' |
Which games had Philadelphia as home team? | CREATE TABLE table_75335 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Game" FROM table_75335 WHERE "Home Team" = 'philadelphia' |
What was jerry bohlander's time? | CREATE TABLE table_name_33 (time VARCHAR,opponent VARCHAR) | SELECT time FROM table_name_33 WHERE opponent = "jerry bohlander" |
What is the average value for Wins, when South West DFL is 'Coleraine', and when Byes is greater than 0? | CREATE TABLE table_12643 ("South West DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT AVG("Wins") FROM table_12643 WHERE "South West DFL" = 'coleraine' AND "Byes" > '0' |
What Representative has a Presentation of Credentails of April 10, 1855? | CREATE TABLE table_80069 ("Representative" text,"Title" text,"Presentation of Credentials" text,"Termination of Mission" text,"Appointed by" text) | SELECT "Representative" FROM table_80069 WHERE "Presentation of Credentials" = 'april 10, 1855' |
What week was the record 0-5? | CREATE TABLE table_53508 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text) | SELECT "Week" FROM table_53508 WHERE "Record" = '0-5' |
List the name of all products along with the number of complaints that they have received. | CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,product_category_code VARCHAR(20),date_product_first_available DATETIME,date_product_discontinued DATETIME,product_name VARCHAR(80),product_description VARCHAR(255),product_price DECIMAL(19,4))CREATE TABLE Complaints (complaint_id INTEGER,product_id IN... | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name |
Tell me the School/Club team of the player from the United States that play'de guard? | CREATE TABLE table_58425 ("Player" text,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_58425 WHERE "Nationality" = 'united states' AND "Position" = 'guard' |
how many patients whose ethnicity is black/cape verdean and procedure icd9 code is 8960? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "8960" |
I want to see trend the total number over year by semester | CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),grade varchar(2))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE student (ID v... | SELECT year, COUNT(*) FROM section GROUP BY semester, year |
What COSPAR ID has a Launch date/time (UTC) of 1995-11-06, 05:15:01? | CREATE TABLE table_name_40 (cospar_id VARCHAR,launch_date_time__utc_ VARCHAR) | SELECT cospar_id FROM table_name_40 WHERE launch_date_time__utc_ = "1995-11-06, 05:15:01" |
give me all nonstops from NEW YORK to LAS VEGAS that arrive on a SUNDAY | CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,t... | 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, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'SATURDAY' AND flight.fli... |
what was the first time a drug was prescribed for patient 32153 in the current hospital encounter? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE chartevents (row_id number,s... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate LIMIT 1 |
find the route of administration and name of medication with drug code epo2l. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "EPO2I" |
who was the only other besides david duval in the t2 category ? | CREATE TABLE table_203_230 (id number,"place" text,"player" text,"country" text,"score" text,"to par" number) | SELECT "player" FROM table_203_230 WHERE "player" <> 'david duval' AND "place" = 't2' |
What is the capacity of the mine that is operated by Cyprus Amax minerals? | CREATE TABLE table_name_83 (capacity__thousands_of_metric_tons_ VARCHAR,operator VARCHAR) | SELECT capacity__thousands_of_metric_tons_ FROM table_name_83 WHERE operator = "cyprus amax minerals" |
for the ben williams name what was the previous club | CREATE TABLE table_27998152_1 (previous_club VARCHAR,name VARCHAR) | SELECT previous_club FROM table_27998152_1 WHERE name = "Ben Williams" |
What location has October 10 as date? | CREATE TABLE table_name_64 (location VARCHAR,date VARCHAR) | SELECT location FROM table_name_64 WHERE date = "october 10" |
Find all the campuses opened in 1958. | CREATE TABLE campuses (campus VARCHAR,YEAR VARCHAR) | SELECT campus FROM campuses WHERE YEAR = 1958 |
What is Metro's win percentage? | CREATE TABLE table_31633 ("Conference" text,"# of Bids" real,"Record" text,"Win %" text,"Round of 32" text,"Elite Eight" text,"Final Four" text,"Championship Game" text) | SELECT "Win %" FROM table_31633 WHERE "Conference" = 'metro' |
Name the number of builders for number 96 | CREATE TABLE table_1748444_1 (builder VARCHAR,number VARCHAR) | SELECT COUNT(builder) FROM table_1748444_1 WHERE number = "96" |
For those products with a price between 60 and 120, draw a bar chart about the distribution of name and code , and display by the names in ascending. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name |
what has changed in hct in patient 007-7646 last measured on the last hospital visit compared to the value first measured on the last hospital visit? | 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 (SELECT 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 = '007-7646' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... |
How many goals have more than 38 played and more than 9 draws? | CREATE TABLE table_name_5 (goals_for INTEGER,draws VARCHAR,played VARCHAR) | SELECT SUM(goals_for) FROM table_name_5 WHERE draws > 9 AND played > 38 |
born on 1983-03-14, what is the cb's name? | CREATE TABLE table_name_28 (name VARCHAR,pos VARCHAR,date_of_birth VARCHAR) | SELECT name FROM table_name_28 WHERE pos = "cb" AND date_of_birth = "1983-03-14" |
Give me a histogram for what are the names of the technicians and how many machines are they assigned to repair? | CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair (... | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name |
which team had the most fourth place finishes ? | CREATE TABLE table_203_502 (id number,"team" text,"titles" number,"runner-up" number,"third place" number,"fourth place" number,"years participated" number) | SELECT "team" FROM table_203_502 ORDER BY "fourth place" DESC LIMIT 1 |
count the number of patients whose admission type is elective and who were given the drug tramadol (ultram). | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "TraMADOL (Ultram)" |
what's the daily minimum dose of ivpb for patient 035-19333 in 02/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 treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT MIN(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 = '035-19333')) AND intakeoutput.celllabel = 'ivpb'... |
what is the record for date december 11? | CREATE TABLE table_27756314_7 (record VARCHAR,date VARCHAR) | SELECT record FROM table_27756314_7 WHERE date = "December 11" |
what was the total amount of evd output (ml)-icp/external ventricular drain (evd) right ventriculostomy-output patient 021-198501 had on the last intensive care unit visit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,... | 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 = '021-198501') AND NOT patient.unitdischargetime I... |
What is the NHL team of dave murphy? | CREATE TABLE table_name_29 (nhl_team VARCHAR,player VARCHAR) | SELECT nhl_team FROM table_name_29 WHERE player = "dave murphy" |
What is the largest number in L? | CREATE TABLE table_29565601_2 (l INTEGER) | SELECT MAX(l) FROM table_29565601_2 |
Draw a bar chart about the distribution of Time and meter_100 , and could you order by the X in descending? | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu... | SELECT Time, meter_100 FROM swimmer ORDER BY Time DESC |
What was the result in week 14? | CREATE TABLE table_name_77 (result VARCHAR,week VARCHAR) | SELECT result FROM table_name_77 WHERE week = 14 |
What was the method of execution on September 24, 1830? | CREATE TABLE table_name_6 (method VARCHAR,date_of_execution VARCHAR) | SELECT method FROM table_name_6 WHERE date_of_execution = "september 24, 1830" |
all right would you let me know type of aircraft UA is using on the flights from DENVER to SAN FRANCISCO i would like to know the type of aircraft that they use on these flights before 1000 in the morning | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name va... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1000 AND ... |
find the number of different programs that are broadcast during night time. | CREATE TABLE broadcast (program_id VARCHAR,time_of_day VARCHAR) | SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night' |
Where did the west indies batting team play at? | CREATE TABLE table_8804 ("Runs" text,"Wicket" text,"Batting partners" text,"Batting team" text,"Fielding team" text,"Venue" text,"Season" text) | SELECT "Venue" FROM table_8804 WHERE "Batting team" = 'west indies' |
Show the number of male and female assistant professors. Plot them as bar chart. | CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),... | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex |
wrestler junior fatu was eliminated by a total of how many wrestlers ? | CREATE TABLE table_203_277 (id number,"entered" number,"wrestler" text,"place" text,"eliminated by" text,"time" text) | SELECT "eliminated by" FROM table_203_277 WHERE "wrestler" = 'junior fatu' |
What is the number of countries in the artist table?, I want to rank by the y-axis in ascending. | CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int) | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country) |
what is the least enrollment when founded after 1809 and the institution is university of michigan? | CREATE TABLE table_9439 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Team Nickname" text) | SELECT MIN("Enrollment") FROM table_9439 WHERE "Founded" > '1809' AND "Institution" = 'university of michigan' |
What is the highest number of bronzes for countries ranking over 5 with 0 golds? | CREATE TABLE table_name_74 (bronze INTEGER,rank VARCHAR,gold VARCHAR) | SELECT MAX(bronze) FROM table_name_74 WHERE rank > 5 AND gold < 0 |
Which district shows a first elected of 1980? | CREATE TABLE table_18278 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "District" FROM table_18278 WHERE "First elected" = '1980' |
please list any flights from OAKLAND california to PHILADELPHIA on tuesday | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 22 AND date_day.month_number = 3 ... |
when did patient 14413 take an intake for the last time on the last icu visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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,va... | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14413) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) ORDER BY inpu... |
What is the total amount of money that has a t2 place, is from the United States for player Leo Diegel? | CREATE TABLE table_name_49 (money___ VARCHAR,player VARCHAR,place VARCHAR,country VARCHAR) | SELECT COUNT(money___) AS $__ FROM table_name_49 WHERE place = "t2" AND country = "united states" AND player = "leo diegel" |
how much was patient 24364's hospital bill for her stay until 3 years ago? | 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 transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREA... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24364) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-3 year') |
What is Alexandr Elke's Weight? | CREATE TABLE table_59871 ("Name" text,"Pos." text,"Height" text,"Weight" text,"Date of Birth" text,"Club" text) | SELECT "Weight" FROM table_59871 WHERE "Name" = 'alexandr elke' |
What is the lowest population in a county with market income per capita of $24,383? | CREATE TABLE table_25336 ("County" text,"Population" real,"Unemployment Rate" text,"Market Income Per Capita" text,"Poverty Rate" text,"Status" text) | SELECT MIN("Population") FROM table_25336 WHERE "Market Income Per Capita" = '$24,383' |
Which class is the easiest that can fulfill the MDE requirement ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_pre... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... |
How many different circuits had Gary Gibson has the Lites 1 race two winning team? | CREATE TABLE table_28831 ("Rnd" real,"Circuit" text,"Lites 1 Race One Winning Team" text,"Lites 2 Race One Winning Team" text,"Lites 1 Race Two Winning Team" text,"Lites 2 Race Two Winning Team" text) | SELECT COUNT("Lites 2 Race One Winning Team") FROM table_28831 WHERE "Lites 1 Race Two Winning Team" = 'Gary Gibson' |
how many patients are diagnosed for infectious mononucleosis and base drug type? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Infectious mononucleosis" AND prescriptions.drug_type = "BASE" |
how many patients stay this year in careunit csru? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
is the level of heart rate in patient 9241 second measured on the last intensive care unit visit less than the value first measured on the last intensive care unit visit? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE icus... | 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 = 9241) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.... |
What was the 1st Year Al Harrington (9) the leader in Rebounds? | CREATE TABLE table_70772 ("Year" real,"Points" text,"Rebounds" text,"Assists" text,"Steals" text,"Blocks" text) | SELECT MIN("Year") FROM table_70772 WHERE "Rebounds" = 'al harrington (9)' |
How many times did jim vivona win? | CREATE TABLE table_name_2 (win__number VARCHAR,winner VARCHAR) | SELECT COUNT(win__number) FROM table_name_2 WHERE winner = "jim vivona" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.