answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT d_42 FROM table_name_17 WHERE d_50 = "d 31"
What is the D 42 when the D 50 is d 31?
CREATE TABLE table_name_17 (d_42 VARCHAR, d_50 VARCHAR)
SELECT MAX(matches) FROM table_21486890_1 WHERE name = "Mark Taylor Category:Articles with hCards"
Name the matches for mark taylor category:articles with hcards
CREATE TABLE table_21486890_1 (matches INTEGER, name VARCHAR)
SELECT COUNT("Nationality") FROM table_23126 WHERE "Player" = 'Tom Colley'
How many nationalities does Tom Colley have?
CREATE TABLE table_23126 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
SELECT d_50 FROM table_name_84 WHERE d_41 = "d 41"
What is the D 50 when the D 41 is d 41?
CREATE TABLE table_name_84 (d_50 VARCHAR, d_41 VARCHAR)
SELECT MAX(runs_scored) FROM table_21486890_1
Name the most runs scored
CREATE TABLE table_21486890_1 (runs_scored INTEGER)
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2115"
what is the average age of patients with white ethnicity and admitted in or after 2115?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug 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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT d_50 FROM table_name_65 WHERE d_41 = "d 41"
What is the D 50 when the D 41 is d 41?
CREATE TABLE table_name_65 (d_50 VARCHAR, d_41 VARCHAR)
SELECT MIN(matches) FROM table_21486890_1 WHERE not_out = 44
Name the least matches for not out being 44
CREATE TABLE table_21486890_1 (matches INTEGER, not_out VARCHAR)
SELECT MIN(first_downs) FROM table_14877831_2 WHERE attendance = 13196
How many first downs were there when the attendance was 13196?
CREATE TABLE table_14877831_2 ( first_downs INTEGER, attendance VARCHAR )
SELECT yard_name FROM table_name_19 WHERE ship_types_delivered = "n3 type, v4 type" AND total_vessels_built_for_usmc = "13 ships for usmc"
what is the yard name when the ship types delivered is n3 type, v4 type and the total vessels built for usmc is 13 ships for usmc?
CREATE TABLE table_name_19 (yard_name VARCHAR, ship_types_delivered VARCHAR, total_vessels_built_for_usmc VARCHAR)
SELECT nation FROM table_2150068_1 WHERE satellite = "PAGEOS 1"
What nation was Pageos 1 from?
CREATE TABLE table_2150068_1 (nation VARCHAR, satellite VARCHAR)
SELECT SUM(points) FROM table_name_40 WHERE played < 18
What is the sum of all points when number played is less than 18?
CREATE TABLE table_name_40 ( points INTEGER, played INTEGER )
SELECT ship_types_delivered FROM table_name_21 WHERE total_vessels_built_for_usmc = "13 ships for usmc (plus 37 more for usn)"
what is the ship types delivered when the total vessels built for usmc is 13 ships for usmc (plus 37 more for usn)?
CREATE TABLE table_name_21 (ship_types_delivered VARCHAR, total_vessels_built_for_usmc VARCHAR)
SELECT launch_date__utc_ FROM table_2150068_1 WHERE usage = "ado" AND mass_kg_ = "4" AND diameter_m_ = "3"
What was the launch date for the sattelite with ado that was 4 kg and 3 meters in diameter?
CREATE TABLE table_2150068_1 (launch_date__utc_ VARCHAR, diameter_m_ VARCHAR, usage VARCHAR, mass_kg_ VARCHAR)
SELECT round FROM table_name_32 WHERE opposition = "adelaide united" AND attendance = "18,345"
What round was adelaide united the opposition with an attendance of 18,345?
CREATE TABLE table_name_32 ( round VARCHAR, opposition VARCHAR, attendance VARCHAR )
SELECT co_drivers FROM table_name_43 WHERE year > 1994 AND class = "wsc"
Who were the co drivers past 1994 in the WSC class?
CREATE TABLE table_name_43 (co_drivers VARCHAR, year VARCHAR, class VARCHAR)
SELECT decay FROM table_2150068_1 WHERE mass_kg_ = "180"
What was the decay for the sattelite that was 180 kg?
CREATE TABLE table_2150068_1 (decay VARCHAR, mass_kg_ VARCHAR)
SELECT "Date" FROM table_6223 WHERE "Game site" = 'shea stadium' AND "Week" < '10' AND "Opponent" = 'baltimore colts'
Game site of shea stadium, and a Week smaller than 10, and a Opponent of baltimore colts happened on what date?
CREATE TABLE table_6223 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real )
SELECT date FROM table_name_20 WHERE home_team = "footscray"
What day did Footscray play as the home team?
CREATE TABLE table_name_20 (date VARCHAR, home_team VARCHAR)
SELECT nssdc_id FROM table_2150068_1 WHERE satellite = "Echo 1"
What is the nssdc id for Echo 1?
CREATE TABLE table_2150068_1 (nssdc_id VARCHAR, satellite VARCHAR)
SELECT "Home team score" FROM table_11471 WHERE "Venue" = 'lake oval'
When the game was played at the Venue of Lake Oval, what was the home team score?
CREATE TABLE table_11471 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT report FROM table_name_13 WHERE date = "10 october"
What is the report for 10 october?
CREATE TABLE table_name_13 (report VARCHAR, date VARCHAR)
SELECT launch_date__utc_ FROM table_2150068_1 WHERE nssdc_id = "1960-009A"
What is the launch date for the sattelite with a nssdc id of 1960-009a?
CREATE TABLE table_2150068_1 (launch_date__utc_ VARCHAR, nssdc_id VARCHAR)
SELECT COUNT(podiums) FROM table_name_93 WHERE class = "total"
If the class is total, what is the total number of podiums?
CREATE TABLE table_name_93 ( podiums VARCHAR, class VARCHAR )
SELECT race AS Winner FROM table_name_58 WHERE pole_position = "james hunt" AND fastest_lap = "james hunt" AND date = "15 august"
Who was the race winner with a pole position james hunt, and a Fastest Lap of james hunt, and a Date of 15 august?
CREATE TABLE table_name_58 (race VARCHAR, date VARCHAR, pole_position VARCHAR, fastest_lap VARCHAR)
SELECT decay FROM table_2150068_1 WHERE nssdc_id = "1990-081C"
What is the decay for the sattelite with an id that is 1990-081c?
CREATE TABLE table_2150068_1 (decay VARCHAR, nssdc_id VARCHAR)
SELECT team FROM table_name_58 WHERE qual_2 < 59.612 AND best = 59.14
Which team has a qualifying 2 time under 59.612 and a best of 59.14?
CREATE TABLE table_name_58 ( team VARCHAR, qual_2 VARCHAR, best VARCHAR )
SELECT race FROM table_name_25 WHERE pole_position = "jacques laffite"
What race has a Pole Position of Jacques Laffite?
CREATE TABLE table_name_25 (race VARCHAR, pole_position VARCHAR)
SELECT COUNT(song_title) FROM table_21500850_1 WHERE artist = "Ratt"
How many song titles belong to the artist Ratt?
CREATE TABLE table_21500850_1 (song_title VARCHAR, artist VARCHAR)
SELECT hometown FROM table_11677100_11 WHERE player = "Jay Bruce"
What is Jay Bruce's hometown?
CREATE TABLE table_11677100_11 ( hometown VARCHAR, player VARCHAR )
SELECT pole_position FROM table_name_95 WHERE race = "swedish grand prix"
What is the Pole Position of the Swedish Grand Prix?
CREATE TABLE table_name_95 (pole_position VARCHAR, race VARCHAR)
SELECT original_game FROM table_21500850_1 WHERE artist = "Lynyrd Skynyrd"
What is every original game for the artist Lynyrd Skynyrd?
CREATE TABLE table_21500850_1 (original_game VARCHAR, artist VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Levofloxacin"
how many patients whose death status is 1 and drug name is levofloxacin?
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT date FROM table_name_72 WHERE location = "zandvoort"
What was the date when the location was Zandvoort?
CREATE TABLE table_name_72 (date VARCHAR, location VARCHAR)
SELECT song_title FROM table_21500850_1 WHERE genre = "Rock" AND original_game = "Guitar Hero" AND artist = "Queens of the Stone Age"
What is every song title for the rock genre and Guitar Hero as original game and the artist is Queens of the Stone Age?
CREATE TABLE table_21500850_1 (song_title VARCHAR, artist VARCHAR, genre VARCHAR, original_game VARCHAR)
SELECT COUNT(wins) FROM table_19864214_3 WHERE pitcher = "Jon Matlack Category:Articles with hCards"
how many wins did pitcher jon matlack category:articles with hcards achieve
CREATE TABLE table_19864214_3 ( wins VARCHAR, pitcher VARCHAR )
SELECT COUNT(chapters) FROM table_name_86 WHERE director = "elmer clifton"
How many chapters did Elmer Clifton direct?
CREATE TABLE table_name_86 (chapters VARCHAR, director VARCHAR)
SELECT song_title FROM table_21500850_1 WHERE year = 2007
What is every song title for 2007?
CREATE TABLE table_21500850_1 (song_title VARCHAR, year VARCHAR)
SELECT "Week 15 (Final) Dec 3" FROM table_58979 WHERE "Week 12 Nov 13" = 'washington (9-1)'
What was Week 15 when Week 12 was Washington (9-1)?
CREATE TABLE table_58979 ( "Week 9 Oct 23" text, "Week 10 Oct 30" text, "Week 11 Nov 6" text, "Week 12 Nov 13" text, "Week 13 Nov 20" text, "Week 14 Nov 27" text, "Week 15 (Final) Dec 3" text )
SELECT spouse FROM table_name_54 WHERE father = "ferdinand i of the two sicilies"
Who is the spouse of the queen who is the daughter of Ferdinand I of the two sicilies?
CREATE TABLE table_name_54 (spouse VARCHAR, father VARCHAR)
SELECT song_choice FROM table_21501511_1 WHERE week__number = "Top 13"
What was Lambert's song choice in the top 13?
CREATE TABLE table_21501511_1 (song_choice VARCHAR, week__number VARCHAR)
SELECT "2003" FROM table_41429 WHERE "Tournament" = 'us open'
What is the result from 2003 from the US Open?
CREATE TABLE table_41429 ( "Tournament" text, "2003" text, "2004" text, "2012" text, "2013" text )
SELECT entered_service FROM table_name_29 WHERE serial_no = "85-1222"
What is the entered service date for serial number 85-1222?
CREATE TABLE table_name_29 (entered_service VARCHAR, serial_no VARCHAR)
SELECT order__number FROM table_21501511_1 WHERE week__number = "Top 11"
What order did Lambert perform in the top 11?
CREATE TABLE table_21501511_1 (order__number VARCHAR, week__number VARCHAR)
SELECT "Status" FROM table_40089 WHERE "Name" = 'cathayopterus'
What is the status of the pterosaur named Cathayopterus?
CREATE TABLE table_40089 ( "Name" text, "Status" text, "Authors" text, "Unit" text, "Location" text )
SELECT locomotive FROM table_name_44 WHERE name = "city of benalla"
What is the locomotive for the city of Benalla?
CREATE TABLE table_name_44 (locomotive VARCHAR, name VARCHAR)
SELECT week__number FROM table_21501511_1 WHERE theme = "Disco"
What week was themed disco?
CREATE TABLE table_21501511_1 (week__number VARCHAR, theme VARCHAR)
SELECT "Date" FROM table_39692 WHERE "Record" = '9-3'
When was the game with a record of 9-3?
CREATE TABLE table_39692 ( "Date" text, "Opponent" text, "Result" text, "Game site" text, "Game time" text, "Record" text )
SELECT name FROM table_name_95 WHERE locomotive = "n464"
What is the name for the locomotive n464?
CREATE TABLE table_name_95 (name VARCHAR, locomotive VARCHAR)
SELECT week__number FROM table_21501564_1 WHERE original_artist = "Sara Bareilles"
What week #(s featured sara bareilles as the original artist?
CREATE TABLE table_21501564_1 (week__number VARCHAR, original_artist VARCHAR)
SELECT COUNT("Snatch") FROM table_78258 WHERE "Total" < '267.5'
How many snatches were there with a total of 267.5?
CREATE TABLE table_78258 ( "Athlete" text, "Event" text, "Snatch" real, "Clean & Jerk" real, "Total" real )
SELECT name FROM table_name_9 WHERE locomotive = "n474"
What is the name for the locomotive n474?
CREATE TABLE table_name_9 (name VARCHAR, locomotive VARCHAR)
SELECT week__number FROM table_21501564_1 WHERE theme = "First Solo"
What week # featured first solo as the theme?
CREATE TABLE table_21501564_1 (week__number VARCHAR, theme VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2078"
what number of patients whose admission type is elective were born before the year 2078?
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_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 home_team AS score FROM table_name_40 WHERE venue = "windy hill"
What is the home team score at windy hill?
CREATE TABLE table_name_40 (home_team VARCHAR, venue VARCHAR)
SELECT COUNT(theme) FROM table_21501564_1 WHERE original_artist = "Duffy"
How many weeks featured duffy as the original artist?
CREATE TABLE table_21501564_1 (theme VARCHAR, original_artist VARCHAR)
WITH c AS (SELECT OwnerUserId, Body, 1 AS t FROM Posts WHERE CreationDate >= 'August 13, 2010') SELECT OwnerUserId AS "user_link", SUM(t) AS Count FROM c WHERE Body LIKE '%imgur.com%' GROUP BY OwnerUserId WITH ROLLUP ORDER BY SUM(t) DESC
How many images have been uploaded to the site?. Counts the number of posts containing images hosted by imgur.com after image uploading was implemented on the site.
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 PostTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) 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 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 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) 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 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 ReviewTaskTypes ( Id number, Name text, Description text ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
SELECT MAX(crowd) FROM table_name_32 WHERE away_team = "st kilda"
What is the largest crowd for an Away team of st kilda?
CREATE TABLE table_name_32 (crowd INTEGER, away_team VARCHAR)
SELECT original_artist FROM table_21501564_1 WHERE result = "Selected"
Who was the originally artist when Jasmine Murray was selected?
CREATE TABLE table_21501564_1 (original_artist VARCHAR, result VARCHAR)
SELECT AVG("Number of electorates (2003)") FROM table_64041 WHERE "Reserved for ( SC / ST /None)" = 'sc' AND "Constituency number" = '50'
What is the average number of electorates (2003) reserved for sc with a constituency number of 50?
CREATE TABLE table_64041 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2003)" real )
SELECT played_in FROM table_name_55 WHERE points_for = "119"
Where was the match that had 119 points for played?
CREATE TABLE table_name_55 (played_in VARCHAR, points_for VARCHAR)
SELECT song_choice FROM table_21501565_1 WHERE theme = "Year They Were Born"
With theme the Year They Were Born, what is the song of choice?
CREATE TABLE table_21501565_1 (song_choice VARCHAR, theme VARCHAR)
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-149724' AND patient.wardid = 957 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
how many days has it been since the last time patient 027-149724 stayed on this hospital visit in the ward 957?
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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
SELECT played_in FROM table_name_36 WHERE matches = "16"
Where were 16 matches played?
CREATE TABLE table_name_36 (played_in VARCHAR, matches VARCHAR)
SELECT original_artist FROM table_21501565_1 WHERE order__number = "7" AND theme = "Motown"
With order number 7 and the theme is Motown, who were the original artists?
CREATE TABLE table_21501565_1 (original_artist VARCHAR, order__number VARCHAR, theme VARCHAR)
SELECT "Score" FROM table_61414 WHERE "Attendance" > '16,851' AND "Away team" = 'sheffield united'
Which Score has an Attendance larger than 16,851, and an Away team of sheffield united?
CREATE TABLE table_61414 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
SELECT matches FROM table_name_81 WHERE points_for = "240"
What match had 240 points for?
CREATE TABLE table_name_81 (matches VARCHAR, points_for VARCHAR)
SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = "Bette Midler"
With an original artist names Bette Midler, what is the order number?
CREATE TABLE table_21501565_1 (order__number VARCHAR, original_artist VARCHAR)
SELECT * FROM table_train_210 WHERE serum_calcium > 10.5
serum calcium > 10.5 mg / dl
CREATE TABLE table_train_210 ( "id" int, "serum_potassium" float, "serum_calcium" float, "estimated_glomerular_filtration_rate_egfr" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
SELECT score FROM table_name_62 WHERE date = "26 july 1930"
What was the score on 26 July 1930?
CREATE TABLE table_name_62 (score VARCHAR, date VARCHAR)
SELECT week__number FROM table_21501565_1 WHERE original_artist = "Tina Turner"
With original artist of Tina Turner, what is the week number?
CREATE TABLE table_21501565_1 (week__number VARCHAR, original_artist VARCHAR)
SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts with a pie chart.
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT )
SELECT laps FROM table_name_60 WHERE grid > 15 AND driver = "innes ireland"
How many laps did Innes Ireland make when he had a grid more than 15?
CREATE TABLE table_name_60 (laps VARCHAR, grid VARCHAR, driver VARCHAR)
SELECT original_artist FROM table_21501565_1 WHERE theme = "N/A"
Who is the original artist with a theme of N/A?
CREATE TABLE table_21501565_1 (original_artist VARCHAR, theme VARCHAR)
SELECT "H / A" FROM table_47944 WHERE "Scorers" = 'hughes'
What was the H/A when the scorer was Hughes?
CREATE TABLE table_47944 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Scorers" text )
SELECT SUM(grid) FROM table_name_34 WHERE driver = "jack brabham" AND laps > 65
What is the grid for Jack Brabham with more than 65 laps?
CREATE TABLE table_name_34 (grid INTEGER, driver VARCHAR, laps VARCHAR)
SELECT team FROM table_2150776_1 WHERE date = "June 16" AND driver = "Jeff Gordon"
Name the team for june 16 jeff gordon
CREATE TABLE table_2150776_1 (team VARCHAR, date VARCHAR, driver VARCHAR)
SELECT "Tournament" FROM table_44801 WHERE "Outcome" = 'winner' AND "Date" = '13 july 2013'
What is Tournament, when Outcome is Winner, and when Date is 13 July 2013?
CREATE TABLE table_44801 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT driver FROM table_name_92 WHERE grid = 5
Who drove grid 5?
CREATE TABLE table_name_92 (driver VARCHAR, grid VARCHAR)
SELECT driver FROM table_2150776_1 WHERE laps = "200" AND year = "1997"
Name the driver for 200 laps 1997
CREATE TABLE table_2150776_1 (driver VARCHAR, laps VARCHAR, year VARCHAR)
SELECT "Score" FROM table_17291 WHERE "Team" = '@ Cleveland'
What was the result of the game when the raptors played @ cleveland?
CREATE TABLE table_17291 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT date FROM table_name_3 WHERE visitor = "rockets"
What is the date of the game with the Rockets as the visitor team?
CREATE TABLE table_name_3 (date VARCHAR, visitor VARCHAR)
SELECT team FROM table_2150776_1 WHERE driver = "Ricky Rudd"
Name the team for ricky rudd
CREATE TABLE table_2150776_1 (team VARCHAR, driver VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "RBC, CSF"
count the number of patients whose insurance is self pay and lab test name is rbc, csf?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
SELECT position FROM table_name_88 WHERE years_for_rockets = "1981"
What was the position of the player who played for the Rockets during 1981?
CREATE TABLE table_name_88 (position VARCHAR, years_for_rockets VARCHAR)
SELECT ranking FROM table_21515673_2 WHERE rr2_pts = 4
What is the rank when RR2 has 4 points?
CREATE TABLE table_21515673_2 (ranking VARCHAR, rr2_pts VARCHAR)
SELECT skill_description, COUNT(skill_description) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY skill_description DESC
Give me a pie chart showing the number of engineers for different skill description, and display skill_description in descending order.
CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ) CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255) ) CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255) ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), other_details VARCHAR(255) ) CREATE TABLE Skills_Required_To_Fix ( part_fault_id INTEGER, skill_id INTEGER ) CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGER, fault_status VARCHAR(10), visit_start_datetime DATETIME, visit_end_datetime DATETIME, other_visit_details VARCHAR(255) )
SELECT school_club_team_country FROM table_name_53 WHERE no_s_ < 4
What school, club team, or country did the player with a number smaller than 4 come from?
CREATE TABLE table_name_53 (school_club_team_country VARCHAR, no_s_ INTEGER)
SELECT COUNT(rr1_pts) FROM table_21515673_2 WHERE team_name = "Swedish America's Cup Challenge"
How many points does Swedish America's Cup Challenge have for rr1?
CREATE TABLE table_21515673_2 (rr1_pts VARCHAR, team_name VARCHAR)
SELECT administrative_division FROM table_24027047_1 WHERE population_density___km²_2011_ = "4,491.8"
In what division was there a population density in km2 of 4,491.8 in 2011?
CREATE TABLE table_24027047_1 ( administrative_division VARCHAR, population_density___km²_2011_ VARCHAR )
SELECT no_s_ FROM table_name_29 WHERE school_club_team_country = "virginia"
What is the number of the player who came from Virginia?
CREATE TABLE table_name_29 (no_s_ VARCHAR, school_club_team_country VARCHAR)
SELECT senior_us_senator FROM table_21531764_2 WHERE governor = "D. Patrick"
Who was the senior US senator in the state whose governor was D. Patrick?
CREATE TABLE table_21531764_2 (senior_us_senator VARCHAR, governor VARCHAR)
SELECT MAX("Silver") FROM table_43126 WHERE "Total" < '4' AND "Rank" = '12'
What is the most silver medals when the total is less than 4 and the rank is 12?
CREATE TABLE table_43126 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT time_retired FROM table_name_6 WHERE laps > 56 AND grid = 5
What is the Time/Retired with over 56 laps and a grid of 5?
CREATE TABLE table_name_6 (time_retired VARCHAR, laps VARCHAR, grid VARCHAR)
SELECT lower_house_majority FROM table_21531764_2 WHERE senior_us_senator = "J. Shaheen"
What's the lower house majority in the state whose Senior senator is J. Shaheen?
CREATE TABLE table_21531764_2 (lower_house_majority VARCHAR, senior_us_senator VARCHAR)
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of thyroid malignancy') AND STRFTIME('%y', diagnoses_icd.charttime) = '2104') AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', diagnoses_icd.charttime) = '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 5)
what are the top five most frequent diagnoses in 2104 that patients were diagnosed with within the same month after having been diagnosed with hx of thyroid malignancy?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 )
SELECT driver FROM table_name_10 WHERE tyre = "p" AND entrant = "officine alfieri maserati"
Who is the driver when the tyre is p and the entrant is officine alfieri maserati?
CREATE TABLE table_name_10 (driver VARCHAR, tyre VARCHAR, entrant VARCHAR)
SELECT name FROM table_21536557_2 WHERE time__cet_ = "09:58"
Who is every name for time(cet) of 09:58?
CREATE TABLE table_21536557_2 (name VARCHAR, time__cet_ VARCHAR)
SELECT MAX(laps) FROM table_name_58 WHERE time_retired = "+6.643" AND grid < 2
What is the highest number of laps with a time of +6.643 and grid less than 2?
CREATE TABLE table_name_58 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR )
SELECT constructor FROM table_name_78 WHERE chassis = "talbot-lago t26c" AND driver = "charles pozzi"
Who is the constructor when the chassis is talbot-lago t26c and the driver is charles pozzi?
CREATE TABLE table_name_78 (constructor VARCHAR, chassis VARCHAR, driver VARCHAR)