instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Name the number of districts for december 1799
CREATE TABLE table_15572443_1 (district VARCHAR,election_date VARCHAR)
SELECT COUNT(district) FROM table_15572443_1 WHERE election_date = "December 1799"
what is primary disease and discharge time of subject id 26746?
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 demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "26746"
What is the 1st division when the 2nd division is national league?
CREATE TABLE table_78381 ("Season" text,"1st Division" text,"Relegated" text,"2nd Division" text,"Promoted" text)
SELECT "1st Division" FROM table_78381 WHERE "2nd Division" = 'national league'
What is Round, when Opponent Team is Slovakia, when Outcome is Loser, and when Edition is greater than 2010?
CREATE TABLE table_62017 ("Outcome" text,"Edition" real,"Round" text,"Opponent Team" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Round" FROM table_62017 WHERE "Opponent Team" = 'slovakia' AND "Outcome" = 'loser' AND "Edition" > '2010'
What was the score for alcoba a when the opponent was in the final of xinyun han?
CREATE TABLE table_name_27 (score VARCHAR,tournament VARCHAR,opponent_in_the_final VARCHAR)
SELECT score FROM table_name_27 WHERE tournament = "alcobaça" AND opponent_in_the_final = "xinyun han"
return me the paper after 2000 with the most citations .
CREATE TABLE publication_keyword (kid int,pid int)CREATE TABLE domain_author (aid int,did int)CREATE TABLE writes (aid int,pid int)CREATE TABLE domain_conference (cid int,did int)CREATE TABLE conference (cid int,homepage varchar,name varchar)CREATE TABLE author (aid int,homepage varchar,name varchar,oid int)CREATE TABL...
SELECT title FROM publication WHERE year > 2000 ORDER BY citation_num DESC LIMIT 1
what is 1955 when 1961 is n/a?
CREATE TABLE table_name_78 (Id VARCHAR)
SELECT 1955 FROM table_name_78 WHERE 1961 = "n/a"
What is the smallest attendance in week 5?
CREATE TABLE table_name_18 (attendance INTEGER,week VARCHAR)
SELECT MIN(attendance) FROM table_name_18 WHERE week = 5
Return a bar chart on what is the total revenue of each manufacturer?, rank by the Name in asc.
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 Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name
Name the resolution with dish of 8126
CREATE TABLE table_name_91 (resolution VARCHAR,dish VARCHAR)
SELECT resolution FROM table_name_91 WHERE dish = "8126"
The score of 73-71-70=214 belongs to what country?
CREATE TABLE table_name_77 (country VARCHAR,score VARCHAR)
SELECT country FROM table_name_77 WHERE score = 73 - 71 - 70 = 214
What's the series number of the episode directed by Skipp Sudduth?
CREATE TABLE table_2900 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "No. in series" FROM table_2900 WHERE "Directed by" = 'Skipp Sudduth'
get me patient 61500's hospial admission time since 2105.
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate t...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 61500 AND STRFTIME('%y', admissions.admittime) >= '2105'
What lbum was in the year 1996?
CREATE TABLE table_name_65 (álbum VARCHAR,year VARCHAR)
SELECT álbum FROM table_name_65 WHERE year = 1996
What was the score of the March 14 game?
CREATE TABLE table_name_95 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_95 WHERE date = "march 14"
until 2103, what are the top five most common procedures?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,ic...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) <= '2103' GROUP BY procedures_icd.icd9_code) AS t1...
What rank is the team that has a player named Isco Alarc n?
CREATE TABLE table_46394 ("Rank" real,"Player" text,"Club(s)" text,"Year(s)" text,"U-17 Caps" real)
SELECT "Rank" FROM table_46394 WHERE "Player" = 'isco alarcón'
count the number of patients whose discharge location is home health care and diagnoses long title is other abnormal blood chemistry?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND diagnoses.long_title = "Other abnormal blood chemistry"
List the positions of players whose average number of points scored by that position is larger than 20, give me a bar chart showing the number of different positions, and I want to list by the Y in descending.
CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club...
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC
In what city or town is Stratford (limited service)?
CREATE TABLE table_2572788_1 (town_city VARCHAR,station VARCHAR)
SELECT town_city FROM table_2572788_1 WHERE station = "Stratford (Limited service)"
What is the number of participating parties when registered voters totaled 643629?
CREATE TABLE table_2676980_4 (participating_parties VARCHAR,registered_voters VARCHAR)
SELECT COUNT(participating_parties) FROM table_2676980_4 WHERE registered_voters = 643629
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time.
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE countries (COU...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
when was the first time that the arterial bp [systolic] of patient 21079 was measured / taken?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,h...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21079)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
What's the bronze medal count when the silver is less than 3 and the gold is 1?
CREATE TABLE table_61820 ("Rank" real,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Bronze") FROM table_61820 WHERE "Gold" = '1' AND "Silver" < '3'
count the number of patients whose age is less than 50 and diagnoses long title is persistent postoperative fistula?
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 WHERE demographic.age < "50" AND diagnoses.long_title = "Persistent postoperative fistula"
what is the english word for cavallo
CREATE TABLE table_5358 ("English" text,"Italian" text,"French" text,"German" text,"Russian" text,"Spanish" text)
SELECT "English" FROM table_5358 WHERE "Italian" = 'cavallo'
what is the location of game 4?
CREATE TABLE table_66941 ("Game" real,"Date" text,"Location" text,"Time" text,"Attendance" real)
SELECT "Location" FROM table_66941 WHERE "Game" = '4'
What was the score of the match where paris sg (d1) was team 1?
CREATE TABLE table_name_63 (score VARCHAR,team_1 VARCHAR)
SELECT score FROM table_name_63 WHERE team_1 = "paris sg (d1)"
Name the number of record for 12 cowboys points
CREATE TABLE table_25326 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Cowboys points" real,"Opponents" real,"Record" text)
SELECT COUNT("Record") FROM table_25326 WHERE "Cowboys points" = '12'
Which organization has a Finish of 4th?
CREATE TABLE table_name_93 (organization VARCHAR,finish VARCHAR)
SELECT organization FROM table_name_93 WHERE finish = "4th"
Which Android has anOther Unix of unknown?
CREATE TABLE table_6244 ("Windows" text,"Mac OS X" text,"Linux" text,"Other Unix" text,"AmigaOS" text,"Android" text,"Windows Mobile" text)
SELECT "Android" FROM table_6244 WHERE "Other Unix" = 'unknown'
What was the lowest draw when the against was larger than 2638?
CREATE TABLE table_12633 ("Golden Rivers" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Draws") FROM table_12633 WHERE "Against" > '2638'
Name the party with end date of 22 november 1980
CREATE TABLE table_name_2 (party VARCHAR,end_date VARCHAR)
SELECT party FROM table_name_2 WHERE end_date = "22 november 1980"
What is Frequency, when Part Number(s) is au80610006240aa?
CREATE TABLE table_name_11 (frequency VARCHAR,part_number_s_ VARCHAR)
SELECT frequency FROM table_name_11 WHERE part_number_s_ = "au80610006240aa"
If the home team playing is hawthorn and there are more than 13,000 people in the crowd, what did the away team score?
CREATE TABLE table_56516 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_56516 WHERE "Crowd" > '13,000' AND "Home team" = 'hawthorn'
What is Date From, when Moving To is 'Birmingham City'?
CREATE TABLE table_49812 ("Date From" text,"Date To" text,"Pos." text,"Name" text,"Moving To" text)
SELECT "Date From" FROM table_49812 WHERE "Moving To" = 'birmingham city'
What was the score of the game on May 26?
CREATE TABLE table_name_24 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_24 WHERE date = "may 26"
Which Week 2 Sept 7 has a Week 7 Oct 12 of ball state (7-0)?
CREATE TABLE table_34490 ("Week 1 Sept 2" text,"Week 2 Sept 7" text,"Week 3 Sept 14" text,"Week 5 Sept 28" text,"Week 6 Oct 5" text,"Week 7 Oct 12" text,"Week 10 Nov 2" text,"Week 13 Nov 23" text,"Week 14 Nov 30" text,"Week 15 Dec 7" text,"Week 16 (Final) Jan 9" text)
SELECT "Week 2 Sept 7" FROM table_34490 WHERE "Week 7 Oct 12" = 'ball state (7-0)'
i'd like a flight on AA from NEWARK to NASHVILLE
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_day...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW...
Which producer did Daniel Cormack direct?
CREATE TABLE table_name_50 (producer_s_ VARCHAR,director_s_ VARCHAR)
SELECT producer_s_ FROM table_name_50 WHERE director_s_ = "daniel cormack"
On what day did Dirk Nowitzki (14) have a high rebound?
CREATE TABLE table_17288869_7 (date VARCHAR,high_rebounds VARCHAR)
SELECT date FROM table_17288869_7 WHERE high_rebounds = "Dirk Nowitzki (14)"
What is the name of the nurse has the most appointments?
CREATE TABLE procedures (code number,name text,cost number)CREATE TABLE nurse (employeeid number,name text,position text,registered boolean,ssn number)CREATE TABLE room (roomnumber number,roomtype text,blockfloor number,blockcode number,unavailable boolean)CREATE TABLE prescribes (physician number,patient number,medica...
SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1
What is the count of states with college students playing in the mid position but not as goalies?
CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)
SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'goalie')
What is the number of titles written by Charleen Easton?
CREATE TABLE table_3516 ("Episode #" text,"Season Episode #" text,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" text)
SELECT COUNT("Title") FROM table_3516 WHERE "Written by" = 'Charleen Easton'
what were the five most commonly ordered microbiology tests for patients who previously received a insulin - sliding scale administration during the same month since 2105?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime t...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin - sliding scale administration' AND ...
what total number of passengers is domestic and larger than 2,803,907 and a year after 1999?
CREATE TABLE table_38482 ("Year" real,"Domestic passengers" real,"International passengers" real,"Total passengers" real,"Change" text)
SELECT COUNT("Total passengers") FROM table_38482 WHERE "Domestic passengers" = '2,803,907' AND "Year" > '1999'
What is Record, when Location Attendance is 'TD Banknorth Garden 18,624'?
CREATE TABLE table_name_17 (record VARCHAR,location_attendance VARCHAR)
SELECT record FROM table_name_17 WHERE location_attendance = "td banknorth garden 18,624"
For those employees who did not have any job in the past, return a line chart about the change of manager_id over hire_date , and show X-axis from high to low order.
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAI...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
Sum of cuyo selection as the opposing team?
CREATE TABLE table_50665 ("Opposing Team" text,"Against" real,"Date" text,"Venue" text,"Status" text)
SELECT SUM("Against") FROM table_50665 WHERE "Opposing Team" = 'cuyo selection'
how many native american with whites being 1.0%
CREATE TABLE table_1333612_1 (native_american VARCHAR,whites VARCHAR)
SELECT COUNT(native_american) FROM table_1333612_1 WHERE whites = "1.0%"
When was the earliest incumbent dave reichert was first elected?
CREATE TABLE table_name_86 (first_elected INTEGER,incumbent VARCHAR)
SELECT MIN(first_elected) FROM table_name_86 WHERE incumbent = "dave reichert"
what's the four year survival rate of a person diagnosed with s/p thoracotomy - decortication?
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 lab (labid number,patientunitstayid num...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
what is the date of death of patient name kelly gallardo?
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 demographic.dod FROM demographic WHERE demographic.name = "Kelly Gallardo"
which building has the most floors according to this chart ?
CREATE TABLE table_204_489 (id number,"rank" number,"name" text,"height" text,"floors" number,"year" number,"notes" text)
SELECT "name" FROM table_204_489 ORDER BY "floors" DESC LIMIT 1
how many laps did matt kenset complete on february 26 , 2006 .
CREATE TABLE table_204_604 (id number,"year" number,"date" text,"driver" text,"team" text,"manufacturer" text,"race distance\nlaps" number,"race distance\nmiles (km)" text,"race time" text,"average speed\n(mph)" number,"report" text)
SELECT "race distance\nlaps" FROM table_204_604 WHERE "date" = 'february 26'
What was the series count at on May 23?
CREATE TABLE table_18977 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Series" FROM table_18977 WHERE "Date" = 'May 23'
What is Bev Risman's Cross Code Debut?
CREATE TABLE table_64937 ("Player" text,"Int'l Debut" text,"Year" text,"Cross Code Debut" text,"Date" text)
SELECT "Cross Code Debut" FROM table_64937 WHERE "Player" = 'bev risman'
What was the maximum rank-final value for a score of 14.975?
CREATE TABLE table_26681728_1 (rank_final INTEGER,score_final VARCHAR)
SELECT MAX(rank_final) FROM table_26681728_1 WHERE score_final = "14.975"
When the Home team scored 14.14 (98), what did the Away Team score?
CREATE TABLE table_77624 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_77624 WHERE "Home team score" = '14.14 (98)'
what is the venue when the date is 16 january 1996?
CREATE TABLE table_45340 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Venue" FROM table_45340 WHERE "Date" = '16 january 1996'
What was the winning party when the incumbent was richard s. whaley?
CREATE TABLE table_793 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "Party" FROM table_793 WHERE "Incumbent" = 'Richard S. Whaley'
What are the notes for the time at 3:19.167?
CREATE TABLE table_64606 ("Rank" real,"Athletes" text,"Country" text,"Time" text,"Notes" text)
SELECT "Notes" FROM table_64606 WHERE "Time" = '3:19.167'
Bar chart of minimal salary from each dept name, and list in descending by the X-axis please.
CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE se...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name DESC
When was the earliest year when the attendance was 77,254?
CREATE TABLE table_name_41 (year INTEGER,attendance VARCHAR)
SELECT MIN(year) FROM table_name_41 WHERE attendance = 77 OFFSET 254
What is the result when the 3rd throw is not 8?
CREATE TABLE table_72859 ("1st throw" real,"2nd throw" real,"3rd throw" text,"Equation" text,"Result" real)
SELECT MIN("Result") FROM table_72859 WHERE "3rd throw" = 'not 8'
What is the highest ERP W of the translator with a call sign of w284av?
CREATE TABLE table_name_94 (erp_w INTEGER,call_sign VARCHAR)
SELECT MAX(erp_w) FROM table_name_94 WHERE call_sign = "w284av"
what is minimum age of patients whose gender is m and discharge location is left against medical advi?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI"
what was the daily minimum amount of urine given to patient 013-28507 in their current hospital encounter?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultur...
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 = '013-28507' AND patient.hospitaldischargetime IS ...
Posts that start with a lower case letter.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGui...
SELECT p.CreationDate, CASE WHEN (2 = p.PostTypeId) THEN 'Answer' ELSE 'Question' END AS PostType, p.Score, CASE WHEN (2 = p.PostTypeId) THEN t.Title ELSE p.Title END AS QuestionTitle, p.Body, p.Id AS "post_link" FROM Posts AS p LEFT OUTER JOIN Posts AS t ON (p.ParentId = t.Id) WHERE 1 = 1 AND p.CreationDate >= DATEADD...
How many items appear in the written by column in episode 3?
CREATE TABLE table_27155243_4 (written_by VARCHAR,episode__number VARCHAR)
SELECT COUNT(written_by) FROM table_27155243_4 WHERE episode__number = 3
Who had the high point total when the team was 24-17?
CREATE TABLE table_13762472_5 (high_points VARCHAR,record VARCHAR)
SELECT high_points FROM table_13762472_5 WHERE record = "24-17"
what's the sunday s l (sun) with friday venus (venus) being vernes
CREATE TABLE table_1277350_1 (sunday_sōl__sun_ VARCHAR,friday_venus__venus_ VARCHAR)
SELECT sunday_sōl__sun_ FROM table_1277350_1 WHERE friday_venus__venus_ = "vernes"
Bin all date of transactions into the weekday interval, and sum the share count of each bin Return the result using a bar chart, list in descending by the y axis please.
CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Lots (lot_id INTEGER,investor_id I...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY SUM(share_count) DESC
What is the name of the away team with glenferrie oval venue?
CREATE TABLE table_name_72 (away_team VARCHAR,venue VARCHAR)
SELECT away_team FROM table_name_72 WHERE venue = "glenferrie oval"
provide the number of patients whose drug code is ambi5?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "AMBI5"
give me the number of patients whose admission type is elective and diagnoses icd9 code is 70703?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "70703"
Which Elevator has Elevated of april 12, 1281, a Nationality of french, and an Elector of jean cholet?
CREATE TABLE table_name_89 (elevator VARCHAR,elector VARCHAR,elevated VARCHAR,nationality VARCHAR)
SELECT elevator FROM table_name_89 WHERE elevated = "april 12, 1281" AND nationality = "french" AND elector = "jean cholet"
What was the first year that had a prize of 50,000?
CREATE TABLE table_name_28 (first_year_aired VARCHAR,prize VARCHAR)
SELECT first_year_aired FROM table_name_28 WHERE prize = "50,000"
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the sum of price , and group by attribute name, and order y axis in descending order.
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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price DESC
What is the status of the building with more than 28 floor and a year of 2013?
CREATE TABLE table_77853 ("Building" text,"Height" text,"Floors" real,"Year" real,"Status" text)
SELECT "Status" FROM table_77853 WHERE "Floors" > '28' AND "Year" = '2013'
What are all the .308 Winchester cartridge types with 38 for the 300 m group (mm)
CREATE TABLE table_17497 (".308 Winchester cartridge type" text,"100 m group (mm)" text,"100 m group (MOA)" text,"300 m group (mm)" text,"300 m group (MOA)" text)
SELECT ".308 Winchester cartridge type" FROM table_17497 WHERE "300 m group (mm)" = '38'
provide the number of patients whose year of death is less than or equal to 2179 and drug code is meth10sy?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2179.0" AND prescriptions.formulary_drug_cd = "METH10SY"
What Results has a Seed #12 and a Year that's smaller than 1996
CREATE TABLE table_name_36 (results VARCHAR,seed VARCHAR,year VARCHAR)
SELECT results FROM table_name_36 WHERE seed = "#12" AND year < 1996
how many countries total only received one bronze medal in the 1987 championship ?
CREATE TABLE table_204_311 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("nation") FROM table_204_311 WHERE "bronze" = 1
Name the 2nd runner-up for season 7
CREATE TABLE table_name_59 (season_number VARCHAR)
SELECT 2 AS nd_runner_up FROM table_name_59 WHERE season_number = "season 7"
What is the launched date for the Harusame ship?
CREATE TABLE table_15688 ("Kanji" text,"Name" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" text)
SELECT "Launched" FROM table_15688 WHERE "Name" = 'harusame'
search for (possible) cat abuse.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGui...
SELECT Id, Title FROM Posts WHERE Body LIKE '%grep%'
How much was the score of the home team at windy hill?
CREATE TABLE table_11180 ("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_11180 WHERE "Venue" = 'windy hill'
What are the lowest laps of Graham Hill?
CREATE TABLE table_name_68 (laps INTEGER,driver VARCHAR)
SELECT MIN(laps) FROM table_name_68 WHERE driver = "graham hill"
What series episode has stetson hats (part 1) under segment C?
CREATE TABLE table_38028 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Series Ep." FROM table_38028 WHERE "Segment C" = 'stetson hats (part 1)'
provide the number of patients whose death status is 0 and diagnoses long title is suicide and self-inflicted poisoning by analgesics, antipyretics, and antirheumatics?
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 WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Suicide and self-inflicted poisoning by analgesics, antipyretics, and antirheumatics"
How many attended the game on april 14?
CREATE TABLE table_name_28 (attendance VARCHAR,date VARCHAR)
SELECT COUNT(attendance) FROM table_name_28 WHERE date = "april 14"
What NCBI Accession Number (mRNA/Protein) has a Protein Identity of 69%?
CREATE TABLE table_name_99 (ncbi_accession_number__mrna_protein_ VARCHAR,protein_identity VARCHAR)
SELECT ncbi_accession_number__mrna_protein_ FROM table_name_99 WHERE protein_identity = "69%"
What is the height of the player who currently plays for Alta Gesti n Fuenlabrada?
CREATE TABLE table_name_59 (height VARCHAR,current_club VARCHAR)
SELECT height FROM table_name_59 WHERE current_club = "alta gestión fuenlabrada"
how many days is it since patient 40707's first d10w prescription in the current hospital visit?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)C...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40707 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'd10w' ORDER BY prescriptions.startdate LIMIT ...
Find each target user's name and average trust score Visualize by bar chart, I want to show by the x axis in ascending.
CREATE TABLE review (a_id integer,u_id integer,i_id integer,rating integer,rank integer)CREATE TABLE useracct (u_id integer,name varchar(128))CREATE TABLE trust (source_u_id integer,target_u_id integer,trust integer)CREATE TABLE item (i_id integer,title varchar(20))
SELECT name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id ORDER BY name
For BCS 232 what are the classes needed to be taken ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT DISTINCT COURSE_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...
Show me a scatter chart for how many documents correspond with each project id?
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 Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description...
SELECT Project_ID, COUNT(*) FROM Documents GROUP BY Project_ID
how many innings had bbi 4/26?
CREATE TABLE table_30793 ("Player" text,"Matches" real,"Innings" real,"Wickets" real,"Average" text,"BBI" text,"BBM" text,"5wi" real,"10wi" real)
SELECT "Innings" FROM table_30793 WHERE "BBI" = '4/26'
Which winner has a points classification of Tony Rominger at stage 17?
CREATE TABLE table_70131 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Trofeo Fast Team" text)
SELECT "Winner" FROM table_70131 WHERE "Points classification" = 'tony rominger' AND "Stage" = '17'