instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what is the venue where the margin is 4?
CREATE TABLE table_16704 ("Year" real,"Winners" text,"Grand Finalist" text,"Scores" text,"Venue" text,"Crowd" real,"Margin" real,"Season Result" text)
SELECT "Venue" FROM table_16704 WHERE "Margin" = '4'
How many grids are associated with a Time/Retired of +1.837?
CREATE TABLE table_name_87 (grid VARCHAR,time_retired VARCHAR)
SELECT COUNT(grid) FROM table_name_87 WHERE time_retired = "+1.837"
Which website is in english and has the frequency of an online newspaper ?
CREATE TABLE table_name_77 (website VARCHAR,language VARCHAR,frequency VARCHAR)
SELECT website FROM table_name_77 WHERE language = "english" AND frequency = "online newspaper"
what is the rank when the player is henry shefflin and the matches is higher than 4?
CREATE TABLE table_name_9 (rank INTEGER,player VARCHAR,matches VARCHAR)
SELECT SUM(rank) FROM table_name_9 WHERE player = "henry shefflin" AND matches > 4
How many totals does cork have whose rank is larger than 2?
CREATE TABLE table_name_27 (total INTEGER,county VARCHAR,rank VARCHAR)
SELECT SUM(total) FROM table_name_27 WHERE county = "cork" AND rank > 2
keywords in the papers written by lorenzo bruzzone
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABL...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'lorenzo bruzzone' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.
CREATE TABLE employees (first_name VARCHAR,last_name VARCHAR,hire_date VARCHAR,salary VARCHAR,department_id VARCHAR)
SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'
Find the number of scientists involved for each project name, and display by the y-axis in ascending.
CREATE TABLE Scientists (SSN int,Name Char(30))CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*)
How many rounds in the event when record is 1-5?
CREATE TABLE table_47506 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text)
SELECT COUNT("Round") FROM table_47506 WHERE "Record" = '1-5'
provide the number of patients whose gender is f and admission type is urgent?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "URGENT"
What is the 2007 value with a 2r in 2012 and 1r in 2002?
CREATE TABLE table_68056 ("Tournament" text,"1999" text,"2002" text,"2004" text,"2006" text,"2007" text,"2010" text,"2011" text,"2012" text)
SELECT "2007" FROM table_68056 WHERE "2012" = '2r' AND "2002" = '1r'
what is the transfer fee for evilasio?
CREATE TABLE table_name_60 (transfer_fee VARCHAR,name VARCHAR)
SELECT transfer_fee FROM table_name_60 WHERE name = "evilasio"
Count the total number of different locations of parties using a pie chart.
CREATE TABLE party_host (Party_ID int,Host_ID int,Is_Main_in_Charge bool)CREATE TABLE host (Host_ID int,Name text,Nationality text,Age text)CREATE TABLE party (Party_ID int,Party_Theme text,Location text,First_year text,Last_year text,Number_of_hosts int)
SELECT Location, COUNT(Location) FROM party GROUP BY Location
There are communities listed that a percentage larger than 7.6 in 2001, but none of them has 2 seats listed in 2006.
CREATE TABLE table_11295 ("Parties and voter communities" text,"% 2006" real,"Seats 2006" real,"% 2001" real,"Seats 2001" real)
SELECT SUM("Seats 2001") FROM table_11295 WHERE "Seats 2006" = '2' AND "% 2001" > '7.6'
How many followers does each user have?
CREATE TABLE user_profiles (uid number,name text,email text,partitionid number,followers number)CREATE TABLE tweets (id number,uid number,text text,createdate time)CREATE TABLE follows (f1 number,f2 number)
SELECT COUNT(*) FROM follows
what is the title of the episode with the production code of ad1a22?
CREATE TABLE table_name_1 (title VARCHAR,production_code VARCHAR)
SELECT title FROM table_name_1 WHERE production_code = "ad1a22"
the number of times that patient 594 had taken tpn d5.0 on 05/02/this year.
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 tex...
SELECT COUNT(*) 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 = 594)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d5.0' AND ...
What is the Date of the Competition with a Score of 1 2?
CREATE TABLE table_name_85 (date VARCHAR,score VARCHAR)
SELECT date FROM table_name_85 WHERE score = "1–2"
hypertension ( blood pressure > 160 / 100 mm / hg at screening or day of study visit
CREATE TABLE table_train_181 ("id" int,"systolic_blood_pressure_sbp" int,"fasting_plasma_glucose_fpg" float,"hemoglobin_a1c_hba1c" float,"hepatitis_c" bool,"hepatitis_b" bool,"exposure_to_hiv" bool,"diastolic_blood_pressure_dbp" int,"hypertension" bool,"NOUSE" float)
SELECT * FROM table_train_181 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100
how many patients are diagnosed with bronchoscopy?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Other bronchoscopy"
What was the Score for T9 United States Player Kirk Triplett?
CREATE TABLE table_name_14 (score VARCHAR,player VARCHAR,place VARCHAR,country VARCHAR)
SELECT score FROM table_name_14 WHERE place = "t9" AND country = "united states" AND player = "kirk triplett"
what would be the maximum daily number of patients diagnosed with valve repair < 7 days - aortic in 2105?
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 MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'valve repair < 7 days - aortic' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
what is the position for andrew paopao?
CREATE TABLE table_name_54 (position VARCHAR,player VARCHAR)
SELECT position FROM table_name_54 WHERE player = "andrew paopao"
the total number of times until 36 months ago patient 010-15363 has had a lab test for -eos.
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,p...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-15363')) AND lab.labname = '-eos' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TI...
What country were the athletes where ranked smaller than 5 with notes listed as fb?
CREATE TABLE table_name_67 (country VARCHAR,rank VARCHAR,notes VARCHAR)
SELECT country FROM table_name_67 WHERE rank < 5 AND notes = "fb"
What school has south bend as the location, with indians as the mascot?
CREATE TABLE table_79234 ("School" text,"Mascot" text,"Location" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"County" text)
SELECT "School" FROM table_79234 WHERE "Location" = 'south bend' AND "Mascot" = 'indians'
What time does the trainer, Todd Pletcher have?
CREATE TABLE table_49900 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text,"Time" text)
SELECT "Time" FROM table_49900 WHERE "Trainer" = 'todd pletcher'
Give me a histogram for what is the number of professors for different school?, list by the the total number in desc.
CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))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),...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
What city of license is associated with call sign w244bk?
CREATE TABLE table_58001 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text)
SELECT "City of license" FROM table_58001 WHERE "Call sign" = 'w244bk'
what is the result for October 14, 1956?
CREATE TABLE table_19766 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real)
SELECT "Result" FROM table_19766 WHERE "Date" = 'October 14, 1956'
which player has the most appearances with the club ?
CREATE TABLE table_204_421 (id number,"name" text,"nationality" text,"position" text,"spartak career" text,"appearances" number,"goals" number)
SELECT "name" FROM table_204_421 ORDER BY "appearances" DESC LIMIT 1
Who was the home team when the away team scored 14.21 (105)?
CREATE TABLE table_55437 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_55437 WHERE "Away team score" = '14.21 (105)'
2007 of 1r is involved in what 2001?
CREATE TABLE table_name_31 (Id VARCHAR)
SELECT 2001 FROM table_name_31 WHERE 2007 = "1r"
Which animal has a resting potential of 60?
CREATE TABLE table_name_75 (animal VARCHAR,resting_potential__mv_ VARCHAR)
SELECT animal FROM table_name_75 WHERE resting_potential__mv_ = "−60"
What was the largest crowd size at a South Melbourne home game?
CREATE TABLE table_name_5 (crowd INTEGER,home_team VARCHAR)
SELECT MAX(crowd) FROM table_name_5 WHERE home_team = "south melbourne"
What is the state Yi?
CREATE TABLE table_42716 ("State" text,"Type" text,"Name" text,"Title" text,"Royal house" text,"From" text)
SELECT "State" FROM table_42716 WHERE "Name" = 'yi'
Which station is operated by BBC Radio under the talk radio genre?
CREATE TABLE table_name_63 (station VARCHAR,genre VARCHAR,operator VARCHAR)
SELECT station FROM table_name_63 WHERE genre = "talk radio" AND operator = "bbc radio"
Which Debut year has Goals of 0, and Years at club of 1963, and Games larger than 5?
CREATE TABLE table_66505 ("Debut year" real,"Player" text,"Games" real,"Goals" real,"Years at club" text)
SELECT AVG("Debut year") FROM table_66505 WHERE "Goals" = '0' AND "Years at club" = '1963' AND "Games" > '5'
Where was the game held when the attendance was 56,770?
CREATE TABLE table_name_63 (game_site VARCHAR,attendance VARCHAR)
SELECT game_site FROM table_name_63 WHERE attendance = "56,770"
What is the affiliation of the University of Maryland?
CREATE TABLE table_name_54 (affiliation VARCHAR,school VARCHAR)
SELECT affiliation FROM table_name_54 WHERE school = "university of maryland"
What is the average Played, when Goals Against is less than 63, when Team is 'Nelson', and when Lost is greater than 16?
CREATE TABLE table_name_18 (played INTEGER,lost VARCHAR,goals_against VARCHAR,team VARCHAR)
SELECT AVG(played) FROM table_name_18 WHERE goals_against < 63 AND team = "nelson" AND lost > 16
Who was the opponent when the score was 6-3, 6-3?
CREATE TABLE table_36569 ("Outcome" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Opponent" FROM table_36569 WHERE "Score" = '6-3, 6-3'
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
CREATE TABLE mountain (mountain_id number,name text,height number,prominence number,range text,country text)CREATE TABLE climber (climber_id number,name text,country text,time text,points number,mountain_id number)
SELECT country FROM mountain WHERE height > 5600 INTERSECT SELECT country FROM mountain WHERE height < 5200
How many pole position achieved 0 points from Mexico?
CREATE TABLE table_29397 ("Name" text,"Nation" text,"Seasons" text,"Championship titles" text,"Races (Starts)" text,"Poles" real,"Wins" real,"Podiums" real,"Fastest Laps" real,"Points" text)
SELECT COUNT("Poles") FROM table_29397 WHERE "Points" = '0' AND "Nation" = 'Mexico'
How many different locations have the score 207 (-10)?
CREATE TABLE table_16914 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real)
SELECT COUNT("Location") FROM table_16914 WHERE "Score" = '207 (-10)'
what is the status in vestal
CREATE TABLE table_22171 ("Greek Designation" text,"Collegiate Institution" text,"Charter Date" text,"Status" text,"City" text,"U.S. State/District" text)
SELECT "Status" FROM table_22171 WHERE "City" = 'Vestal'
Who is the director of the game with HIroshi Sato as the producer on the GBA platform?
CREATE TABLE table_name_41 (director VARCHAR,producer VARCHAR,platform_s_ VARCHAR)
SELECT director FROM table_name_41 WHERE producer = "hiroshi sato" AND platform_s_ = "gba"
how many bosnian in cook islands is sri lankan
CREATE TABLE table_27115 ("Afghan" text,"Albanian" text,"Arabic" text,"Bangladeshi" text,"Bosnian" text,"Chinese" text,"Colombian" text,"Cook Islands" text)
SELECT "Bosnian" FROM table_27115 WHERE "Cook Islands" = 'Sri Lankan'
how many white patients were born before 2065?
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 WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2065"
What is the namesake of Ayashe at a longitude less than 270.7, latitude more than -47.1, and a diameter less than 7.2?
CREATE TABLE table_name_87 (named VARCHAR,name VARCHAR,diameter__km_ VARCHAR,longitude VARCHAR,latitude VARCHAR)
SELECT named AS after FROM table_name_87 WHERE longitude < 270.7 AND latitude > -47.1 AND diameter__km_ < 7.2 AND name = "ayashe"
What was Liu Limin's time in heat 4?
CREATE TABLE table_14699 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT "Time" FROM table_14699 WHERE "Heat" = '4' AND "Name" = 'liu limin'
What is Format, when Label is Bronze, when Date is 1982, and when Catalogue is 204 636?
CREATE TABLE table_47954 ("Date" text,"Region" text,"Label" text,"Catalogue" text,"Format" text)
SELECT "Format" FROM table_47954 WHERE "Label" = 'bronze' AND "Date" = '1982' AND "Catalogue" = '204 636'
When toronto is the hometown how many height measurements are there?
CREATE TABLE table_22510 ("Province,Community" text,"Contestant" text,"Age" real,"Height" text,"Hometown" text,"Geographical Regions" text)
SELECT COUNT("Height") FROM table_22510 WHERE "Hometown" = 'Toronto'
since 3 years ago, patient 88659 has been tested for rbc, pleural?
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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,ge...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, pleural') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-3 year'...
What's the English title listed that has an Original title of The Crying Game?
CREATE TABLE table_80058 ("Year" text,"English title" text,"Original title" text,"Country" text,"Director" text)
SELECT "English title" FROM table_80058 WHERE "Original title" = 'the crying game'
For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the job_id , and group by attribute job_id, and display total number from low to high order.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
what country has won no silver medals ?
CREATE TABLE table_203_497 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_497 WHERE "silver" = 0
in 2105, what are the top three most frequent treatments that patients were given in the same month after the diagnosis of post spinal surgery - thoracic?
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 t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'post spinal surgery - thoracic' AND STRF...
For a short scale of one quadrillion a thousand trillion, what is the Long scale?
CREATE TABLE table_45079 ("Number notation" real,"Power notation" text,"Short scale" text,"Long scale" text,"Indian (or South Asian) English" text)
SELECT "Long scale" FROM table_45079 WHERE "Short scale" = 'one quadrillion a thousand trillion'
What was the total number of rebounds on november 27?
CREATE TABLE table_25365 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("High rebounds") FROM table_25365 WHERE "Date" = 'November 27'
What is the region for Catalog amlh 66078 in stereo lp format?
CREATE TABLE table_14779 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Region" FROM table_14779 WHERE "Format" = 'stereo lp' AND "Catalog" = 'amlh 66078'
give the average age of married patients who were admitted in or after the year 2187.
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2187"
Name the number of players for louisiana state
CREATE TABLE table_20194 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text)
SELECT COUNT("Player") FROM table_20194 WHERE "School/Club Team" = 'Louisiana State'
What is the highest Number of seasons in Liga MX for Club cruz azul?
CREATE TABLE table_name_27 (number_of_seasons_in_liga_mx INTEGER,club VARCHAR)
SELECT MAX(number_of_seasons_in_liga_mx) FROM table_name_27 WHERE club = "cruz azul"
Which Total has a Player of matt ruth?
CREATE TABLE table_name_40 (total VARCHAR,player VARCHAR)
SELECT total FROM table_name_40 WHERE player = "matt ruth"
age >= 18 years
CREATE TABLE table_train_24 ("id" int,"systolic_blood_pressure_sbp" int,"do_not_resuscitate_dnr" bool,"temperature" float,"hypotension" bool,"cardiac_arrest" bool,"age" float,"NOUSE" float)
SELECT * FROM table_train_24 WHERE age >= 18
How many rounds is the player Matthew Puempel associated with?
CREATE TABLE table_17210 ("Round" real,"Overall" text,"Player" text,"Position" text,"Nationality" text,"Club team" text)
SELECT COUNT("Round") FROM table_17210 WHERE "Player" = 'Matthew Puempel'
what was the name of the drug that's been prescribed to patient 73713 two times during their first hospital visit?
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 d_icd_diagnoses (row_id number,icd9_code text,short_...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A...
how many times did they place at least 12th ?
CREATE TABLE table_204_532 (id number,"season" text,"tier" number,"division" text,"place" text)
SELECT COUNT(*) FROM table_204_532 WHERE "place" <= 12
What was the most points for Coloni Spa?
CREATE TABLE table_14794 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MAX("Points") FROM table_14794 WHERE "Entrant" = 'coloni spa'
Can you tell me the highest Against that has the Status of six nations, and the Date of 02/03/2002?
CREATE TABLE table_60873 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text)
SELECT MAX("Against") FROM table_60873 WHERE "Status" = 'six nations' AND "Date" = '02/03/2002'
Which Driver has less than 84 laps, more than 9 points and is on Rocketsports Racing Team?
CREATE TABLE table_32779 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real)
SELECT "Driver" FROM table_32779 WHERE "Laps" < '84' AND "Points" > '9' AND "Team" = 'rocketsports racing'
What is the total rank where the total is less than 5, and bronze is less than 0?
CREATE TABLE table_name_18 (rank VARCHAR,total VARCHAR,bronze VARCHAR)
SELECT COUNT(rank) FROM table_name_18 WHERE total < 5 AND bronze < 0
find the flights leaving DALLAS and going to SAN FRANCISCO that leave after 1700
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,far...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1...
Highest voted vote different comment.
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE Text LIKE '%faq#vote-differences%' ORDER BY Score DESC LIMIT 10
what is patient 13806's weight difference from the last value measured on the last hospital visit compared to the first value measured on the last hospital visit?
CREATE TABLE d_icd_procedures (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 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...
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 = 13806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch...
Who had the high points dated march 13?
CREATE TABLE table_13812785_8 (high_points VARCHAR,date VARCHAR)
SELECT high_points FROM table_13812785_8 WHERE date = "March 13"
give me the three top diagnoses that had the highest four year mortality rate?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
what is the name of the last venue on this chart ?
CREATE TABLE table_204_52 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text)
SELECT "venue" FROM table_204_52 ORDER BY id DESC LIMIT 1
How many patients aged below 77 years old had other psoriasis?
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.age < "77" AND diagnoses.long_title = "Other psoriasis"
count the number of patients on po/ng route of drug administration who are less than 72 years.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.route = "PO/NG"
what are the three most common diagnostics for people who were diagnosed with hypertension nos earlier in the same month, until 2 years ago?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE ch...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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...
calculate the number of patients admitted on phys referral/normal deli who remained admitted in hospital for 26 days.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id 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...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "26"
what number of days have passed since the last time patient 60136 stayed in careunit tsicu during the current hospital visit?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)C...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1
What is the upstream speed of the network that costs 39 tl?
CREATE TABLE table_17304621_14 (upstream VARCHAR,price_tl VARCHAR)
SELECT upstream FROM table_17304621_14 WHERE price_tl = "39 TL"
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute founder, could you show by the x axis from low to high?
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
tell me the diagnosis icd9 code and short title of diagnosis for patient with patient id 21796.
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 diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796"
count the number of patients less than 80 years who have been discharged to skilled nursing facility.
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.discharge_location = "SNF" AND demographic.age < "80"
Name the april for candice cassidy
CREATE TABLE table_name_41 (april VARCHAR,june VARCHAR)
SELECT april FROM table_name_41 WHERE june = "candice cassidy"
What parish did McCain have 45.37% of the votes?
CREATE TABLE table_23849 ("Parish" text,"Obama%" text,"Obama#" real,"McCain%" text,"McCain#" real)
SELECT "Parish" FROM table_23849 WHERE "McCain%" = '45.37%'
provide the number of patients whose admission location is emergency room admit?
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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT"
How many different cities have these stations?
CREATE TABLE station (id number,name text,lat number,long number,dock_count number,city text,installation_date text)CREATE TABLE status (station_id number,bikes_available number,docks_available number,time text)CREATE TABLE weather (date text,max_temperature_f number,mean_temperature_f number,min_temperature_f number,m...
SELECT COUNT(DISTINCT city) FROM station
Name the date for the australian grand prix.
CREATE TABLE table_name_12 (date VARCHAR,grand_prix VARCHAR)
SELECT date FROM table_name_12 WHERE grand_prix = "australian grand prix"
Of the players who scored 5 three pointers, what is the highest number of games played?
CREATE TABLE table_25375 ("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("Games Played") FROM table_25375 WHERE "Three Pointers" = '5'
which position had the least number of players in round nine ?
CREATE TABLE table_203_815 (id number,"pick #" number,"nfl team" text,"player" text,"position" text,"college" text)
SELECT "position" FROM table_203_815 GROUP BY "position" HAVING COUNT("player") = (SELECT COUNT("player") FROM table_203_815 GROUP BY "position" ORDER BY COUNT("player") LIMIT 1)
How many documents are created in each day? Bin the document date by year interval and group by document type with a group line chart, I want to show Document_Date in ascending order please.
CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Documents_with_Expenses (Doc...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date
what was the last ultrafiltrate ultrafiltrate output time for patient 29741 on the last icu visit?
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_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 numbe...
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29741) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it...
count the number of patients whose diagnosis icd9 code is 481 and lab test fluid is blood.
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 = "481" AND lab.fluid = "Blood"
At what age did Roy Emerson complete the Grand Slam?
CREATE TABLE table_197638_6 (age INTEGER,player VARCHAR)
SELECT MAX(age) FROM table_197638_6 WHERE player = "Roy Emerson"
What is the primary conference of the school that has the lowest acc percent score in the competition?
CREATE TABLE basketball_match (team_id number,school_id number,team_name text,acc_regular_season text,acc_percent text,acc_home text,acc_road text,all_games text,all_games_percent number,all_home text,all_road text,all_neutral text)CREATE TABLE university (school_id number,school text,location text,founded number,affil...
SELECT t1.primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1