table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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,... | let me know the location of admission and gender of patient jane dillard. | SELECT demographic.gender, demographic.admission_location FROM demographic WHERE demographic.name = "Jane Dillard" |
CREATE TABLE table_204_130 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what is the date above 19 october 2013 ? | SELECT "date" FROM table_204_130 WHERE id = (SELECT id FROM table_204_130 WHERE "date" = '19 october 2013') - 1 |
CREATE TABLE table_2361788_1 (
regular_season VARCHAR,
year VARCHAR
) | Name the number of regular season for 2007 | SELECT COUNT(regular_season) FROM table_2361788_1 WHERE year = 2007 |
CREATE TABLE table_name_31 (
rank INTEGER,
date VARCHAR,
mark VARCHAR
) | What is the average rank of the record on 2007-06-21 with a mark less than 91.29? | SELECT AVG(rank) FROM table_name_31 WHERE date = "2007-06-21" AND mark < 91.29 |
CREATE TABLE table_10432351_1 (
mass__m___ INTEGER,
radius__r___ VARCHAR
) | If a radius is 10, what is the lowest possible mass? | SELECT MIN(mass__m___) FROM table_10432351_1 WHERE radius__r___ = 10 |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
h... | among the patients diagnosed with accident in home, calculate the five year survival probability. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... |
CREATE TABLE table_33984 (
"Tournament" text,
"2006" text,
"2007" text,
"2008-12" text,
"2013" text
) | Which 2006 has a 2007 of A? | SELECT "2006" FROM table_33984 WHERE "2007" = 'a' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | what was the cost to patient 011-31229's hospital stay? | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31229') |
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 nu... | Average reputation per post by user. | SELECT Users.AccountId AS Id, Users.Reputation AS rep, COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId GROUP BY Users.AccountId, Users.Reputation ORDER BY 'reputation' DESC LIMIT 38000 |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | count the number of people who had been admitted until 1 year ago to hospital. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') |
CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
) | who was the last pick in round four ? | SELECT "player" FROM table_203_676 ORDER BY "pick #" DESC LIMIT 1 |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | What is off-topic in aviation?. | SELECT q.Id AS Id, q.Score AS Score, q.Id AS "post_link" FROM Posts AS q INNER JOIN PostHistory AS h ON q.Id = h.PostId WHERE h.PostHistoryTypeId = 10 AND h.Comment = '102' AND NOT q.ClosedDate IS NULL ORDER BY q.ViewCount DESC |
CREATE TABLE table_20457 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
) | Name the winner for date of nov 5, 1987 | SELECT "Winner" FROM table_20457 WHERE "Match Date" = 'Nov 5, 1987' |
CREATE TABLE table_75775 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What team has an against more than 8, lost of 7, and the position is 5? | SELECT "Team" FROM table_75775 WHERE "Against" > '8' AND "Lost" = '7' AND "Position" = '5' |
CREATE TABLE table_name_74 (
driver VARCHAR,
constructor VARCHAR,
grid VARCHAR,
laps VARCHAR
) | Who has a grid smaller than 24, less than 61 laps, and a ferrari constructor? | SELECT driver FROM table_name_74 WHERE grid < 24 AND laps < 61 AND constructor = "ferrari" |
CREATE TABLE table_8660 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | What is the total attendance for Candlestick Park? | SELECT COUNT("Attendance") FROM table_8660 WHERE "Game site" = 'candlestick park' |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of code , and group by attribute name, rank bars in descending order. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
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 procedures (
... | what is the number of patients whose age is less than 48 and item id is 51438? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "48" AND lab.itemid = "51438" |
CREATE TABLE table_60243 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | Who is born on 1982-01-29? | SELECT "Name" FROM table_60243 WHERE "Date of Birth" = '1982-01-29' |
CREATE TABLE table_name_23 (
date VARCHAR,
country VARCHAR
) | What was the date of the tournament held in Indonesia? | SELECT date FROM table_name_23 WHERE country = "indonesia" |
CREATE TABLE table_18468 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Which candidates were in the election where Frank W. Boykin was an incumbent? | SELECT "Candidates" FROM table_18468 WHERE "Incumbent" = 'Frank W. Boykin' |
CREATE TABLE table_name_36 (
position INTEGER,
played VARCHAR,
goal_difference VARCHAR,
drawn VARCHAR,
lost VARCHAR
) | What is the sum of the positions for the player who had less than 25 losses, a goal difference of +20, 10 draws, and played less than 42? | SELECT SUM(position) FROM table_name_36 WHERE drawn = 10 AND lost < 25 AND goal_difference = "+20" AND played < 42 |
CREATE TABLE table_71293 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | How many losses are there with 5 goal differences, drew more than 10 times, and 43 goals against? | SELECT COUNT("Losses") FROM table_71293 WHERE "Goal Difference" = '5' AND "Draws" > '10' AND "Goals against" = '43' |
CREATE TABLE table_58174 (
"Heir" text,
"Status" text,
"Relationship to Monarch" text,
"Became heir" text,
"Reason" text,
"Ceased to be heir" text,
"Monarch" text
) | What is the Status when Henry I is the Monarch and the Reason is succession unclear 1100-1103? | SELECT "Status" FROM table_58174 WHERE "Monarch" = 'henry i' AND "Reason" = 'succession unclear 1100-1103' |
CREATE TABLE table_name_80 (
until INTEGER,
titles VARCHAR
) | What is the total Until when the Titles was 5? | SELECT SUM(until) FROM table_name_80 WHERE titles = "5" |
CREATE TABLE diagnoses_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,
d... | when was the last time on 08/29/last year that patient 2498 had the maximum temperature c (calc) for? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatu... |
CREATE TABLE table_name_61 (
pick VARCHAR,
college VARCHAR
) | College of boston college has what pick? | SELECT pick FROM table_name_61 WHERE college = "boston college" |
CREATE TABLE table_16064 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Vikings points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | The record of 7-3 had the largest attendance of what? | SELECT MAX("Attendance") FROM table_16064 WHERE "Record" = '7-3' |
CREATE TABLE table_name_71 (
player VARCHAR,
country VARCHAR,
place VARCHAR,
score VARCHAR
) | What player placed t6 for the United States with a score of 67-69=136? | SELECT player FROM table_name_71 WHERE country = "united states" AND place = "t6" AND score = 67 - 69 = 136 |
CREATE TABLE table_67781 (
"Type" text,
"Fleet numbers" text,
"Quantity made" real,
"Manufacturer" text,
"Date made" text,
"Date withdrawn" text
) | What is the date made that has an associated fleet number of 4? | SELECT "Date made" FROM table_67781 WHERE "Fleet numbers" = '4' |
CREATE TABLE table_1939405_2 (
latin_americans_2001 INTEGER,
_percentage_2001 VARCHAR,
_percentage_2011 VARCHAR
) | How many Latin Americans were there in 2001 in the province with 0.0% 2001 and 0.2% 2011? | SELECT MAX(latin_americans_2001) FROM table_1939405_2 WHERE _percentage_2001 = "0.0%" AND _percentage_2011 = "0.2%" |
CREATE TABLE table_197446_1 (
branch VARCHAR,
term_began VARCHAR
) | What branch was involved when the term began in January 3, 1985? | SELECT branch FROM table_197446_1 WHERE term_began = "January 3, 1985" |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | I need to prep for DUTCH 339 , can I take a course to help me ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'DUTCH' AND number = 339 |
CREATE TABLE table_name_52 (
time VARCHAR,
laps VARCHAR
) | What is the total time that it took for the driver to finish 14 laps? | SELECT time FROM table_name_52 WHERE laps = 14 |
CREATE TABLE table_41425 (
"Tournament" text,
"2003" text,
"2004" text,
"2012" text,
"2013" text
) | What results in 2012 also has 2013 results of 2r and the tournament was Wimbledon? | SELECT "2012" FROM table_41425 WHERE "2013" = '2r' AND "Tournament" = 'wimbledon' |
CREATE TABLE table_name_12 (
score VARCHAR,
date VARCHAR
) | What was the score on April 6, 2008? | SELECT score FROM table_name_12 WHERE date = "april 6, 2008" |
CREATE TABLE table_61443 (
"S.no." real,
"Power Plant" text,
"State" text,
"Total Capacity (MW)" real,
"Completion Schedule" text
) | What is the completion schedule for himachal pradesh state with a total capacity (MW) of 800? | SELECT "Completion Schedule" FROM table_61443 WHERE "State" = 'himachal pradesh' AND "Total Capacity (MW)" = '800' |
CREATE TABLE table_name_51 (
nationality VARCHAR,
player VARCHAR
) | Tell me the nationality for rudolf vercik | SELECT nationality FROM table_name_51 WHERE player = "rudolf vercik" |
CREATE TABLE table_32538 (
"Pool" text,
"Age Group" text,
"Time" text,
"Event" text,
"Date" text
) | What age group has a time of 6:37.73 at the 200m breaststroke? | SELECT "Age Group" FROM table_32538 WHERE "Event" = '200m breaststroke' AND "Time" = '6:37.73' |
CREATE TABLE table_name_17 (
nationality VARCHAR,
round VARCHAR
) | Which Nationality has a Round of 4? | SELECT nationality FROM table_name_17 WHERE round = 4 |
CREATE TABLE table_55045 (
"Tournament" text,
"1980" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text... | What is the 1981 value at the Tournament of Wimbledon? | SELECT "1981" FROM table_55045 WHERE "Tournament" = 'wimbledon' |
CREATE TABLE table_name_99 (
constructor VARCHAR,
location VARCHAR,
year VARCHAR
) | What company constructed the vehicle in the location not held in 1933? | SELECT constructor FROM table_name_99 WHERE location = "not held" AND year = "1933" |
CREATE TABLE table_name_33 (
date_of_appointment VARCHAR,
team VARCHAR
) | WHAT IS THE APPOINTMENT DATE FOR AC HORSENS? | SELECT date_of_appointment FROM table_name_33 WHERE team = "ac horsens" |
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
)
... | what is the number of patients whose days of hospital stay is greater than 16 and item id is 50976? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.itemid = "50976" |
CREATE TABLE table_name_58 (
game INTEGER,
date VARCHAR
) | What is the average Game, when Date is 'December 23'? | SELECT AVG(game) FROM table_name_58 WHERE date = "december 23" |
CREATE TABLE table_name_17 (
top_25 INTEGER,
wins INTEGER
) | What is the fewest number of top-25s for events with more than 0 wins? | SELECT MIN(top_25) FROM table_name_17 WHERE wins > 0 |
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(15),
product_name VARCHAR(80),
product_price DOUBLE
)
CREATE TABLE Customer_Address_History (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Customers (
customer_id I... | Show the number of products with price higher than 1000 or lower than 500 for each product name in a bar chart. | SELECT product_name, COUNT(product_name) FROM Products WHERE product_price > 1000 OR product_price < 500 GROUP BY product_name |
CREATE TABLE table_21098 (
"Rank" real,
"Team" text,
"Round1" real,
"Round2" real,
"Round3" real,
"Round4" real,
"Round5" real,
"Total Points" real
) | What was the highest score for round 2? | SELECT MAX("Round2") FROM table_21098 |
CREATE TABLE table_204_79 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | after the 1990/91 season , which place was earned in the next season ? | SELECT "place" FROM table_204_79 WHERE "season" > '1990/91' ORDER BY "season" LIMIT 1 |
CREATE TABLE table_52445 (
"Year" real,
"Network" text,
"Lap-by-lap" text,
"Color commentator(s)" text,
"Pit reporters" text,
"Host" text,
"Ratings" text,
"Viewers" text
) | What were the ratings for host Chris Economaki who had 12.3 million viewers? | SELECT "Ratings" FROM table_52445 WHERE "Host" = 'chris economaki' AND "Viewers" = '12.3 million' |
CREATE TABLE table_34096 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | In what week was the attendance 25,000? | SELECT "Week" FROM table_34096 WHERE "Attendance" = '25,000' |
CREATE TABLE table_name_51 (
points INTEGER,
touchdowns INTEGER
) | Which Points is the lowest one that has Touchdowns smaller than 1? | SELECT MAX(points) FROM table_name_51 WHERE touchdowns < 1 |
CREATE TABLE table_name_9 (
visitor VARCHAR,
date VARCHAR
) | Date of december 29 has what visitor? | SELECT visitor FROM table_name_9 WHERE date = "december 29" |
CREATE TABLE table_name_59 (
away_team VARCHAR,
venue VARCHAR
) | How many points did the away team score at Arden Street Oval? | SELECT away_team AS score FROM table_name_59 WHERE venue = "arden street oval" |
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... | Get me the number of patients with a primary disease of hyperglycemia who died in or before 2164. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.dod_year <= "2164.0" |
CREATE TABLE table_7034 (
"Year" real,
"Production" text,
"Composer" text,
"Conductor" text,
"Director" text
) | Who was Director John Ramster's Composer? | SELECT "Composer" FROM table_7034 WHERE "Director" = 'john ramster' |
CREATE TABLE table_name_19 (
snatch INTEGER,
total__kg_ VARCHAR,
bodyweight VARCHAR
) | WHTA IS THE SNATCH WITH A TOTAL OF LARGER THAN 318 KG AND BODY WEIGHT OF 84.15? | SELECT AVG(snatch) FROM table_name_19 WHERE total__kg_ > 318 AND bodyweight = 84.15 |
CREATE TABLE table_name_35 (
partial_failures INTEGER,
failures VARCHAR,
successes VARCHAR,
launches VARCHAR
) | Successes smaller than 6, and Launches larger than 1, and a Failures of 2 is what sum of the partial failures? | SELECT SUM(partial_failures) FROM table_name_35 WHERE successes < 6 AND launches > 1 AND failures = 2 |
CREATE TABLE table_76528 (
"Poll Source" text,
"Sample Size" real,
"Margin of Error" real,
"Date" text,
"Democrat" text,
"Republican" text
) | Which Democrat was selected in the poll with a sample size smaller than 516 where the Republican chosen was Ron Paul? | SELECT "Democrat" FROM table_76528 WHERE "Sample Size" < '516' AND "Republican" = 'ron paul' |
CREATE TABLE table_name_92 (
finish VARCHAR,
year_s__won VARCHAR
) | Where did the player who won in 1965 finish? | SELECT finish FROM table_name_92 WHERE year_s__won = "1965" |
CREATE TABLE table_name_73 (
score VARCHAR,
record VARCHAR
) | What was the score of the game when the record was 50-85? | SELECT score FROM table_name_73 WHERE record = "50-85" |
CREATE TABLE table_name_76 (
name VARCHAR,
year VARCHAR
) | What is the Name for 1997 99? | SELECT name FROM table_name_76 WHERE year = "1997–99" |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the new prescriptions of patient 25733 today compared to the ones yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
O... | search deleted questions in terms of their tagname/title. | SELECT Id, url = 'site://q/' + CAST(Id AS TEXT), CreationDate, DeletionDate, Score, Tags FROM Posts WHERE (PostTypeId = 1) AND (Tags LIKE '%<##Tagname##>%' OR Title LIKE '%<##Title##>%') AND (NOT DeletionDate IS NULL) ORDER BY DeletionDate DESC LIMIT 100 |
CREATE TABLE table_name_85 (
grid VARCHAR,
driver VARCHAR
) | Which Grid has a Driver of johnny dumfries? | SELECT grid FROM table_name_85 WHERE driver = "johnny dumfries" |
CREATE TABLE table_204_246 (
id number,
"department" text,
"total deputies" number,
"uninominal deputies" number,
"plurinominal deputies" number,
"special indigenous\nor campesino deputies" number,
"senators" number
) | what is the only department witj 5 total deputies | SELECT "department" FROM table_204_246 WHERE "total deputies" = 5 |
CREATE TABLE table_58525 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was the venue at VFL park? | SELECT "Date" FROM table_58525 WHERE "Venue" = 'vfl park' |
CREATE TABLE table_204_550 (
id number,
"event" text,
"record" text,
"athlete" text,
"date" text,
"meet" text,
"place" text
) | what is the first athlete in teh 100m event ? | SELECT "athlete" FROM table_204_550 WHERE "event" = '100 m' ORDER BY "date" LIMIT 1 |
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)
)
... | Give me a histogram for how many engineers did each staff contact? List both the contact staff name and number of engineers contacted, list by the total number in descending. | SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY COUNT(*) DESC |
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
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Return a bar chart about the distribution of name and meter_100 , and list in asc by the total number. | SELECT name, meter_100 FROM swimmer ORDER BY meter_100 |
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... | calculate the number of patients admitted to emergency who had thoracentesis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Thoracentesis" |
CREATE TABLE table_name_31 (
round VARCHAR,
against VARCHAR
) | What was the round when nueza silva played against greece? | SELECT round FROM table_name_31 WHERE against = "greece" |
CREATE TABLE table_name_56 (
hanja VARCHAR,
mccune_reischauer VARCHAR
) | What is the Hanja for McCune-Reischauer of ch n? | SELECT hanja FROM table_name_56 WHERE mccune_reischauer = "chŏn" |
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,
... | how many patients whose year of death is less than or equal to 2165 and drug name is levofloxacin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2165.0" AND prescriptions.drug = "Levofloxacin" |
CREATE TABLE table_name_95 (
high_points VARCHAR,
team VARCHAR
) | What is the High points with a Team with boston? | SELECT high_points FROM table_name_95 WHERE team = "boston" |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Count of questions with serverless tag over time. | SELECT DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS "week", COUNT(DISTINCT Posts.Id) AS Posts, SUM(Posts.AnswerCount) AS Answers, SUM(Posts.CommentCount) AS Comments FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName L... |
CREATE TABLE table_28785738_1 (
director VARCHAR,
no_in_season VARCHAR
) | Who directed episode 11 of the season? | SELECT director FROM table_28785738_1 WHERE no_in_season = 11 |
CREATE TABLE table_1342013_34 (
result VARCHAR,
incumbent VARCHAR
) | what's the result with incumbent being william h. ayres | SELECT result FROM table_1342013_34 WHERE incumbent = "William H. Ayres" |
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 microlab (
microl... | total the number of drugs patient 032-3281 has been prescribed so far during their last hospital encounter. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-3281' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
CREATE TABLE table_name_98 (
label VARCHAR,
date VARCHAR,
catalog VARCHAR
) | What is the label from 1973 that has a catalog number of l 35023? | SELECT label FROM table_name_98 WHERE date = "1973" AND catalog = "l 35023" |
CREATE TABLE table_name_11 (
winner VARCHAR,
event VARCHAR
) | Who is the winner of the European Poker Tour Grand Final? | SELECT winner FROM table_name_11 WHERE event = "european poker tour grand final" |
CREATE TABLE table_name_10 (
visiting_team VARCHAR,
date VARCHAR
) | What was the visiting team on october 23? | SELECT visiting_team FROM table_name_10 WHERE date = "october 23" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | Bin the hire date into the day of week interval, and then calculate the average salary of employees in each day for a bar chart, note that just select those employees without the letter M in their first name, and could you list Y in ascending order? | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) |
CREATE TABLE table_204_343 (
id number,
"nation" text,
"model" text,
"length" text,
"barrel length" text,
"weight" text
) | which country had the least number of models ? | SELECT "nation" FROM table_204_343 GROUP BY "nation" ORDER BY COUNT("model") LIMIT 1 |
CREATE TABLE table_21337 (
"Department" text,
"Projects" real,
"Municipalities" real,
"Farmers" real,
"Irrigated Ha" real,
"BID/PRONAR Investment (US$)" text,
"Local Investment (US$)" text,
"Total" text
) | What was the department that got $626,798 in local investments? | SELECT "Department" FROM table_21337 WHERE "Local Investment (US$)" = '626,798' |
CREATE TABLE table_74004 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the first elected for hosea moffitt (f) 57.9% josiah masters (dr) 42.1% | SELECT "First elected" FROM table_74004 WHERE "Candidates" = 'Hosea Moffitt (F) 57.9% Josiah Masters (DR) 42.1%' |
CREATE TABLE table_19930660_3 (
winner VARCHAR,
rufus_guest VARCHAR
) | What is the resulting score for the episodes where Rufus's guest is Sean Lock? | SELECT winner FROM table_19930660_3 WHERE rufus_guest = "Sean Lock" |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREA... | Group and count details for the events using a bar chart, and I want to list by the names in desc. | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details DESC |
CREATE TABLE table_72681 (
"Player" text,
"G" real,
"Tackles" real,
"Solo" real,
"Assts" real,
"Sacks" text,
"Int" real,
"Int yards" real,
"Int avg." text,
"Int TD" real,
"Fum. rec" real,
"Fum. rec TD" real
) | Name the least amount of int yards | SELECT MIN("Int yards") FROM table_72681 |
CREATE TABLE table_name_49 (
year INTEGER,
quantity VARCHAR,
gwr_numbers VARCHAR
) | What is the average Year that has a Quantity of 10, and a GWR Numbers of 409, 290, 315, 317 321, 324, 333? | SELECT AVG(year) FROM table_name_49 WHERE quantity = 10 AND gwr_numbers = "409, 290, 315, 317–321, 324, 333" |
CREATE TABLE table_204_401 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"react" number,
"time" number,
"notes" text
) | the difference between yelizaveta bryzhina 's time and ksenija balta 's time ? | SELECT ABS((SELECT "time" FROM table_204_401 WHERE "name" = 'yelizaveta bryzhina') - (SELECT "time" FROM table_204_401 WHERE "name" = 'ksenija balta')) |
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,
LastEditorDispl... | Questions counted by time to first answer (w/o 24 hr restriction, log/log axis). | SELECT LOG(10, CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) * 1440.0 AS INT)) AS "Log Time (m)", LOG(10, COUNT(*)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id LEFT OUTER JOIN Posts AS a2 ON a.ParentId = a2.ParentId AND a.CreationDate > a2.CreationDate WHERE a2.Id IS NULL AND a.CreationDate ... |
CREATE TABLE table_5223 (
"Team" text,
"Copa Libertadores 1992" text,
"Supercopa Sudamericana 1992" text,
"Copa CONMEBOL 1992" text,
"Recopa Sudamericana 1992" text,
"Intercontinental Cup 1992" text
) | Which Copa Libertadores 1992 has a Supercopa Sudamericana 1992 of round of 16, and a Team of gr mio? | SELECT "Copa Libertadores 1992" FROM table_5223 WHERE "Supercopa Sudamericana 1992" = 'round of 16' AND "Team" = 'grêmio' |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | Display requirements for a degree in CS-LSA . | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
CREATE TABLE table_75047 (
"Stage" text,
"Time" text,
"Name" text,
"Length" text,
"Winner" text
) | What is the Name of the stage with S. Loeb as the Winner with a Length of 13.04km and a Stage of SS12? | SELECT "Name" FROM table_75047 WHERE "Winner" = 's. loeb' AND "Length" = '13.04km' AND "Stage" = 'ss12' |
CREATE TABLE table_14078 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
) | Where is the school located that has mustangs as a mascot? | SELECT "Location" FROM table_14078 WHERE "Mascot" = 'mustangs' |
CREATE TABLE table_42818 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who is the Away captain that played on 11,12,13 Aug 1902? | SELECT "Away captain" FROM table_42818 WHERE "Date" = '11,12,13 aug 1902' |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Show different types of ships and the average tonnage of ships of each type Show bar chart, sort Y in asc order. | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) |
CREATE TABLE table_55249 (
"Year" text,
"President" text,
"Vice President" text,
"Gen.-Secretary" text,
"Treasurer" text
) | Which Vice President has a President of daniel masny, and a Treasurer of rebecca t. altmann? | SELECT "Vice President" FROM table_55249 WHERE "President" = 'daniel masny' AND "Treasurer" = 'rebecca t. altmann' |
CREATE TABLE table_11019212_1 (
thursday VARCHAR,
location VARCHAR
) | what's the thursday time with location being hawthorne | SELECT thursday FROM table_11019212_1 WHERE location = "Hawthorne" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.