instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What are the total number of laps for Tom Bridger?
CREATE TABLE table_name_63 (laps VARCHAR,driver VARCHAR)
SELECT COUNT(laps) FROM table_name_63 WHERE driver = "tom bridger"
how many times did a replace indwelling cath procedure be done?
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 inputevents_cv (row_id number,subject_id number,...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'replace indwelling cath')
what is minimum age of patients whose marital status is divorced and primary disease is brain mass;intracranial hemorrhage?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
What is the average game number that took place after February 13 against the Toronto Maple Leafs and more than 47 points were scored?
CREATE TABLE table_34991 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text,"Points" real)
SELECT AVG("Game") FROM table_34991 WHERE "February" > '13' AND "Opponent" = 'toronto maple leafs' AND "Points" > '47'
What was the score for set 3 when set 1 was 14 25?
CREATE TABLE table_44722 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Set 3" FROM table_44722 WHERE "Set 1" = '14–25'
Show a bar chart about how many employees does each role have?, I want to order by the the total number in descending.
CREATE TABLE Documents (document_id INTEGER,document_status_code CHAR(15),document_type_code CHAR(15),shipping_agent_code CHAR(15),receipt_date DATETIME,receipt_number VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Ref_Shipping_Agents (shipping_agent_code CHAR(15),shipping_agent_name VARCHAR(255),shipping_agent_d...
SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY COUNT(*) DESC
what was the last thing patient 20603 received for intake since 987 days ago?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE inputevents_cv...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 20603)) AND DATETIME(inputevents_cv....
How many engines have a Model of sl600, and a Year From of 1994, and a Year To smaller than 1995?
CREATE TABLE table_78990 ("Model" text,"Chassis" real,"Engine" real,"Year From" real,"Year To" real)
SELECT COUNT("Engine") FROM table_78990 WHERE "Model" = 'sl600' AND "Year From" = '1994' AND "Year To" < '1995'
If there are 28 points, what is the time/retired?
CREATE TABLE table_17330069_1 (time_retired VARCHAR,points VARCHAR)
SELECT time_retired FROM table_17330069_1 WHERE points = "28"
Which player has an A-League of 113 (0)?
CREATE TABLE table_15236 ("Name" text,"Years" text,"A-League" text,"Finals" text,"Total" text)
SELECT "Name" FROM table_15236 WHERE "A-League" = '113 (0)'
what was the name of the first lab test patient 51177 had received since 03/2105?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueu...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-03' ORDER BY labevents.charttime LIMIT 1)
What Division III has Bishop Brady in Division V and Hanover in Division IV?
CREATE TABLE table_15119 ("Year" real,"Division I" text,"Division II" text,"Division III" text,"Division IV" text,"Division V" text)
SELECT "Division III" FROM table_15119 WHERE "Division V" = 'bishop brady' AND "Division IV" = 'hanover'
What is the number drawn when the try BP is 1?
CREATE TABLE table_67890 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Try BP" text,"Losing BP" text)
SELECT "Drawn" FROM table_67890 WHERE "Try BP" = '1'
Who was the opponent the Buffalo Bills played when their record was 4-4?
CREATE TABLE table_name_34 (opponent VARCHAR,record VARCHAR)
SELECT opponent FROM table_name_34 WHERE record = "4-4"
What is the year for the ocean?
CREATE TABLE table_57011 ("Year" real,"Author" text,"English title" text,"Original title" text,"Representing" text)
SELECT "Year" FROM table_57011 WHERE "English title" = 'the ocean'
What position is the player who went to Regina?
CREATE TABLE table_73185 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "Position" FROM table_73185 WHERE "College" = 'Regina'
What is 1994 Grand Slam Tournament if 1993 is also grand slam tournaments?
CREATE TABLE table_62772 ("Tournament" text,"1987" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text)
SELECT "1994" FROM table_62772 WHERE "1993" = 'grand slam tournaments'
What is the 2005 that has a grand slam tournaments in 2007?
CREATE TABLE table_name_52 (Id VARCHAR)
SELECT 2005 FROM table_name_52 WHERE 2007 = "grand slam tournaments"
What is the number of the rank when the time is 2:15.98, in a lane larger than 7?
CREATE TABLE table_67600 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT COUNT("Rank") FROM table_67600 WHERE "Time" = '2:15.98' AND "Lane" > '7'
How many hosts does each nationality have? List the nationality and the count Visualize by bar chart, and sort X-axis from high to low order.
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)CREATE TABLE party_host (Party_ID int,Host_ID int,Is_Main_in_Charge bool)
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC
How many patients born before year 2170 have lab test fluid as other body fluid?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Other Body Fluid"
what is the aircraft type with the greatest seating capacity
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stop...
SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1)
what is procedure short title of subject id 6983?
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 procedures.short_title FROM procedures WHERE procedures.subject_id = "6983"
What is origin country for a title that charted at 52?
CREATE TABLE table_37630 ("Date" text,"Title" text,"Origin" text,"Label & Cat. no." text,"Chart no." real)
SELECT "Origin" FROM table_37630 WHERE "Chart no." = '52'
What's the series number of the episode with production code 329?
CREATE TABLE table_18055005_1 (no_in_series VARCHAR,prod_code VARCHAR)
SELECT no_in_series FROM table_18055005_1 WHERE prod_code = "329"
Return the room and number of reservations made for each of the rooms to draw a bar chart, I want to sort Y-axis in descending order.
CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)
SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC
What is the week number with Phil Collins as the original artist?
CREATE TABLE table_name_88 (week__number VARCHAR,original_artist VARCHAR)
SELECT week__number FROM table_name_88 WHERE original_artist = "phil collins"
What's the team of the player who went to lawrence tech?
CREATE TABLE table_name_56 (team VARCHAR,college VARCHAR)
SELECT team FROM table_name_56 WHERE college = "lawrence tech"
What tournament has nov. 21, 1999 as the date?
CREATE TABLE table_68037 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the Final" text,"Score" text)
SELECT "Tournament" FROM table_68037 WHERE "Date" = 'nov. 21, 1999'
What NFL team did the Tight End position belong to?
CREATE TABLE table_name_62 (nfl_team VARCHAR,position VARCHAR)
SELECT nfl_team FROM table_name_62 WHERE position = "tight end"
Who was the Builder for the locomotive that has a works number of 323?
CREATE TABLE table_name_92 (builder VARCHAR,works_number VARCHAR)
SELECT builder FROM table_name_92 WHERE works_number = "323"
On what days are most questions posted?.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,Creatio...
SELECT COUNT(*) AS "# votes", TIME_TO_STR(v.CreationDate, '%h') AS "hour" FROM Votes AS v GROUP BY TIME_TO_STR(v.CreationDate, '%h')
When the Winning score is 68-65-65-68=266, what is the Margin of victory?
CREATE TABLE table_name_59 (margin_of_victory VARCHAR,winning_score VARCHAR)
SELECT margin_of_victory FROM table_name_59 WHERE winning_score = 68 - 65 - 65 - 68 = 266
If the year is 2007, what is the top ten?
CREATE TABLE table_25431 ("Year" real,"Tournaments played" real,"Cuts made" real,"Wins" real,"2nd" real,"Top 10s" real,"Best finish" text,"Earnings ($)" real,"Money list rank" real,"Scoring average" text,"Scoring rank" real)
SELECT "Top 10s" FROM table_25431 WHERE "Year" = '2007'
Name the foochow for pingnan county
CREATE TABLE table_23564 ("English Name" text,"Simplified" text,"Traditional" text,"Pinyin" text,"Foochow" text,"Area" real,"Population" real,"Density" real)
SELECT "Foochow" FROM table_23564 WHERE "English Name" = 'Pingnan County'
In what City/State did John Bowe win at Phillip Island Grand Prix Circuit?
CREATE TABLE table_name_12 (city___state VARCHAR,winner VARCHAR,circuit VARCHAR)
SELECT city___state FROM table_name_12 WHERE winner = "john bowe" AND circuit = "phillip island grand prix circuit"
What iwas the attendance of the game that took place on december 6, 1998?
CREATE TABLE table_8742 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_8742 WHERE "Date" = 'december 6, 1998'
What district did James O'Connor belong to?
CREATE TABLE table_1342451_16 (district VARCHAR,incumbent VARCHAR)
SELECT district FROM table_1342451_16 WHERE incumbent = "James O'Connor"
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, visualize a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, order Y in desc order please.
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 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...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
Show the transaction type and the number of transactions by a bar chart.
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
which township has the least water area in miles ?
CREATE TABLE table_203_510 (id number,"township" text,"fips" number,"population\ncenter" text,"population" number,"population\ndensity\n(/mi2)" number,"population\ndensity\n(/km2)" number,"land area\n(mi2)" number,"land area\n(km2)" number,"water area\n(mi2)" number,"water area\n(km2)" number,"geographic coordinates" t...
SELECT "township" FROM table_203_510 WHERE "water area\n(mi2)" = (SELECT MIN("water area\n(mi2)") FROM table_203_510)
Which Year Inducted is the highest one that has a Year smaller than 1965?
CREATE TABLE table_name_28 (year INTEGER)
SELECT MAX(year) AS Inducted FROM table_name_28 WHERE year < 1965
What date was the result 6 2, 4 6, 6 4?
CREATE TABLE table_16974 ("Edition" text,"Round" text,"Date" text,"Partnering" text,"Against" text,"Surface" text,"Opponents" text,"W\u2013L" text,"Result" text)
SELECT "Date" FROM table_16974 WHERE "Result" = '6–2, 4–6, 6–4'
Who is the artist of the album Soul?
CREATE TABLE table_name_18 (artist VARCHAR,album VARCHAR)
SELECT artist FROM table_name_18 WHERE album = "soul"
What is Director Erik Matti's Producer?
CREATE TABLE table_5045 ("Year" text,"Title" text,"Role" text,"Producer" text,"Director" text)
SELECT "Producer" FROM table_5045 WHERE "Director" = 'erik matti'
what is the club that was founded before 2007, joined prsl in 2008 and the stadium is yldefonso sol morales stadium?
CREATE TABLE table_name_85 (club VARCHAR,stadium VARCHAR,founded VARCHAR,joined_prsl VARCHAR)
SELECT club FROM table_name_85 WHERE founded < 2007 AND joined_prsl = 2008 AND stadium = "yldefonso solá morales stadium"
What was the championship that had final score of 6 2, 5 7, 6 4, 6 2 and was on a clay surface?
CREATE TABLE table_51826 ("Outcome" text,"Date" real,"Championship" text,"Surface" text,"Opponent in the final" text,"Score in the final" text)
SELECT "Championship" FROM table_51826 WHERE "Surface" = 'clay' AND "Score in the final" = '6–2, 5–7, 6–4, 6–2'
get the number of patients who were hospitalized for more than 27 days and had aortic valve insufficiency/aortic valve replacement/sda primary disease.
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 WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.days_stay > "27"
WHAT IS THE RANK OF UNIVERSAL, AND DIRECTOR JOHN HUGHES?
CREATE TABLE table_name_7 (rank VARCHAR,studio VARCHAR,director VARCHAR)
SELECT rank FROM table_name_7 WHERE studio = "universal" AND director = "john hughes"
What is the highest season# for the writer Daegan Fryklind?
CREATE TABLE table_25131572_3 (season__number INTEGER,written_by VARCHAR)
SELECT MAX(season__number) FROM table_25131572_3 WHERE written_by = "Daegan Fryklind"
Which round had Michael Schumacher in the pole position, David Coulthard with the fastest lap, and McLaren - Mercedes as the winning constructor?
CREATE TABLE table_1132600_3 (round VARCHAR,winning_constructor VARCHAR,pole_position VARCHAR,fastest_lap VARCHAR)
SELECT COUNT(round) FROM table_1132600_3 WHERE pole_position = "Michael Schumacher" AND fastest_lap = "David Coulthard" AND winning_constructor = "McLaren - Mercedes"
What is the name of the player with an Overall larger than 227?
CREATE TABLE table_52532 ("Round" real,"Overall" real,"Player" text,"Nationality" text,"Club team" text)
SELECT "Player" FROM table_52532 WHERE "Overall" > '227'
Which guests have apartment bookings with status code 'Confirmed'? Return their first names and last names.
CREATE TABLE apartment_buildings (building_id number,building_short_name text,building_full_name text,building_description text,building_address text,building_manager text,building_phone text)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroom_count number,bedroom_count...
SELECT T2.guest_first_name, T2.guest_last_name FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed"
How many bronze medals did the country with 7 medals and over 5 silver medals receive?
CREATE TABLE table_71364 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Bronze") FROM table_71364 WHERE "Total" = '7' AND "Silver" > '5'
What are card ids, customer ids, card types, and card numbers for each customer card?, and could you show y axis in desc order?
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))C...
SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) DESC
Name the record for 1997
CREATE TABLE table_68632 ("Year" text,"Record" text,"Finish" text,"Manager" text,"Playoffs" text)
SELECT "Record" FROM table_68632 WHERE "Year" = '1997'
Who came in second place when the champion was south dakota school of mines & technology?
CREATE TABLE table_2331549_1 (second_place VARCHAR,champion VARCHAR)
SELECT second_place FROM table_2331549_1 WHERE champion = "South Dakota School of Mines & Technology"
When 2/1939 is the withdrawn when was it built?
CREATE TABLE table_1886270_1 (built VARCHAR,withdrawn VARCHAR)
SELECT built FROM table_1886270_1 WHERE withdrawn = "2/1939"
Who was the husband of marie of baden-sponheim?
CREATE TABLE table_name_74 (husband VARCHAR,image VARCHAR)
SELECT husband FROM table_name_74 WHERE image = "marie of baden-sponheim"
How many regions were affected by each storm Visualize by bar chart, and rank from high to low by the y-axis.
CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*) DESC
Who was the away team at the game attended by 81?
CREATE TABLE table_59479 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text)
SELECT "Away team" FROM table_59479 WHERE "Attendance" = '81'
Who won at Kr ko?
CREATE TABLE table_name_25 (winners VARCHAR,venue VARCHAR)
SELECT winners FROM table_name_25 WHERE venue = "krško"
Total larger than 285, and a Finish of t30 belongs to what player?
CREATE TABLE table_37036 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text)
SELECT "Player" FROM table_37036 WHERE "Total" > '285' AND "Finish" = 't30'
What are the valid from and valid to dates for the card with the number 4560596484842?
CREATE TABLE accounts (account_id number,customer_id number,account_name text,other_account_details text)CREATE TABLE financial_transactions (transaction_id number,previous_transaction_id number,account_id number,card_id number,transaction_type text,transaction_date time,transaction_amount number,transaction_comment te...
SELECT date_valid_from, date_valid_to FROM customers_cards WHERE card_number = "4560596484842"
what was jenson button 's time ?
CREATE TABLE table_204_743 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "time/retired" FROM table_204_743 WHERE "driver" = 'jenson button'
A bar chart for finding the number of the last name of female (sex is F) students in the descending order of age.
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Course (CID VARCHAR(7),CName VARCHAR(40),Credits INTEGER,Instructor INTEGER,Days VARCHAR(5),Hours VARCHAR(11),DNO INTEGER)CREATE TABLE Enrolled_in (StuID INT...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC
how many of the patients aged below 61 had hypothyroidism nos?
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 < "61" AND diagnoses.short_title = "Hypothyroidism NOS"
what is the cheapest one way fare from PITTSBURGH to ATLANTA traveling on tuesday august twentieth
CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE T...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
What chassis did the porsche flat-4 use before 1958?
CREATE TABLE table_name_44 (chassis VARCHAR,engine VARCHAR,year VARCHAR)
SELECT chassis FROM table_name_44 WHERE engine = "porsche flat-4" AND year < 1958
What is the percentage of yes when there were 218846 yes votes
CREATE TABLE table_256286_61 (_percentage_yes VARCHAR,yes_votes VARCHAR)
SELECT _percentage_yes FROM table_256286_61 WHERE yes_votes = 218846
What is the rank of Rmax Rpeak ( Pflops ) of 17.173 20.133?
CREATE TABLE table_77965 ("Rank" real,"Rmax Rpeak (Pflops)" text,"Name" text,"Vendor" text,"Operating system" text)
SELECT AVG("Rank") FROM table_77965 WHERE "Rmax Rpeak ( Pflops )" = '17.173 20.133'
WHere is the friends' school?
CREATE TABLE table_name_65 (location VARCHAR,school VARCHAR)
SELECT location FROM table_name_65 WHERE school = "the friends' school"
count the number of patients whose diagnosis icd9 code is 53081 and lab test category is hematology.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "53081" AND lab."CATEGORY" = "Hematology"
What order was the performance of a Richard Marx song?
CREATE TABLE table_76715 ("Week" text,"Theme" text,"Artist" text,"Order sung" text,"Status" text)
SELECT "Order sung" FROM table_76715 WHERE "Artist" = 'richard marx'
Which BR number has an LMS number over 14768?
CREATE TABLE table_63261 ("HR Number" real,"Name" text,"LMS Number" real,"BR number" text,"Withdrawn" text)
SELECT "BR number" FROM table_63261 WHERE "LMS Number" > '14768'
Compare each editors' ages using a bar chart, sort by the x axis in ascending.
CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)
SELECT Name, Age FROM editor ORDER BY Name
provide the number of patients whose death status is 0 and procedure short title is regional lymph node exc?
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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Regional lymph node exc"
What was the score on August 8?
CREATE TABLE table_51537 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Score" FROM table_51537 WHERE "Date" = 'august 8'
Which ICB Sector had a ticker symbol of pp?
CREATE TABLE table_name_47 (icb_sector VARCHAR,ticker_symbol VARCHAR)
SELECT icb_sector FROM table_name_47 WHERE ticker_symbol = "pp"
What rank did the time of 7:31.90 receive?
CREATE TABLE table_name_62 (rank VARCHAR,time VARCHAR)
SELECT COUNT(rank) FROM table_name_62 WHERE time = "7:31.90"
on their last hospital visit what was the marital status of patient 25461?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 25461 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
Who was the director of Battalion Wars 2 which was released on GCN after 2004?
CREATE TABLE table_name_72 (director VARCHAR,title VARCHAR,platform_s_ VARCHAR,year VARCHAR)
SELECT director FROM table_name_72 WHERE platform_s_ = "gcn" AND year > 2004 AND title = "battalion wars 2"
What is the position for the player that played in 2006?
CREATE TABLE table_17143 ("Player" text,"No.(s)" text,"Height in Ft." text,"Position" text,"Years for Rockets" text,"School/Club Team/Country" text)
SELECT "Position" FROM table_17143 WHERE "Years for Rockets" = '2006'
What was the location and attendance for game 2?
CREATE TABLE table_27700530_15 (location_attendance VARCHAR,game VARCHAR)
SELECT location_attendance FROM table_27700530_15 WHERE game = 2
What was the final score of Washington's home game?
CREATE TABLE table_28298589_4 (result VARCHAR,home_team VARCHAR)
SELECT result FROM table_28298589_4 WHERE home_team = "Washington"
on the current hospital encounter, count the number of drugs that patient 032-9230 had been prescribed.
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL))
What was the team's record at the game attended by 30,452?
CREATE TABLE table_name_22 (record VARCHAR,attendance VARCHAR)
SELECT record FROM table_name_22 WHERE attendance = "30,452"
What are the different names and ages of every friend of either Dan or alice?
CREATE TABLE personfriend (name text,friend text,year number)CREATE TABLE person (name text,age number,city text,gender text,job text)
SELECT DISTINCT T1.name, T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'
who is the winner when the trofeo fast team is carrera jeans-vagabond in stage 5?
CREATE TABLE table_name_55 (winner VARCHAR,trofeo_fast_team VARCHAR,stage VARCHAR)
SELECT winner FROM table_name_55 WHERE trofeo_fast_team = "carrera jeans-vagabond" AND stage = "5"
What episode was watched by 10.81 million US viewers?
CREATE TABLE table_26434 ("No. by series" real,"No. by season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production number" real,"U.S. viewers (in millions)" text)
SELECT MIN("No. by season") FROM table_26434 WHERE "U.S. viewers (in millions)" = '10.81'
What is the date of the game with a result of W 13-10?
CREATE TABLE table_name_53 (date VARCHAR,result VARCHAR)
SELECT date FROM table_name_53 WHERE result = "w 13-10"
Name the average Stolen Ends which has an Ends Lost smaller than 35?
CREATE TABLE table_name_89 (stolen_ends INTEGER,ends_lost INTEGER)
SELECT AVG(stolen_ends) FROM table_name_89 WHERE ends_lost < 35
what's the title where original air date is january18,2009
CREATE TABLE table_11589522_3 (title VARCHAR,original_air_date VARCHAR)
SELECT title FROM table_11589522_3 WHERE original_air_date = "January18,2009"
For the player finishing at +8, what is his nationality?
CREATE TABLE table_name_91 (country VARCHAR,to_par VARCHAR)
SELECT country FROM table_name_91 WHERE to_par = "+8"
What is the model number for the order part numbered tmrm75dam22gg?
CREATE TABLE table_27277284_28 (model_number VARCHAR,order_part_number VARCHAR)
SELECT model_number FROM table_27277284_28 WHERE order_part_number = "TMRM75DAM22GG"
what city has a past season of n/a?
CREATE TABLE table_68201 ("Team" text,"City" text,"Stadium" text,"Manager" text,"Past season" text)
SELECT "City" FROM table_68201 WHERE "Past season" = 'n/a'
Who was the 3rd performer when Rory Bremner was the 4th performer?
CREATE TABLE table_name_11 (performer_3 VARCHAR,performer_4 VARCHAR)
SELECT performer_3 FROM table_name_11 WHERE performer_4 = "rory bremner"
Who is the company that released the album on 2008-09-18 18 September 2008?
CREATE TABLE table_name_76 (company VARCHAR,release_date VARCHAR)
SELECT company FROM table_name_76 WHERE release_date = "2008-09-18 18 september 2008"
name of horse that finished first in the 1997 kentucky derby
CREATE TABLE table_204_13 (id number,"finished" text,"post" number,"horse" text,"jockey" text,"trainer" text,"owner" text,"time / behind" text)
SELECT "horse" FROM table_204_13 WHERE "finished" = 1
what is patient 19428's maximum arterial bp [systolic] at on this month/27?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE inputevents_cv (row_...
SELECT MAX(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 = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...