table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_74185 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What two players had the highest rebounds for the October 14 game?
SELECT "High rebounds" FROM table_74185 WHERE "Date" = 'October 14'
CREATE TABLE table_45447 ( "Round" real, "Race Name" text, "Pole position" text, "Winning driver" text, "Winning Team" text )
What pole position did 2006 gehl championship finale have?
SELECT "Pole position" FROM table_45447 WHERE "Race Name" = '2006 gehl championship finale'
CREATE TABLE table_7302 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
What is the Away captain with a Venue that is old trafford?
SELECT "Away captain" FROM table_7302 WHERE "Venue" = 'old trafford'
CREATE TABLE table_18569389_1 ( title VARCHAR, production_code VARCHAR )
Name the title for production code 2t6908
SELECT title FROM table_18569389_1 WHERE production_code = "2T6908"
CREATE TABLE table_12261926_2 ( intergiro_classification VARCHAR, stage VARCHAR )
What is the intergiro classification of stage 21?
SELECT intergiro_classification FROM table_12261926_2 WHERE stage = 21
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 ) ...
Give the minimum age of patients whose admission type is urgent and were born before the year 2175.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2175"
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code...
show me the latest flight on wednesday from ATLANTA to WASHINGTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 A...
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
A bar chart about what are the memories and carriers of phones?, and order by the Y-axis in descending.
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) DESC
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 ) ...
how many patients admitted before 2155 are diagnosed with other specified gastritis, with hemorrhage?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2155" AND diagnoses.long_title = "Other specified gastritis, with hemorrhage"
CREATE TABLE table_65946 ( "Position" text, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
What is the B Score when the total is more than 16.125, and position is 3rd?
SELECT SUM("B Score") FROM table_65946 WHERE "Total" > '16.125' AND "Position" = '3rd'
CREATE TABLE table_50932 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
Which country had a place of t1, as well as a score of 72-68-70-73=283?
SELECT "Country" FROM table_50932 WHERE "Place" = 't1' AND "Score" = '72-68-70-73=283'
CREATE TABLE table_204_557 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text, "pts" number )
what is the name of first visitor on this chart ?
SELECT "visitor" FROM table_204_557 WHERE id = 1
CREATE TABLE table_11606 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team played Footscray?
SELECT "Away team" FROM table_11606 WHERE "Home team" = 'footscray'
CREATE TABLE table_39045 ( "Model" text, "Processors Supported" text, "FSB/HT Frequency (MHz)" text, "Memory" text, "PCI-Express" text, "SATA" text, "PATA" text, "Sound" text )
What are the processors supported by a ddr2 memory and the nforce 550 model?
SELECT "Processors Supported" FROM table_39045 WHERE "Memory" = 'ddr2' AND "Model" = 'nforce 550'
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ...
Questions with answers, but no accepted answer.
SELECT Id AS "post_link", AnswerCount FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND OwnerUserId = '##UserId:int##'
CREATE TABLE table_25286 ( "Constituency" text, "Winner" text, "Party" text, "Margin" real, "Runner-up a" text, "Party a" text )
What is the party when the constituency is 1. Chennai North?
SELECT "Party" FROM table_25286 WHERE "Constituency" = '1. Chennai North'
CREATE TABLE table_name_35 ( losses INTEGER, wimmera_fl VARCHAR )
Which Losses have a Wimmera FL of minyip murtoa?
SELECT AVG(losses) FROM table_name_35 WHERE wimmera_fl = "minyip murtoa"
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, ...
Among patients whose birth year is before 2107, how many of them belonged to black/african american ethnic origin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2107"
CREATE TABLE table_79956 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who did they play on August 12?
SELECT "Opponent" FROM table_79956 WHERE "Date" = 'august 12'
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 prescriptions...
Provide me the list of patients on base drug prescription who havea hospital stay greater than three days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug_type = "BASE"
CREATE TABLE table_name_75 ( year INTEGER, chassis VARCHAR, entrant VARCHAR, points VARCHAR )
What year did Elf Team Tyrrell have 39 points and a Tyrrell 007 Chassis?
SELECT SUM(year) FROM table_name_75 WHERE entrant = "elf team tyrrell" AND points = "39" AND chassis = "tyrrell 007"
CREATE TABLE table_36909 ( "Club" text, "Sport" text, "Founded" real, "League" text, "Venue" text, "Head Coach" text )
Venue of Pepsi arena involved what club?
SELECT "Club" FROM table_36909 WHERE "Venue" = 'pepsi arena'
CREATE TABLE table_name_87 ( nationality VARCHAR, player VARCHAR )
What is Graham Gooch's nationality?
SELECT nationality FROM table_name_87 WHERE player = "graham gooch"
CREATE TABLE table_60735 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which Player has a To par of 2, and a Country of wales?
SELECT "Player" FROM table_60735 WHERE "To par" = '–2' AND "Country" = 'wales'
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icust...
how much was patient 20898's body weight last measured in this month?
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 = 20898)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
CREATE TABLE table_3813 ( "Sd" real, "Rk" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text )
How many different counts for won points does Flavia Pennetta have?
SELECT COUNT("Points won") FROM table_3813 WHERE "Player" = 'Flavia Pennetta'
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statemen...
How many documents are created in each day? Bin the document date by year interval with a line chart.
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
CREATE TABLE table_46421 ( "Name" text, "Country" text, "Loan Club" text, "Started" text, "Ended" text, "Start Source" text, "End Source" text )
When was the loan started when the coutry is eng, the loan club is sunderland and the end source is south wales echo?
SELECT "Started" FROM table_46421 WHERE "Country" = 'eng' AND "Loan Club" = 'sunderland' AND "End Source" = 'south wales echo'
CREATE TABLE table_25663 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text, "Viewers (millions)" text )
what is the name of the episode when the number of spectators was 5.60 millions?
SELECT "Title" FROM table_25663 WHERE "Viewers (millions)" = '5.60'
CREATE TABLE table_16360 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text )
When did the episode title 'Duet For One' air?
SELECT "Original air date" FROM table_16360 WHERE "Title" = 'Duet for One'
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients had the drug code acet650r?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ACET650R"
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
until 2104, what was the monthly minimum weight of patient 22517?
SELECT MIN(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 = 22517)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
CREATE TABLE table_name_90 ( decision VARCHAR, home VARCHAR )
What was the decision of the game when Montreal was the home team?
SELECT decision FROM table_name_90 WHERE home = "montreal"
CREATE TABLE table_40489 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text )
What is the 2004 that has a of grand slam tournaments in2006 ?
SELECT "2004" FROM table_40489 WHERE "2006" = 'grand slam tournaments'
CREATE TABLE table_23618 ( "Divisions" text, "Prize (EUR)" text, "Odds of winning (1in)" text, "Number of winning tickets" real, "In order to win" text )
Which divisions have 565 as the number of winning tickets?
SELECT "Divisions" FROM table_23618 WHERE "Number of winning tickets" = '565'
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Average score per hundred views.
WITH counts_cte AS (SELECT LAST_DATE_OF_MONTH(p.CreationDate) AS Cmonth, SUM(Score) AS Score, SUM(ViewCount) AS Views FROM Posts AS p WHERE PostTypeId = 1 GROUP BY LAST_DATE_OF_MONTH(p.CreationDate)) SELECT Cmonth, 100 * (CAST(Score AS FLOAT)) / (CAST(Views AS FLOAT)) AS "score_per_view" FROM counts_cte ORDER BY Cmonth
CREATE TABLE table_name_28 ( budget VARCHAR, film VARCHAR )
WHAT IS THE BUDGET FOR THE INCREDIBLES?
SELECT budget FROM table_name_28 WHERE film = "the incredibles"
CREATE TABLE table_46408 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real )
What's the average year for the name aida-wedo dorsa with a diameter less than 450?
SELECT AVG("Year named") FROM table_46408 WHERE "Name" = 'aida-wedo dorsa' AND "Diameter (km)" < '450'
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
how many patients during this year have received a sodium, urine test?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
CREATE TABLE table_43363 ( "Competition" text, "Appearances" real, "Played" real, "Drawn" real, "Lost" real, "Goals for" real, "Goals against" real )
What is the total sum of the goals at competitions with more than 10 draws?
SELECT SUM("Goals for") FROM table_43363 WHERE "Drawn" > '10'
CREATE TABLE table_10236830_4 ( actors_name VARCHAR, nomination VARCHAR, country VARCHAR )
Which actor from Serbia was nominated for best actor in a supporting role?
SELECT actors_name FROM table_10236830_4 WHERE nomination = "Best Actor in a Supporting Role" AND country = "Serbia"
CREATE TABLE table_name_42 ( written_by VARCHAR, original_airdate VARCHAR )
Who wrote the episode that originally aired on March 1, 1998?
SELECT written_by FROM table_name_42 WHERE original_airdate = "march 1, 1998"
CREATE TABLE table_name_15 ( number VARCHAR, builder VARCHAR, works_number VARCHAR )
With a works number of 40864 for the builder of Baldwin Locomotive Works, the number listed is?
SELECT number FROM table_name_15 WHERE builder = "baldwin locomotive works" AND works_number = 40864
CREATE TABLE table_1342379_5 ( candidates VARCHAR, incumbent VARCHAR )
Who was the incumbent when henry e. barbour ran?
SELECT candidates FROM table_1342379_5 WHERE incumbent = "Henry E. Barbour"
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
Show the number of departments created in different year and bin creation time by year in a line chart, and I want to rank in ascending by the x-axis.
SELECT Creation, COUNT(Creation) FROM department ORDER BY Creation
CREATE TABLE table_name_45 ( venue VARCHAR, date VARCHAR )
Which venue was used 11 february 1996?
SELECT venue FROM table_name_45 WHERE date = "11 february 1996"
CREATE TABLE table_12149 ( "Seat" real, "Series 1" text, "Series 3" text, "Series 4" text, "Series 5" text )
What is the total number of seats with gavin duffy in series 4?
SELECT COUNT("Seat") FROM table_12149 WHERE "Series 4" = 'gavin duffy'
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 t...
what is the number of patients whose marital status is single and primary disease is hypoxia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPOXIA"
CREATE TABLE table_1140114_5 ( winning_driver VARCHAR, circuit VARCHAR )
Which driver won at the Sachsenring circuit?
SELECT winning_driver FROM table_1140114_5 WHERE circuit = "Sachsenring"
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange ...
NoSQL datastore questions by year.
SELECT Tags.TagName, YEAR(DATE(Posts.CreationDate)) AS year, COUNT(Posts.Id) FROM Tags, PostTags, Posts WHERE Tags.TagName IN ('cassandra') AND Tags.Id = PostTags.TagId AND PostTags.PostId = Posts.Id AND Posts.CreationDate > '2013-01-01' AND Posts.CreationDate < '2021-01-01' GROUP BY Tags.TagName, YEAR(DATE(Posts.Creat...
CREATE TABLE table_2401 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Sun Devils points" real, "Opponents" real, "Record" text )
How many opponents did the Sun Devils play when they scored 41 points?
SELECT COUNT("Opponent") FROM table_2401 WHERE "Sun Devils points" = '41'
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id...
what was the highest three diagnosis, which had the highest three year mortality rate?
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...
CREATE TABLE table_name_12 ( agg VARCHAR, team_1 VARCHAR )
Name the agg for seba united
SELECT agg FROM table_name_12 WHERE team_1 = "seba united"
CREATE TABLE table_name_20 ( attendance VARCHAR, score VARCHAR )
What was the attendance when the score was 88-98?
SELECT attendance FROM table_name_20 WHERE score = "88-98"
CREATE TABLE table_77933 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
What is the name of the race on 16 september?
SELECT "Race Name" FROM table_77933 WHERE "Date" = '16 september'
CREATE TABLE table_1473672_3 ( nationality VARCHAR, nhl_team VARCHAR )
Which nationality is the player from the Philadelphia Flyers?
SELECT nationality FROM table_1473672_3 WHERE nhl_team = "Philadelphia Flyers"
CREATE TABLE table_1961 ( "Season" text, "League" text, "Division" text, "GP" real, "W" real, "L" real, "T" real, "OTL" real, "SOL" real, "Pts" real, "PCT" text, "GF" real, "GA" real, "PIM" real, "Coach(es)" text, "Result" text )
What was the minimum OTL amount?
SELECT MIN("OTL") FROM table_1961
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Select All Javascript Questions and Accepted answers.
SELECT QPosts.ViewCount, QPosts.LastActivityDate, QPosts.Title, QPosts.Id, QPosts.Body, QPosts.AcceptedAnswerId AS "answer Id", APosts.Body FROM Posts AS QPosts, Posts AS APosts, PostTags WHERE (QPosts.Id = PostTags.PostId) AND (PostTags.TagId = 3) AND (QPosts.PostTypeId = 1) AND APosts.Id = QPosts.AcceptedAnswerId LIM...
CREATE TABLE table_name_59 ( lead VARCHAR, second VARCHAR )
Who is the lead for the team with Nkeiruka Ezekh as second?
SELECT lead FROM table_name_59 WHERE second = "nkeiruka ezekh"
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE i...
what were the three most commonly prescribed medications during a year before for patients who were also prescribed with methylprednisolone sodium succ at the same time?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'methylprednisolone sodium succ' AND DATETIME(prescriptions.startd...
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, ...
what is age and days of hospital stay of subject name michelle medina?
SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.name = "Michelle Medina"
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE...
pm flights leaving SAN FRANCISCO arriving BOSTON
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 ((flight.departure_time <= 2359 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight....
CREATE TABLE table_name_54 ( year VARCHAR, stages VARCHAR )
What year was stage 8 reached?
SELECT year FROM table_name_54 WHERE stages = "8"
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...
what is marital status and age of subject name orville ford?
SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.name = "Orville Ford"
CREATE TABLE table_13399573_3 ( points_for VARCHAR, points VARCHAR )
What amount of points for were there when there was 52 points?
SELECT points_for FROM table_13399573_3 WHERE points = "52"
CREATE TABLE table_28059992_5 ( position VARCHAR, cfl_team VARCHAR )
What position did the draft pick going to saskatchewan play?
SELECT position FROM table_28059992_5 WHERE cfl_team = "Saskatchewan"
CREATE TABLE table_72254 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What season features writer Michael Poryes?
SELECT "Season #" FROM table_72254 WHERE "Written by" = 'Michael Poryes'
CREATE TABLE table_name_67 ( frequency_mhz INTEGER, call_sign VARCHAR )
Name the sum of frequency will call sign of k259aw
SELECT SUM(frequency_mhz) FROM table_name_67 WHERE call_sign = "k259aw"
CREATE TABLE table_name_81 ( operator VARCHAR, berths VARCHAR, depth__m_ VARCHAR )
Name the operator with berths more than 1 and depth of 12.5-15.5
SELECT operator FROM table_name_81 WHERE berths > 1 AND depth__m_ = "12.5-15.5"
CREATE TABLE claim_headers ( claim_header_id number, claim_status_code text, claim_type_code text, policy_id number, date_of_claim time, date_of_settlement time, amount_claimed number, amount_piad number ) CREATE TABLE customers ( customer_id number, customer_details text ) CRE...
Which claim processing stage has the most claims? Show the claim status name.
SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_train_135 ( "id" int, "loss_of_consciousness" bool, "systolic_blood_pressure_sbp" int, "head_injury" bool, "heart_disease" bool, "stroke" bool, "renal_disease" bool, "hepatic_disease" bool, "hydrocephalus" bool, "peptic_ulcer_disease" bool, "blood_glucose" ...
acute or poorly controlled medical illness: blood pressure > 180 mmhg systolic or 100 mmhg diastolic; myocardial infarction within 6 months; uncompensated congestive heart failure ( nyha class iii or iv ) , severe renal, hepatic or gastrointestinal disease that could alter drug pharmacokinetics; blood glucose > 180 mg ...
SELECT * FROM table_train_135 WHERE systolic_blood_pressure_sbp > 180 OR diastolic_blood_pressure_dbp > 100 OR myocardial_infarction = 1 OR heart_disease = 1 OR renal_disease = 1 OR hepatic_disease = 1 OR gastrointestinal_disease = 1 OR blood_glucose > 180
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
Besides a general elective , would RCSSCI 396 fulfill any requirements ?
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'RCSSCI' AND course.number = 396 AND program_course.course_id = course.course_id
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 ) C...
give me the number of patients whose insurance is government and admission location is emergency room admit?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGE...
Return a bar chart on how many students are older than 20 in each dorm?, and I want to rank in ascending by the Y.
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*)
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
give me the flights on tuesday from LOS ANGELES to PITTSBURGH
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 AN...
CREATE TABLE table_name_94 ( draws VARCHAR, losses VARCHAR, club VARCHAR )
How many draws did Mortlake have when the losses were more than 5?
SELECT COUNT(draws) FROM table_name_94 WHERE losses > 5 AND club = "mortlake"
CREATE TABLE table_28505 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
How many themes are there where the order # is 9?
SELECT COUNT("Theme") FROM table_28505 WHERE "Order #" = '9'
CREATE TABLE table_204_328 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin of\nvictory" text, "runner(s)-up" text )
what is the first tournament listed ?
SELECT "tournament" FROM table_204_328 WHERE id = 1
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, ...
provide the number of patients whose ethnicity is hispanic or latino and procedure short title is ptca?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "PTCA"
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 te...
how many patients under the age of 83 stayed in the hospital for atleast a day?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "83" AND demographic.days_stay > "0"
CREATE TABLE table_name_47 ( incumbent VARCHAR, district VARCHAR )
Which Incumbent has a District of massachusetts 8?
SELECT incumbent FROM table_name_47 WHERE district = "massachusetts 8"
CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ...
Which state spent the most revenue towards schools and whats the state average score
SELECT T2.state, T3.average_scale_score FROM finrev_fed_key_17 AS T2 JOIN finrev_fed_17 AS T1 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY SUM(T1.t_fed_rev) DESC LIMIT 1
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
Name the courses that are worth 16 credits .
SELECT DISTINCT name, number FROM course WHERE credits = 16 AND department = 'EECS'
CREATE TABLE table_14889048_2 ( draws VARCHAR, team VARCHAR )
How may draws did libertad have?
SELECT COUNT(draws) FROM table_14889048_2 WHERE team = "Libertad"
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 ) C...
how many female patients had the procedure short title parent infus nutrit sub?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Parent infus nutrit sub"
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, ...
Give me the number of the dates when the max temperature was higher than 85, and display from high to low by the Y.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) DESC
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
patient 006-98330's potassium last measured on the first hospital visit is less than the first value measured on the first hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-98330' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
CREATE TABLE table_47843 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text...
what is 2010 when 2006 is 3r?
SELECT "2010" FROM table_47843 WHERE "2006" = '3r'
CREATE TABLE table_63028 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest silver that has 57 as the total, with a bronze greater than 20?
SELECT MAX("Silver") FROM table_63028 WHERE "Total" = '57' AND "Bronze" > '20'
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
Visualize the total smallest rating of different movie title using a pie chart.
SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
what was patient 13897's daily average value of body weight until 07/2104?
SELECT AVG(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 = 13897)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
what's the number of patients who left the hospital in 2101?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2101'
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
Search: Posts by specific two Tags.
SELECT P.Id AS "post_link", P.Tags, P.CreationDate FROM Posts AS P WHERE P.AnswerCount > 0 AND P.Tags LIKE '%##Tag1##%' AND P.Tags LIKE '%##Tag2##%' ORDER BY P.CreationDate DESC LIMIT 50000
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
Plot the total number by grouped by nationality as a bar graph, I want to list by the Y in ascending.
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality ORDER BY COUNT(*)
CREATE TABLE table_24649 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
What is the average finish when winnings equals $71,200?
SELECT "Avg. Finish" FROM table_24649 WHERE "Winnings" = '$71,200'
CREATE TABLE table_name_88 ( wsu_year_s_ VARCHAR, pro_year_s_ VARCHAR )
What is WSU Year(s), when Pro Year(s) is 1974-77?
SELECT wsu_year_s_ FROM table_name_88 WHERE pro_year_s_ = "1974-77"
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
Top 2000 Stack Overflow Users From Netherlands By Reputation. Top 2000 SO users from Netherlands or Netherlands based cities.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Position, DisplayName, Reputation, WebsiteUrl, Location, WebsiteUrl, AboutMe, 'http://stackoverflow.com/users/' + CAST(Id AS TEXT(10)) AS ProfileUrl FROM Users WHERE UPPER(Location) LIKE '%NETHERLANDS%' OR UPPER(Location) LIKE '%NEDERLAND%' OR UPPER(Location) LIKE ...
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)...
Show the transaction type and the number of transactions by a bar chart, and show in descending by the transaction_type.
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
CREATE TABLE table_204_373 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text )
who is the first loser listed on this chart ?
SELECT "loser" FROM table_204_373 WHERE id = 1
CREATE TABLE table_name_97 ( ratt VARCHAR, long VARCHAR )
What is the Ratt of the year with a 78 long?
SELECT ratt FROM table_name_97 WHERE long = "78"