answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2176"
find the number of patients who were electively admitted to hospital before the year 2176.
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 text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_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 text, admittime text, dischtime text, admityear text )
SELECT english_example FROM table_name_96 WHERE variant__with_niqqud__ = "וֹ"
Give me an english example of a variant with niqqud of וֹ?
CREATE TABLE table_name_96 (english_example VARCHAR, variant__with_niqqud__ VARCHAR)
SELECT COUNT(written_by) FROM table_22570439_1 WHERE directed_by = "Wendey Stanzler"
How many written by have wendey stanzler as the director?
CREATE TABLE table_22570439_1 (written_by VARCHAR, directed_by VARCHAR)
SELECT COUNT(round) FROM table_name_64 WHERE time = "2:18"
How many rounds have a time of 2:18?
CREATE TABLE table_name_64 ( round VARCHAR, time VARCHAR )
SELECT variant__with_niqqud__ FROM table_name_77 WHERE phonetic_realisation = "[[[|v]]]"
What is the variant with niqqud for a phonetic realisation of [[[|v]]]?
CREATE TABLE table_name_77 (variant__with_niqqud__ VARCHAR, phonetic_realisation VARCHAR)
SELECT original_air_date FROM table_22570439_1 WHERE written_by = "Tracy Poust & Jon Kinnally"
What is the original air date where tracy poust & jon kinnally was written by?
CREATE TABLE table_22570439_1 (original_air_date VARCHAR, written_by VARCHAR)
SELECT name FROM Person WHERE gender = 'male' ORDER BY age
Find the name and age of all males in order of their age.
CREATE TABLE Person ( name VARCHAR, gender VARCHAR, age VARCHAR )
SELECT phonetic_realisation FROM table_name_61 WHERE without_niqqud = "as final letter: ו or יו"
If a variant without niqqud is as final letter: ו or יו, what is the phonetic realisation?
CREATE TABLE table_name_61 (phonetic_realisation VARCHAR, without_niqqud VARCHAR)
SELECT written_by FROM table_22570439_1 WHERE directed_by = "Mark Worthington"
Who is the written by when mark worthington is the director?
CREATE TABLE table_22570439_1 (written_by VARCHAR, directed_by VARCHAR)
SELECT MIN("Wins") FROM table_55111 WHERE "Rank" < '3' AND "Events" > '10'
Who has the least wins when ranked above 3 with over 10 events?
CREATE TABLE table_55111 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
SELECT position FROM table_name_96 WHERE pick = 113
What position does pick 113 play?
CREATE TABLE table_name_96 (position VARCHAR, pick VARCHAR)
SELECT reporters FROM table_22583466_5 WHERE year = 1976
In 1976, who was the reporter for the Belmont Stakes?
CREATE TABLE table_22583466_5 (reporters VARCHAR, year VARCHAR)
SELECT COUNT(number) FROM table_name_52 WHERE born = "1368"
How many people were born in 1368?
CREATE TABLE table_name_52 ( number VARCHAR, born VARCHAR )
SELECT school FROM table_name_7 WHERE pick > 225 AND player = "victor jones"
What is the school of Victor Jones, who was picked further than number 225?
CREATE TABLE table_name_7 (school VARCHAR, pick VARCHAR, player VARCHAR)
SELECT race_caller FROM table_22583466_5 WHERE year = 1978
Who called the race in 1978?
CREATE TABLE table_22583466_5 (race_caller VARCHAR, year VARCHAR)
SELECT COUNT(trophy_presentation) FROM table_22514845_4 WHERE year = 1987
How many trophy presentations where in the year 1987?
CREATE TABLE table_22514845_4 ( trophy_presentation VARCHAR, year VARCHAR )
SELECT COUNT(pick) FROM table_name_68 WHERE school = "virginia tech"
What is the total pick number of Virginia Tech?
CREATE TABLE table_name_68 (pick VARCHAR, school VARCHAR)
SELECT s_host FROM table_22583466_5 WHERE race_caller = "Marshall Cassidy"
For the race called by Marshall Cassidy, who was the host?
CREATE TABLE table_22583466_5 (s_host VARCHAR, race_caller VARCHAR)
SELECT "nation" FROM table_204_231 ORDER BY "silver" DESC LIMIT 1
which nation won the most silver medals ?
CREATE TABLE table_204_231 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT position FROM table_name_57 WHERE school = "north carolina"
What is the position of a player from North Carolina?
CREATE TABLE table_name_57 (position VARCHAR, school VARCHAR)
SELECT reporters FROM table_22583466_5 WHERE year = 1977
Who were the reporters for the 1977 Belmont Stakes?
CREATE TABLE table_22583466_5 (reporters VARCHAR, year VARCHAR)
SELECT "player" FROM table_204_635 WHERE "college" = 'clemson'
who was the only draftee to come from clemson ?
CREATE TABLE table_204_635 ( id number, "round" number, "selection" number, "player" text, "position" text, "college" text )
SELECT home_team AS score FROM table_name_4 WHERE home_team = "st kilda"
What is the home team score of St Kilda?
CREATE TABLE table_name_4 (home_team VARCHAR)
SELECT race_caller FROM table_22583466_3 WHERE year = 1998
Who called the race in 1998?
CREATE TABLE table_22583466_3 (race_caller VARCHAR, year VARCHAR)
SELECT date FROM table_name_26 WHERE week > 3 AND result = "w 28-27"
Tell me the date that has a week larger than 3 and a result of w 28-27
CREATE TABLE table_name_26 ( date VARCHAR, week VARCHAR, result VARCHAR )
SELECT date FROM table_name_19 WHERE home_team = "collingwood"
What is the date for home team Collingwood?
CREATE TABLE table_name_19 (date VARCHAR, home_team VARCHAR)
SELECT 2007 AS _2008 FROM table_22591910_4 WHERE position = 3
who was position 3 in 2007-2008?
CREATE TABLE table_22591910_4 (position VARCHAR)
SELECT course_name FROM courses ORDER BY course_name
What are the names of the courses in alphabetical order?
CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE people ( person_id number, first_name text, middle_name text, last_name text, cell_mobile_number text, email_address text, login_name text, password text ) CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE student_course_registrations ( student_id number, course_id number, registration_date time ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outcome_code text ) CREATE TABLE student_course_attendance ( student_id number, course_id number, date_of_attendance time )
SELECT home_team AS score FROM table_name_52 WHERE home_team = "st kilda"
What is the home team score for St Kilda?
CREATE TABLE table_name_52 (home_team VARCHAR)
SELECT standing FROM table_2259285_1 WHERE goals_against = 279
What was the standing when goal against were 279?
CREATE TABLE table_2259285_1 (standing VARCHAR, goals_against VARCHAR)
SELECT "Extra" FROM table_15801 WHERE "Tournament" = 'commonwealth games'
What was the extra info for the Commonwealth Games?
CREATE TABLE table_15801 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
SELECT named AS after FROM table_name_97 WHERE diameter__km_ < 19.2 AND latitude > -37.5 AND longitude < 67.3
Tell me the named after for diameter less than 19.2 and latitude more than -37.5 with longitude less than 67.3
CREATE TABLE table_name_97 (named VARCHAR, longitude VARCHAR, diameter__km_ VARCHAR, latitude VARCHAR)
SELECT winning_pct__percentage FROM table_2259285_1 WHERE goals_for = 229
What is the winning pct % if the goal for are 229?
CREATE TABLE table_2259285_1 (winning_pct__percentage VARCHAR, goals_for VARCHAR)
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700
Show me about the distribution of meter_700 and meter_100 in a bar chart, could you sort by the meter_700 in asc?
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text )
SELECT named AS after FROM table_name_61 WHERE latitude = 6.4
Tell me the named for latitude of 6.4
CREATE TABLE table_name_61 (named VARCHAR, latitude VARCHAR)
SELECT winning_pct__percentage FROM table_2259285_1 WHERE goals_for = 322
What was the winning % when there were 322 goals?
CREATE TABLE table_2259285_1 (winning_pct__percentage VARCHAR, goals_for VARCHAR)
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-10988')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY diagnosis.diagnosistime LIMIT 1
this year, patient 025-10988 was diagnosed for the first time with what?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
SELECT name FROM table_name_80 WHERE longitude > 103.8 AND latitude = -11.4
Tell me the name for longitude more than 103.8 and latitude of -11.4
CREATE TABLE table_name_80 (name VARCHAR, longitude VARCHAR, latitude VARCHAR)
SELECT year FROM table_225880_1 WHERE runner_s__up = "Willie Goggin"
Name the year for willie goggin
CREATE TABLE table_225880_1 (year VARCHAR, runner_s__up VARCHAR)
SELECT diagnoses.icd9_code, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kenneth Koeller"
for patient kenneth koeller, specify diagnosis icd9 code with short title
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 text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid 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 )
SELECT SUM(longitude) FROM table_name_65 WHERE diameter__km_ = 22.6 AND latitude < -12.4
Tell me the sum of longitude for diameter being 22.6 and latitude less than -12.4
CREATE TABLE table_name_65 (longitude INTEGER, diameter__km_ VARCHAR, latitude VARCHAR)
SELECT winning_score FROM table_225880_1 WHERE championship = "PGA championship"
Name the winning score for pga championship
CREATE TABLE table_225880_1 (winning_score VARCHAR, championship VARCHAR)
SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
What are the actual delivery dates of orders with quantity 1?
CREATE TABLE Customer_Orders ( Actual_Delivery_Date VARCHAR, Order_ID VARCHAR ) CREATE TABLE ORDER_ITEMS ( Order_ID VARCHAR, Order_Quantity VARCHAR )
SELECT overall FROM table_name_48 WHERE nationality = "united states" AND player = "doug sproule"
What was the overall pick for Doug Sproule of the United States?
CREATE TABLE table_name_48 (overall VARCHAR, nationality VARCHAR, player VARCHAR)
SELECT MIN(year) FROM table_225880_1 WHERE runner_s__up = "Walter Hagen"
Name the least year for walter hagen
CREATE TABLE table_225880_1 (year INTEGER, runner_s__up VARCHAR)
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team
Show the number of games for each home team in a bar chart, and list by the X in ascending.
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text )
SELECT MIN(viewers__m_) FROM table_name_69 WHERE share > 13
what is the lowest viewers (m) when the share is more than 13?
CREATE TABLE table_name_69 (viewers__m_ INTEGER, share INTEGER)
SELECT score_in_the_final FROM table_22597626_17 WHERE opponents_in_the_final = "Fitzgerald Vilas"
What was the score in the final where one of the opponents in the final was fitzgerald vilas?
CREATE TABLE table_22597626_17 (score_in_the_final VARCHAR, opponents_in_the_final VARCHAR)
SELECT constructor FROM table_name_24 WHERE location = "long beach"
Who was the Long Beach constructor?
CREATE TABLE table_name_24 ( constructor VARCHAR, location VARCHAR )
SELECT AVG(rating) FROM table_name_46 WHERE air_date = "november 23, 2007"
what is the average rating when the air date is november 23, 2007?
CREATE TABLE table_name_46 (rating INTEGER, air_date VARCHAR)
SELECT surface FROM table_22597626_17 WHERE opponents_in_the_final = "Fitzgerald Vilas"
What was the surface for the opponents in the final with fitzgerald vilas?
CREATE TABLE table_22597626_17 (surface VARCHAR, opponents_in_the_final VARCHAR)
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.sao2 IS NULL ORDER BY vitalperiodic.observationtime DESC LIMIT 1) - (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.sao2 IS NULL ORDER BY vitalperiodic.observationtime DESC LIMIT 1 OFFSET 1)
what was the difference of sao2 of patient 021-111547 last measured on the current intensive care unit visit compared to the second to last value measured on the current intensive care unit visit?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
SELECT COUNT(viewers__m_) FROM table_name_12 WHERE rating = 6.4 AND share > 11
what is the total viewers (m) when the rating is 6.4 and the share is more than 11?
CREATE TABLE table_name_12 (viewers__m_ VARCHAR, rating VARCHAR, share VARCHAR)
SELECT opponents_in_the_final FROM table_22597626_17 WHERE score_in_the_final = "6–4, 7–6 2"
Who were the opponents in the final where the score in the final is 6–4, 7–6 2?
CREATE TABLE table_22597626_17 (opponents_in_the_final VARCHAR, score_in_the_final VARCHAR)
SELECT AVG("Attendance") FROM table_67211 WHERE "Date" = 'april 4'
What is the average attendance for the date of april 4?
CREATE TABLE table_67211 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT written_by FROM table_name_58 WHERE directed_by = "terry ingram"
Who wrote the episode that was directed by Terry Ingram?
CREATE TABLE table_name_58 (written_by VARCHAR, directed_by VARCHAR)
SELECT COUNT(partner) FROM table_22597626_17 WHERE opponents_in_the_final = "Forget Leconte"
What was the partner count when the opponents in the final was forget leconte?
CREATE TABLE table_22597626_17 (partner VARCHAR, opponents_in_the_final VARCHAR)
SELECT "Status" FROM table_67436 WHERE "Name" = 'joon-hyung park 박준형'
What was the status of joon-hyung park ?
CREATE TABLE table_67436 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text )
SELECT title FROM table_name_38 WHERE directed_by = "roy dupuis"
What is the title of the episode that was directed by Roy Dupuis?
CREATE TABLE table_name_38 (title VARCHAR, directed_by VARCHAR)
SELECT MIN(year) FROM table_22597626_17 WHERE opponents_in_the_final = "Bahrami Leconte" AND score_in_the_final = "7–6 2 , 6–1"
What was the year date when one of the opponents in the final was bahrami leconte and score in the final is 7–6 2 , 6–1?
CREATE TABLE table_22597626_17 (year INTEGER, opponents_in_the_final VARCHAR, score_in_the_final VARCHAR)
SELECT "Venue" FROM table_58132 WHERE "Away team score" = '12.13 (85)'
Where did the away team play when they scored 12.13 (85)?
CREATE TABLE table_58132 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT directed_by FROM table_name_10 WHERE original_airdate = "february 25, 2001"
Who directed the episode that originally aired on February 25, 2001?
CREATE TABLE table_name_10 (directed_by VARCHAR, original_airdate VARCHAR)
SELECT COUNT(year) FROM table_22597626_6 WHERE score_in_the_final = "6–3, 6–2, 6–4"
Name the number of year for score being 6–3, 6–2, 6–4
CREATE TABLE table_22597626_6 (year VARCHAR, score_in_the_final VARCHAR)
SELECT ParentId AS "Post Link", OwnerUserId AS "User Link", COUNT(*) AS "Number of Answers" FROM Posts WHERE ParentId > 0 AND OwnerUserId > 0 AND Score > 0 AND NOT (Title LIKE '%best%') AND NOT (Title LIKE '%worst%') AND NOT (Title LIKE '%hidden%') GROUP BY ParentId, OwnerUserId HAVING COUNT(*) >= 2 ORDER BY COUNT(*) DESC
Questions with multiple upvoted answers by the same user.
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) 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 Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
SELECT episode__number FROM table_name_95 WHERE original_airdate = "january 21, 2001"
What is the episode # of the episode that originally aired on January 21, 2001?
CREATE TABLE table_name_95 (episode__number VARCHAR, original_airdate VARCHAR)
SELECT surface FROM table_22597626_6 WHERE score_in_the_final = "6–0, 6–3"
Name the surface for 6–0, 6–3
CREATE TABLE table_22597626_6 (surface VARCHAR, score_in_the_final VARCHAR)
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location
Give the proportion of the number of locations of all wrestlers with a pie chart.
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
SELECT directed_by FROM table_name_21 WHERE episode__number = "92 (4)"
Who directed episode # 92 (4)?
CREATE TABLE table_name_21 (directed_by VARCHAR, episode__number VARCHAR)
SELECT championship FROM table_22597626_6 WHERE opponent_in_the_final = "Peter McNamara"
Name the championship for peter mcnamara
CREATE TABLE table_22597626_6 (championship VARCHAR, opponent_in_the_final VARCHAR)
SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1
Show the most common builder of railways.
CREATE TABLE railway ( Builder VARCHAR )
SELECT stream_s__and___or_lake_s_ FROM table_name_42 WHERE date_founded = 1959
what is the stream(s) and / or lake(s) when the date founded is 1959?
CREATE TABLE table_name_42 (stream_s__and___or_lake_s_ VARCHAR, date_founded VARCHAR)
SELECT championship FROM table_22597626_6 WHERE year = 1980 AND surface = "Hard"
Name the championship for 1980 hard surface
CREATE TABLE table_22597626_6 (championship VARCHAR, year VARCHAR, surface VARCHAR)
SELECT MIN(year_opened) FROM table_1942683_1
What is the earliest year a house opened?
CREATE TABLE table_1942683_1 ( year_opened INTEGER )
SELECT area_in_acres__ha_ FROM table_name_20 WHERE park_name = "bald eagle state park"
What is the area in acres (ha) for the park bald eagle state park?
CREATE TABLE table_name_20 (area_in_acres__ha_ VARCHAR, park_name VARCHAR)
SELECT race_time FROM table_2260452_1 WHERE team = "Billy Ballew Motorsports"
If the team is Billy Ballew Motorsports, what is the race time?
CREATE TABLE table_2260452_1 (race_time VARCHAR, team VARCHAR)
SELECT MAX(age) FROM table_22447251_2 WHERE contestant = "Valerie Chardonnens Vargas"
How old is contestant Valerie Chardonnens Vargas?
CREATE TABLE table_22447251_2 ( age INTEGER, contestant VARCHAR )
SELECT MAX(date_founded) FROM table_name_6 WHERE county_or_counties = "elk county"
what is the most recent date founded in elk county?
CREATE TABLE table_name_6 (date_founded INTEGER, county_or_counties VARCHAR)
SELECT date FROM table_2260452_1 WHERE driver = "Robert Pressley"
What was the date if the driver was Robert Pressley?
CREATE TABLE table_2260452_1 (date VARCHAR, driver VARCHAR)
SELECT AVG(slalom) FROM table_name_5 WHERE average > 99.25
What's the slalom when the average time was greater than 99.25?
CREATE TABLE table_name_5 ( slalom INTEGER, average INTEGER )
SELECT COUNT(date_founded) FROM table_name_77 WHERE park_name = "beltzville state park"
how many parks are name beltzville state park?
CREATE TABLE table_name_77 (date_founded VARCHAR, park_name VARCHAR)
SELECT average_speed__mph_ FROM table_2260452_1 WHERE race_time = "2:00:33"
If the race time is 2:00:33, what is the average speed?
CREATE TABLE table_2260452_1 (average_speed__mph_ VARCHAR, race_time VARCHAR)
SELECT position FROM table_2897457_1 WHERE player = "Olaf Kolzig"
What position does Olaf Kolzig play?
CREATE TABLE table_2897457_1 ( position VARCHAR, player VARCHAR )
SELECT AVG(rank) FROM table_name_23 WHERE total < 1
Which rank has a total smaller than 1?
CREATE TABLE table_name_23 (rank INTEGER, total INTEGER)
SELECT 1982 AS _83 FROM table_22606461_10 WHERE rank = 1
What is every entry for 1982-83 for rank 1?
CREATE TABLE table_22606461_10 (rank VARCHAR)
SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code
What is the average price of the products for each category?
CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discontinued time, product_name text, product_description text, product_price number ) CREATE TABLE complaints ( complaint_id number, product_id number, customer_id number, complaint_outcome_code text, complaint_status_code text, complaint_type_code text, date_complaint_raised time, date_complaint_closed time, staff_id number ) CREATE TABLE customers ( customer_id number, customer_type_code text, address_line_1 text, address_line_2 text, town_city text, state text, email_address text, phone_number text ) CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text )
SELECT year FROM table_name_47 WHERE english_title = "the ocean"
What is the year for the ocean?
CREATE TABLE table_name_47 (year VARCHAR, english_title VARCHAR)
SELECT COUNT(height) FROM table_22603701_1 WHERE position = "WR" AND name = "Jesse Holley"
How many heights are listed for Jesse Holley in the WR position?
CREATE TABLE table_22603701_1 (height VARCHAR, position VARCHAR, name VARCHAR)
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int insert dual-cham dev') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 = 2
how many patients have received a int insert dual-cham dev procedure two times during this year?
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 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_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
SELECT representing FROM table_name_59 WHERE original_title = "om fjorten dage"
Name the representation for om fjorten dage
CREATE TABLE table_name_59 (representing VARCHAR, original_title VARCHAR)
SELECT result FROM table_22603701_1 WHERE college = "Wisconsin"
What is the result for Wisconsin?
CREATE TABLE table_22603701_1 (result VARCHAR, college VARCHAR)
SELECT COUNT("party") FROM table_203_316 WHERE "diet representation\ncouncillors" = 0
how many of these parties currently have no councillors ?
CREATE TABLE table_203_316 ( id number, "party" text, "diet representation\nrepresentatives" number, "diet representation\ncouncillors" number, "party leader(s)" text, "comments" text )
SELECT representing FROM table_name_35 WHERE original_title = "englar alheimsins"
Name the representing for englar alheimsins
CREATE TABLE table_name_35 (representing VARCHAR, original_title VARCHAR)
SELECT result FROM table_22603701_1 WHERE name = "Steve Gonzalez"
What is the result for Steve Gonzalez?
CREATE TABLE table_22603701_1 (result VARCHAR, name VARCHAR)
SELECT player FROM table_name_16 WHERE years_in_orlando = "2005"
Who was the Player that spent the Year 2005 in Orlando?
CREATE TABLE table_name_16 ( player VARCHAR, years_in_orlando VARCHAR )
SELECT original_title FROM table_name_53 WHERE year < 1977 AND author = "lagercrantz olof lagercrantz"
Name the original title for years before 1977 and author of lagercrantz olof lagercrantz
CREATE TABLE table_name_53 (original_title VARCHAR, year VARCHAR, author VARCHAR)
SELECT position FROM table_22603701_1 WHERE college = "Menlo college"
What are the positions for Menlo College?
CREATE TABLE table_22603701_1 (position VARCHAR, college VARCHAR)
SELECT pos FROM table_name_20 WHERE from_club = "cska moscow"
What is Pos., when From Club is 'CSKA Moscow'?
CREATE TABLE table_name_20 ( pos VARCHAR, from_club VARCHAR )
SELECT representing FROM table_name_82 WHERE original_title = "ingenjör andrées luftfärd"
Name the representating for ingenjör andrées luftfärd
CREATE TABLE table_name_82 (representing VARCHAR, original_title VARCHAR)
SELECT features FROM table_2263152_1 WHERE security_issues = "98-004" AND distribution_mechanism = "Microsoft website"
If the distribution mechanism is the Microsoft website and the security issues id 98-004, what are all of the features?
CREATE TABLE table_2263152_1 (features VARCHAR, security_issues VARCHAR, distribution_mechanism VARCHAR)
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
Return the average price for each product type Visualize by bar chart, I want to display by the x axis in descending.
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) )