table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | whats the cost to get a metastatic adenocarcinoma - unknown primary diagnosis. | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'metastatic adenocarcinoma - unknown primary') |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code tex... | when patient 79919 was prescribed 0.9% sodium chloride first time in 06/last year. | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 79919) AND prescriptions.drug = '0.9% sodium chloride' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') A... |
CREATE TABLE table_name_48 (
penanced VARCHAR,
total VARCHAR
) | How many were penanced for a total of 7666? | SELECT penanced FROM table_name_48 WHERE total = "7666" |
CREATE TABLE table_77667 (
"Debut year" real,
"Player" text,
"Date of birth" text,
"Games" real,
"Goals" real,
"Years at club" text
) | How many games had 22 goals before 1935? | SELECT SUM("Games") FROM table_77667 WHERE "Goals" = '22' AND "Debut year" < '1935' |
CREATE TABLE table_203_344 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text,
"other info" text
) | which team was the opponents of this team the most ? | SELECT "opponent" FROM table_203_344 GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_name_33 (
province_of_silla VARCHAR,
modern_equivalent VARCHAR,
administrative_district VARCHAR
) | WHich Province of Silla has a Modern equivalent of south jeolla, and a Administrative district of seungju? | SELECT province_of_silla FROM table_name_33 WHERE modern_equivalent = "south jeolla" AND administrative_district = "seungju" |
CREATE TABLE table_57387 (
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
) | What is the batting style of Makhaya Ntini? | SELECT "Batting Style" FROM table_57387 WHERE "Player" = 'makhaya ntini' |
CREATE TABLE table_203_536 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"crowd" number,
"record" text
) | what is the difference in the crowd population on april 22 and april 29 ? | SELECT ABS((SELECT "crowd" FROM table_203_536 WHERE "date" = 'apr 22') - (SELECT "crowd" FROM table_203_536 WHERE "date" = 'apr 29')) |
CREATE TABLE table_2944 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What was the original airdate for 'Something New'? | SELECT "Original air date" FROM table_2944 WHERE "Title" = 'Something New' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Comments containing string1 but not string2, string3, string4. | SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##string1?\ve##%' AND NOT (Text LIKE '%##string2?\vec##%') AND NOT (Text LIKE '%##string3?\ver##%') AND NOT (Text LIKE '%##string4?\vee##%') ORDER BY CreationDate DESC |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | Out of all the upper level classes , what number have labs ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' |
CREATE TABLE table_67302 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What company was the constructor when Nick Heidfeld was the driver/ | SELECT "Constructor" FROM table_67302 WHERE "Driver" = 'nick heidfeld' |
CREATE TABLE table_19716903_1 (
isolation VARCHAR,
mountain_peak VARCHAR
) | How many different isolation numbers does the Jack Mountain peak have? | SELECT COUNT(isolation) FROM table_19716903_1 WHERE mountain_peak = "Jack Mountain" |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Even our heroes can fail. If you are upset of a few downwote know that even the biggest can fail too. See the most downvoted answers of the top users | SELECT p.Id AS "post_link", Score, u.Id AS "user_link" FROM Posts AS p, Users AS u ORDER BY Score LIMIT 10 |
CREATE TABLE table_10579 (
"Year" real,
"City" text,
"Rider 1" text,
"Rider 2" text,
"Horse 1" text,
"Horse 2" text,
"Association" text
) | Which horse was Horse 1 when ren guzm n raced with the mulch n association? | SELECT "Horse 1" FROM table_10579 WHERE "Rider 1" = 'rené guzmán' AND "Association" = 'mulchén' |
CREATE TABLE table_53374 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Turkey scorers" text,
"Match report" text
) | Which venue had a score of 1-1? | SELECT "Venue" FROM table_53374 WHERE "Score" = '1-1' |
CREATE TABLE table_38390 (
"Product" text,
"Extensions" text,
"Projects templates" text,
"MSDN integration" text,
"Debugging" text,
"Profiling" text,
"IntelliTrace" text,
"Unit test" text,
"Code coverage" text,
"Test impact analysis" text,
"Load testing" text,
"Lab manage... | Which Intelli Trace has a No Extension and Windows Phone development of no? | SELECT "IntelliTrace" FROM table_38390 WHERE "Extensions" = 'no' AND "Windows Phone development" = 'no' |
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE studen... | What are the first name and last name of all the instructors? | SELECT fname, lname FROM faculty WHERE rank = "Instructor" |
CREATE TABLE table_70007 (
"Nat." text,
"Name" text,
"Since" real,
"App(GS/Sub)" text,
"Goals" real,
"Transfer fee" text
) | Name the goals with since less than 2007 and App(GS/Sub) of 97 (69/28) | SELECT "Goals" FROM table_70007 WHERE "Since" < '2007' AND "App(GS/Sub)" = '97 (69/28)' |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, what is the relationship between code and code , and group by attribute name? | SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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... | when did patient 9038 last have an intake since 663 days ago? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9038)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-663 day') ORDER ... |
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,
... | tell me the number of private insurance patients who had elective hospital admission. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Private" |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | Number of questions by month between dates. | SELECT TIME_TO_STR(p.CreationDate, '%Y') + (TIME_TO_STR(p.CreationDate, '%m') - 1) / 12.0 AS ddd, COUNT(*) AS N FROM Posts AS p WHERE TIME_TO_STR(p.CreationDate, '%Y') >= '##startYear?2010##' AND TIME_TO_STR(p.CreationDate, '%Y') <= '##endYear?2015##' GROUP BY TIME_TO_STR(p.CreationDate, '%Y') + (TIME_TO_STR(p.Creation... |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
... | Find the number of courses offered by Psychology department in each year with a line chart, could you order by the X-axis from high to low? | SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY year DESC |
CREATE TABLE table_56232 (
"Yard Name" text,
"Location (City, State)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text,
"Total Vessels Built for USMC" text
) | what is the ship types delivered when the total vessels built for usmc is 13 ships for usmc (plus 37 more for usn)? | SELECT "Ship Types Delivered" FROM table_56232 WHERE "Total Vessels Built for USMC" = '13 ships for usmc (plus 37 more for usn)' |
CREATE TABLE table_203_274 (
id number,
"church name" text,
"address" text,
"community" text,
"school" text
) | what is the last church located in koreatown ? | SELECT "church name" FROM table_203_274 WHERE "community" = 'koreatown' ORDER BY id DESC LIMIT 1 |
CREATE TABLE table_26610 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What in the series number of the episode written by Lauren Gussis? | SELECT MIN("No. in series") FROM table_26610 WHERE "Written by" = 'Lauren Gussis' |
CREATE TABLE table_73540 (
"Horizontal order" real,
"Height order" real,
"Soundfield type" text,
"Number of channels" real,
"Channels" text
) | If the height order is 1 and the soundfield type is mixed-order, what are all the channels? | SELECT "Channels" FROM table_73540 WHERE "Soundfield type" = 'mixed-order' AND "Height order" = '1' |
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
seq... | Show the names and heights of buildings with at least two institutions founded after 1880. Plot them as bar chart. | SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Post... | Java posts with minimum score of 15. | SELECT Title, Body, CreationDate, Id AS "post_link", Tags, Score FROM Posts WHERE PostTypeId IN (1) AND CreationDate > '2020-01-01' AND CreationDate < '2020-12-31' AND Tags LIKE ('%java%') AND Score >= 15 ORDER BY CreationDate DESC |
CREATE TABLE table_29436238_1 (
no_in_series VARCHAR,
written_by VARCHAR
) | How many episodes were written by Gregg Mettler? | SELECT COUNT(no_in_series) FROM table_29436238_1 WHERE written_by = "Gregg Mettler" |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Top n posters for a given country. Gets the top n poster for a country of your choice | SELECT TOP(@TopCount) AS Id, DisplayName, Reputation, LastAccessDate, Age, Location FROM Users WHERE Location LIKE '##COuntry##%' ORDER BY Reputation DESC |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airline (
airline_code... | i'm requesting flight information on a flight from DENVER to SAN FRANCISCO on wednesday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = 4... |
CREATE TABLE table_55570 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the away team that scored 12.17 (89)? | SELECT "Away team" FROM table_55570 WHERE "Away team score" = '12.17 (89)' |
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code text,
unit_price number,
product_name text,
product_color text,
product_size text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity... | Show all product sizes. | SELECT DISTINCT product_size FROM products |
CREATE TABLE table_name_76 (
country VARCHAR,
score VARCHAR
) | What country scored 67? | SELECT country FROM table_name_76 WHERE score = 67 |
CREATE TABLE table_name_6 (
first_match VARCHAR,
final_position VARCHAR,
competition VARCHAR
) | What was the date of the first match of the Fifa Club World Cup that ended with the final position as winners? | SELECT first_match FROM table_name_6 WHERE final_position = "winners" AND competition = "fifa club world cup" |
CREATE TABLE table_name_41 (
category VARCHAR,
year VARCHAR
) | Which category had a year of 1991? | SELECT category FROM table_name_41 WHERE year = 1991 |
CREATE TABLE table_1320857_1 (
je_armstrong VARCHAR,
wh_archer VARCHAR
) | Who is J.E. Armstrong when W.H. Archer is D.M. Lawson? | SELECT je_armstrong FROM table_1320857_1 WHERE wh_archer = "D.M. Lawson" |
CREATE TABLE table_8855 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Former Team" text
) | Which Nationality has a Former Team of denver nuggets? | SELECT "Nationality" FROM table_8855 WHERE "Former Team" = 'denver nuggets' |
CREATE TABLE HOTELS (
pets_allowed_yn VARCHAR,
price_range INTEGER
) | Show the average price of hotels for different pet policy. | SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn |
CREATE TABLE table_25854 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Name the location attendance for dirk nowitzki , caron butler (17) | SELECT "Location Attendance" FROM table_25854 WHERE "High points" = 'Dirk Nowitzki , Caron Butler (17)' |
CREATE TABLE customer (
cust_name VARCHAR,
acc_bal VARCHAR
) | Find the name and account balance of the customer whose name includes the letter a . | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' |
CREATE TABLE table_43260 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
) | When Gigi Fern ndez Natalia Zvereva 6 2, 6 1 won, who was the Tier II Runner-up? | SELECT "Runner-up" FROM table_43260 WHERE "Tier" = 'tier ii' AND "Winner" = 'gigi fernández natalia zvereva 6–2, 6–1' |
CREATE TABLE table_76883 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | How many games have a score of 85-92? | SELECT COUNT("Game") FROM table_76883 WHERE "Score" = '85-92' |
CREATE TABLE table_name_8 (
gold INTEGER,
rank VARCHAR,
silver VARCHAR
) | What is the least number of gold medals won among nations ranked 1 with no silver medals? | SELECT MIN(gold) FROM table_name_8 WHERE rank = 1 AND silver < 1 |
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,
... | what are the four most frequent drugs that were prescribed in the same month to the patients aged 20s after they had been diagnosed with atrial fibrillation in this year? | SELECT t3.drug FROM (SELECT t2.drug, 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 ... |
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 ... | Will 351 be taught by Prof. Jonathan Brumit next semester ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 351 AND instructor.name LIKE '%Jonathan Brumit%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering... |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is average age of patients whose insurance is private and days of hospital stay is 7? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay = "7" |
CREATE TABLE table_name_61 (
class VARCHAR,
part_2 VARCHAR
) | What was the class when part 2 was *h t? | SELECT class FROM table_name_61 WHERE part_2 = "*hēt" |
CREATE TABLE table_name_28 (
game INTEGER,
score VARCHAR
) | Which Game has a Score of 101-109 (ot)? | SELECT AVG(game) FROM table_name_28 WHERE score = "101-109 (ot)" |
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 date of birth of subject name shawn green? | SELECT demographic.dob FROM demographic WHERE demographic.name = "Shawn Green" |
CREATE TABLE table_49036 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is Name, when Best is 1:15.673? | SELECT "Name" FROM table_49036 WHERE "Best" = '1:15.673' |
CREATE TABLE Sportsinfo (
StuID VARCHAR,
hoursperweek INTEGER
) | Show all student IDs with more than total 10 hours per week on all sports played. | SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10 |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | Which courses am I required to take prior to UC 325 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... |
CREATE TABLE table_62071 (
"Tournament" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text
) | What is the 2002 result where 2011 and 2000 are 1R? | SELECT "2002" FROM table_62071 WHERE "2011" = '1r' AND "2000" = '1r' |
CREATE TABLE table_204_937 (
id number,
"rank" number,
"lane" number,
"athlete" text,
"time" number
) | who placed after manjeet kaur ? | SELECT "athlete" FROM table_204_937 WHERE id = (SELECT id FROM table_204_937 WHERE "athlete" = 'manjeet kaur') + 1 |
CREATE TABLE table_13024 (
"Rank" real,
"Map Reference Number" real,
"Census Statistical Area" text,
"2007 Population" real,
"Lake(s)" text
) | What is the map reference number for Lake Superior with a larger population than 65,216 | SELECT COUNT("Map Reference Number") FROM table_13024 WHERE "Lake(s)" = 'lake superior' AND "2007 Population" > '65,216' |
CREATE TABLE table_31625 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text
) | Who played men's doubles when men's singles were played by wong peng soon and Women's singles was played by cecilia samuel, in 1952? | SELECT "Men's doubles" FROM table_31625 WHERE "Men's singles" = 'wong peng soon' AND "Women's singles" = 'cecilia samuel' AND "Year" = '1952' |
CREATE TABLE table_33163 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
) | What format does Japan use? | SELECT "Format" FROM table_33163 WHERE "Country" = 'japan' |
CREATE TABLE table_name_67 (
pick__number VARCHAR,
college VARCHAR
) | How many picks did the College of USC wind up getting? | SELECT COUNT(pick__number) FROM table_name_67 WHERE college = "usc" |
CREATE TABLE table_name_2 (
date VARCHAR,
opponent VARCHAR,
match VARCHAR,
ground VARCHAR
) | On what date was the match higher than 8 on ground A against Guiseley? | SELECT date FROM table_name_2 WHERE match > 8 AND ground = "a" AND opponent = "guiseley" |
CREATE TABLE table_25372 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | How many rebound did the person who scored 147 points have? | SELECT COUNT("Rebounds") FROM table_25372 WHERE "Points" = '147' |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | What is the last name of each student who is not allergic to any type of food? Count them with a bar chart. | SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName |
CREATE TABLE table_57832 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What was the sum roll of Karaka area? | SELECT SUM("Roll") FROM table_57832 WHERE "Area" = 'karaka' |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
... | on 06/22/last year', what was average arterial bp [diastolic] of patient 25523? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... |
CREATE TABLE table_204_918 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number,
"bye" text
) | what is the total number of points scored ? | SELECT SUM("result" + "result") FROM table_204_918 |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | matlab questions with a close flag/vote. | SELECT DISTINCT pt.PostId AS "post_link" FROM PostTags AS pt INNER JOIN PendingFlags AS pf ON pf.PostId = pt.PostId AND pf.FlagTypeId IN (13, 14) INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'outlook' |
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,
... | has volume (ml) heparin been given to patient 030-4181 in 06/last year? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-4181')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput... |
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 swimme... | Give me the comparison about the average of meter_100 over the meter_200 , and group by attribute meter_200. | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 |
CREATE TABLE table_name_64 (
original_air_date VARCHAR,
production_code VARCHAR
) | What is the air date for the episode with production code ad1c13? | SELECT original_air_date FROM table_name_64 WHERE production_code = "ad1c13" |
CREATE TABLE table_21034801_1 (
game INTEGER,
record VARCHAR
) | What was the numer of the game when the record was 4-0? | SELECT MAX(game) FROM table_21034801_1 WHERE record = "4-0" |
CREATE TABLE table_26144632_1 (
prize_fund___¥__ VARCHAR,
location VARCHAR
) | What is the prize for the tournament at Ibaraki? | SELECT prize_fund___¥__ FROM table_26144632_1 WHERE location = "Ibaraki" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give the number of patients whose drug type is base and lab test name is red blood cells. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Red Blood Cells" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | when is the first time that patient 14671 has the maximum arterial bp mean value on the current icu visit? | 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 = 14671) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... |
CREATE TABLE table_name_95 (
city_of_license VARCHAR,
call_sign VARCHAR
) | Name the city of license for call sign of kcmp | SELECT city_of_license FROM table_name_95 WHERE call_sign = "kcmp" |
CREATE TABLE film_text (
film_id SMALLINT,
title VARCHAR(255),
description TEXT
)
CREATE TABLE language (
language_id TINYINT UNSIGNED,
name CHAR(20),
last_update TIMESTAMP
)
CREATE TABLE film (
film_id SMALLINT UNSIGNED,
title VARCHAR(255),
description TEXT,
release_year YEAR,... | Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa, and count them by a bar chart, order Y in desc order. | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC |
CREATE TABLE table_22265261_1 (
age VARCHAR,
sp VARCHAR
) | How old was the horse when the SP was 200/1? | SELECT COUNT(age) FROM table_22265261_1 WHERE sp = "200/1" |
CREATE TABLE table_204_812 (
id number,
"#" number,
"prime minister" text,
"date of birth" text,
"start date\nof (first) term" text,
"age at beginning\nof (first) term" text,
"end date\nof (final) term" text,
"total time in\noffice" text,
"date of death" text,
"lifespan" text
) | was edmund barton or alfred deakin younger at the beginning of his first term ? | SELECT "prime minister" FROM table_204_812 WHERE "prime minister" IN ('edmund barton', 'alfred deakin') ORDER BY "age at beginning\nof (first) term" LIMIT 1 |
CREATE TABLE table_204_922 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who was the only nation with 5 gold medals ? | SELECT "nation" FROM table_204_922 WHERE "gold" = 5 |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,... | what 's the earliest flight from SAN FRANCISCO to BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
CREATE TABLE table_9355 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What are the High assists for Team houston? | SELECT "High assists" FROM table_9355 WHERE "Team" = 'houston' |
CREATE TABLE table_51223 (
"Jurisdiction" text,
"For Prohibition" real,
"Percent For" real,
"Against Prohibition" real,
"Percent Against" real
) | What is the highest percent supporting prohibition when the number opposing is less than 2,978 and the percent opposing is less than 31.2 while the number supporting is less than 9,461? | SELECT MAX("Percent For") FROM table_51223 WHERE "Against Prohibition" < '2,978' AND "Percent Against" < '31.2' AND "For Prohibition" < '9,461' |
CREATE TABLE table_name_95 (
fleet_number VARCHAR,
model VARCHAR
) | What is the fleet number for the model of Gillig Phantom 3096TB? | SELECT fleet_number FROM table_name_95 WHERE model = "gillig phantom 3096tb" |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | please give me the flights from KANSAS CITY to CHICAGO on 6 16 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d... |
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,
U... | Accepted answers to questions by now-anonymous users. | SELECT a.Id AS "post_link" FROM Posts AS a INNER JOIN Posts AS q ON q.AcceptedAnswerId = a.Id LEFT OUTER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE a.OwnerUserId = '##UserId##' AND u.Id IS NULL |
CREATE TABLE table_name_66 (
week VARCHAR,
opponent VARCHAR
) | On what Week was the Detroit Lions the Opponent? | SELECT week FROM table_name_66 WHERE opponent = "detroit lions" |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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,
... | All tag names in decending order of uses. | SELECT TagName, 'count' FROM Tags ORDER BY 'count' DESC |
CREATE TABLE table_38422 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | Which Points have a Drawn larger than 0, and a Lost larger than 1? | SELECT AVG("Points") FROM table_38422 WHERE "Drawn" > '0' AND "Lost" > '1' |
CREATE TABLE table_38548 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
) | Which method did pride bushido 10 have ? | SELECT "Method" FROM table_38548 WHERE "Event" = 'pride bushido 10' |
CREATE TABLE table_11406866_2 (
opponent VARCHAR,
tv VARCHAR,
game_site VARCHAR
) | who is the opponent where tv is abc and game site is tampa stadium | SELECT opponent FROM table_11406866_2 WHERE tv = "ABC" AND game_site = "Tampa Stadium" |
CREATE TABLE table_204_101 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer (s)" text,
"sample(s)" text,
"length" text
) | what is the number of songs with a length over 4 minutes ? | SELECT COUNT("title") FROM table_204_101 WHERE "length" >= 4 |
CREATE TABLE table_204_876 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
) | which is the only one with 1074 km | SELECT "ecclesiastical jurisdictions" FROM table_204_876 WHERE "area (km2)" = '1074' |
CREATE TABLE table_11951237_1 (
production_code INTEGER,
original_air_date VARCHAR
) | What is the production code for the show that aired on October 27, 1994? | SELECT MAX(production_code) FROM table_11951237_1 WHERE original_air_date = "October 27, 1994" |
CREATE TABLE table_77559 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team score when home team score is 20.12 (132)? | SELECT "Away team score" FROM table_77559 WHERE "Home team score" = '20.12 (132)' |
CREATE TABLE table_name_33 (
venue VARCHAR,
notes VARCHAR,
competition VARCHAR
) | Which Venue has Notes of 58.25 m, and a Competition of world championships? | SELECT venue FROM table_name_33 WHERE notes = "58.25 m" AND competition = "world championships" |
CREATE TABLE table_23230 (
"Institution" text,
"Nickname" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) | Name the type for hobart college | SELECT "Type" FROM table_23230 WHERE "Institution" = 'Hobart College' |
CREATE TABLE table_203_476 (
id number,
"no." number,
"title (latin)" text,
"title (english translation)" text,
"subject" text,
"date" text
) | how many titles did not list an english translation ? | SELECT COUNT(*) FROM table_203_476 WHERE "title (english translation)" IS NULL |
CREATE TABLE table_204_463 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | what is the number of times the seattle sounders has reached the 2nd round of the open cup ? | SELECT COUNT(*) FROM table_204_463 WHERE "open cup" = '2nd round' |
CREATE TABLE Users (
user_id INTEGER,
role_code VARCHAR(15),
user_name VARCHAR(40),
user_login VARCHAR(40),
password VARCHAR(40)
)
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(255)
)
CREATE TABLE Document_Structures (... | what are the different role codes for users, and how many users have each? | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.