table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_29712 (
"Conference" text,
"Old membership total" real,
"New membership total" real,
"Net change" text,
"Members added" real,
"Members lost" real
) | What was the new membership total at the nchc (men only) conference? | SELECT "New membership total" FROM table_29712 WHERE "Conference" = 'NCHC (men only)' |
CREATE TABLE table_name_65 (
home_team VARCHAR,
date VARCHAR
) | Which Home team is on Wednesday, 25 february 1998? | SELECT home_team FROM table_name_65 WHERE date = "wednesday, 25 february 1998" |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | What are the dates with a maximum temperature higher than 85, and count them by a line chart, and show by the X-axis in descending. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date DESC |
CREATE TABLE table_name_60 (
score VARCHAR,
partner VARCHAR
) | What was the score when the partner was arnaud cl ment? | SELECT score FROM table_name_60 WHERE partner = "arnaud clément" |
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 is the drug which was prescribed to patient 58649 within 2 days after undergoing lt heart angiocardiogram in 08/last year? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 58649 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... |
CREATE TABLE table_1108394_6 (
staten_island VARCHAR
) | Who was the republican candidate in 2013 when Staten Island was 451? | SELECT 2013 AS _republican_primary FROM table_1108394_6 WHERE staten_island = "451" |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChang... | Answers By Vote Count and Tag. | SELECT MIN(a.OwnerUserId), COUNT(a.Id) FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON pt.PostId = q.Id WHERE NOT a.OwnerUserId IS NULL AND a.PostTypeId = 2 AND a.Score > @MinVoteCount AND pt.TagId = @StartTagId GROUP BY a.OwnerUserId |
CREATE TABLE team (
year number,
league_id text,
team_id text,
franchise_id text,
div_id text,
rank number,
g number,
ghome number,
w number,
l number,
div_win text,
wc_win text,
lg_win text,
ws_win text,
r number,
ab number,
h number,
double numbe... | What are the name and id of the team with the most victories in 2008 postseason? | SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_66849 (
"Vehicle Flight #" text,
"Date" text,
"Pilot" text,
"Mach" real,
"Velocity (km/h)" real,
"Altitude (ft)" real,
"Duration" text
) | What is the lowest altitude of the flight with a mach bigger than 0.905 and a duration of 00:06:17? | SELECT MIN("Altitude (ft)") FROM table_66849 WHERE "Mach" > '0.905' AND "Duration" = '00:06:17' |
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE... | Count the number of programs broadcast for each time section of a day Show bar chart, could you rank by the the total number in desc? | SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*) DESC |
CREATE TABLE table_17295 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high rebounds when Chris Bosh (16) had the high points? | SELECT "High rebounds" FROM table_17295 WHERE "High points" = 'Chris Bosh (16)' |
CREATE TABLE table_24990183_5 (
name VARCHAR,
country VARCHAR
) | Who was the player from georgia? | SELECT name FROM table_24990183_5 WHERE country = "Georgia" |
CREATE TABLE train (
id number,
train_number number,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id number,
station_id number
)
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number... | Find the number and time of the train that goes from Chennai to Guruvayur. | SELECT train_number, time FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur' |
CREATE TABLE table_45334 (
"Year" real,
"Domestic freight" real,
"Domestic mail" real,
"International freight" real,
"International mail" real,
"Total freight and mail" real,
"Change" text
) | How much international mail has a change of +35,7% later than 2008? | SELECT SUM("International mail") FROM table_45334 WHERE "Change" = '+35,7%' AND "Year" > '2008' |
CREATE TABLE table_name_57 (
total VARCHAR,
rank VARCHAR
) | What is the total for Rank 11? | SELECT COUNT(total) FROM table_name_57 WHERE rank = 11 |
CREATE TABLE table_5927 (
"Year" real,
"Chart" text,
"Track" text,
"Peak" real,
"Weeks on Chart" real
) | How many weeks was the track Abrazame on the Billboard Latin Pop airplay before 1997? | SELECT SUM("Weeks on Chart") FROM table_5927 WHERE "Track" = 'abrazame' AND "Chart" = 'billboard latin pop airplay' AND "Year" < '1997' |
CREATE TABLE table_42953 (
"Year" real,
"Actor" text,
"Award" text,
"Motion Picture" text,
"Result" text
) | Which actor won in 1966? | SELECT "Actor" FROM table_42953 WHERE "Year" = '1966' |
CREATE TABLE roller_coaster (
roller_coaster_id number,
name text,
park text,
country_id number,
length number,
height number,
speed text,
opened text,
status text
)
CREATE TABLE country (
country_id number,
name text,
population number,
area number,
languages te... | What are the lengths and heights of roller coasters? | SELECT length, height FROM roller_coaster |
CREATE TABLE table_203_502 (
id number,
"team" text,
"titles" number,
"runner-up" number,
"third place" number,
"fourth place" number,
"years participated" number
) | how many times has michigan state been runner up ? | SELECT "runner-up" FROM table_203_502 WHERE "team" = 'michigan state' |
CREATE TABLE table_10015132_1 (
position VARCHAR,
school_club_team VARCHAR
) | What position did the player from Baylor play? | SELECT position FROM table_10015132_1 WHERE school_club_team = "Baylor" |
CREATE TABLE table_name_48 (
height VARCHAR,
club VARCHAR,
name VARCHAR
) | What is the height of val rie dionne at Club Sainte-Foy? | SELECT height FROM table_name_48 WHERE club = "sainte-foy" AND name = "valérie dionne" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | calculate the number of drugs patient 003-39724 has been prescribed until 2104. | 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 = '003-39724')) AND STRFTIME('%y', medication.drugstarttime) <= '2104' |
CREATE TABLE table_name_2 (
ranking INTEGER,
nationality VARCHAR,
goals VARCHAR
) | What is the number of ranking when the nationalits is England with more than 53 goals? | SELECT SUM(ranking) FROM table_name_2 WHERE nationality = "england" AND goals > 53 |
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
)
CRE... | Number of users with this many answers. | SELECT COUNT(s.userId) FROM (SELECT u.Id AS userId, COUNT(p.Id) AS answerCount FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 GROUP BY u.Id) AS s WHERE s.AnswerCount >= '##minAnswers##' |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what is the daily maximum of arterial bp [diastolic] for patient 26057 during their current hospital visit? | SELECT MAX(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 = 26057 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_... |
CREATE TABLE table_2508633_6 (
pick__number INTEGER,
college VARCHAR
) | Name the most pick number for illinois | SELECT MAX(pick__number) FROM table_2508633_6 WHERE college = "Illinois" |
CREATE TABLE table_name_38 (
frequency_mhz INTEGER,
city_of_license VARCHAR
) | Which Frequency MHz is the highest one that has a City of license of byron, ga? | SELECT MAX(frequency_mhz) FROM table_name_38 WHERE city_of_license = "byron, ga" |
CREATE TABLE table_20603 (
"Country" text,
"Donor payment" text,
"Children per donor" text,
"Donor anonymity" text,
"Allowed recipients" text
) | List the possible children per donor levels for countries where the allowed recipients is no data. | SELECT "Children per donor" FROM table_20603 WHERE "Allowed recipients" = 'no data' |
CREATE TABLE table_19174 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
) | When 2-0 is the 1st leg what are the home (2nd leg)? | SELECT "Home (2nd leg)" FROM table_19174 WHERE "1st Leg" = '2-0' |
CREATE TABLE table_12017 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Home team has an Away team of melbourne? | SELECT "Home team" FROM table_12017 WHERE "Away team" = 'melbourne' |
CREATE TABLE table_36064 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | What's the lowest amount of 12 games and less than 48 rebounds? | SELECT MIN("Rank") FROM table_36064 WHERE "Games" = '12' AND "Rebounds" < '48' |
CREATE TABLE table_5174 (
"Rank" text,
"Film" text,
"Director(s)" text,
"Writer(s)" text,
"Production Company" text
) | Who directed the nominated film, Badmouth? | SELECT "Director(s)" FROM table_5174 WHERE "Rank" = 'nominated' AND "Film" = 'badmouth' |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_i... | What are the number of the dates of transactions with at least 100 share count or amount bigger than 100?, order by the Y in ascending. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY COUNT(date_of_transaction) |
CREATE TABLE table_44318 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is the name of the person with a 1:10.771 qual 2? | SELECT "Name" FROM table_44318 WHERE "Qual 2" = '1:10.771' |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For all employees who have the letters D or S in their first name, a line chart shows the change of commission_pct over hire_date, display x axis from low to high order. | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE |
CREATE TABLE table_52882 (
"Nationality" text,
"Metric" text,
"Imperial" text,
"Name" text,
"Lifespan" text
) | what is the nationality with the metric height of 2.36m named sun ming-ming? | SELECT "Nationality" FROM table_52882 WHERE "Metric" = '2.36m' AND "Name" = 'sun ming-ming' |
CREATE TABLE table_203_864 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | gene sarazen and denny shute are both from which country ? | SELECT "country" FROM table_203_864 WHERE "player" = 'gene sarazen' |
CREATE TABLE table_204_206 (
id number,
"saros" number,
"member" number,
"date" text,
"time\n(greatest)\nutc" text,
"type" text,
"location\nlat,long" text,
"gamma" number,
"mag." number,
"width\n(km)" number,
"duration\n(min:sec)" text,
"ref" number
) | how many solar saros events lasted longer than 4 minutes ? | SELECT COUNT("saros") FROM table_204_206 WHERE "duration\n(min:sec)" >= 4 |
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,
u... | patient 022-89058 had been prescribed acetaminophen, 50 ml vial : dextrose 50 % iv soln or acetaminophen (tylenol) tablet 650 mg in the first hospital visit? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... |
CREATE TABLE table_name_8 (
championship VARCHAR,
opponent VARCHAR
) | What was the championship during the match with the opponent of richard fromberg? | SELECT championship FROM table_name_8 WHERE opponent = "richard fromberg" |
CREATE TABLE table_name_15 (
date VARCHAR,
score VARCHAR,
competition VARCHAR
) | What is the Date of the Fifa World Cup with a Score of 1-0? | SELECT date FROM table_name_15 WHERE score = "1-0" AND competition = "fifa world cup" |
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 PostsWithDeleted (
Id number,
PostTypeId number,
... | Top tags by average score of recent questions. | SELECT MIN(t.TagName) AS "tagname", AVG(p.Score) AS avgScore, COUNT(p.Id) AS nposts FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 GROUP BY pt.TagId HAVING COUNT(*) >= 30 ORDER BY AVG(p.Score) DESC LIMIT 50 |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | CLEANUP: find comments that use code formatting. | SELECT c.CreationDate, c.Id AS "comment_link" FROM Comments AS c WHERE c.Text LIKE '%`%' ORDER BY c.CreationDate DESC |
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... | How many patients with item id 50804 had an abnormal lab test status | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50804" AND lab.flag = "abnormal" |
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 demographic (... | how many patients admitted before the year 2114 were divorced? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2114" |
CREATE TABLE table_58296 (
"Team" text,
"Make" text,
"Driver" text,
"Sponsor" text,
"Car Owner" text
) | What team does bobby hillin jr. (r) drive a buick regal for? | SELECT "Team" FROM table_58296 WHERE "Make" = 'buick regal' AND "Driver" = 'bobby hillin jr. (r)' |
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 Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREAT... | Bar graph to show maximal age from different sex, and display in desc by the y-axis. | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY MAX(Age) DESC |
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... | how many patients whose primary disease is ruq pain and admission year is less than 2146? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.admityear < "2146" |
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... | how many days have elapsed since the time patient 739 was admitted to the icu? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739) AND icustays.outtime IS NULL |
CREATE TABLE table_name_81 (
rank INTEGER,
publication VARCHAR,
year VARCHAR
) | What is the highest Rank, when Publication is Dagsavisen, and when Year is less than 2005? | SELECT MAX(rank) FROM table_name_81 WHERE publication = "dagsavisen" AND year < 2005 |
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 lab (
subject_id text,
hadm_id text,
... | What is the total number of patients with left femur fracture as their primary disease who had cystoscopy nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND procedures.short_title = "Cystoscopy NEC" |
CREATE TABLE table_name_67 (
report VARCHAR,
date VARCHAR
) | Who reported the game on 6 october? | SELECT report FROM table_name_67 WHERE date = "6 october" |
CREATE TABLE table_42965 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What is the record when the Nuggets are the home team? | SELECT "Record" FROM table_42965 WHERE "Home" = 'nuggets' |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId n... | Eleet' Users (reputation of precisely 31337). Returns DisplayName of currently 'Eleet' users. | SELECT DisplayName FROM Users WHERE Reputation = 31337 |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | count the number of times patient 7241 was prescribed with meropenem until 3 years ago. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241) AND prescriptions.drug = 'meropenem' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname va... | Does luke zettlemoyer have a paper in siggraph in 2016 ? | SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'luke zettlemoyer' AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'siggraph' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
CREATE TABLE table_53286 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) | Name the attendance for when the washington wizards was visiting | SELECT "Attendance" FROM table_53286 WHERE "Visitor" = 'washington wizards' |
CREATE TABLE first_notification_of_loss (
customer_id VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
) | Find the names of users who do not have a first notification of loss record. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id |
CREATE TABLE table_name_42 (
result VARCHAR,
date VARCHAR
) | What was the result of the game played on 17 July 2008? | SELECT result FROM table_name_42 WHERE date = "17 july 2008" |
CREATE TABLE table_46792 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | For which play was the points 271? | SELECT "Played" FROM table_46792 WHERE "Points against" = '271' |
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... | how many patients below 43 years of age tested in lab for pleural fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Pleural" |
CREATE TABLE table_name_28 (
state_ranked_in_partisan_order VARCHAR,
percentage_republicans VARCHAR,
republican__democratic VARCHAR
) | Which state has 67% Republicans and a ratio of 24/12 of Republicans to Democrats? | SELECT state_ranked_in_partisan_order FROM table_name_28 WHERE percentage_republicans = "67%" AND republican__democratic = "24/12" |
CREATE TABLE table_name_23 (
frequency VARCHAR,
branding VARCHAR
) | What Frequency's Branding is Your Cure for Corporate Radio? | SELECT frequency FROM table_name_23 WHERE branding = "your cure for corporate radio" |
CREATE TABLE table_60515 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
) | In what Year was the match at Sopot with a Score of 2 6, 6 2, 6 3? | SELECT COUNT("Year") FROM table_60515 WHERE "Location" = 'sopot' AND "Score" = '2–6, 6–2, 6–3' |
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 prescription... | count the number of patients whose admission year is less than 2203 and diagnoses icd9 code is 2662? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2203" AND diagnoses.icd9_code = "2662" |
CREATE TABLE table_name_44 (
year INTEGER,
name VARCHAR
) | What was the average year when shri. shambu nath khajuria won the padma shri awards? | SELECT AVG(year) FROM table_name_44 WHERE name = "shri. shambu nath khajuria" |
CREATE TABLE table_train_121 (
"id" int,
"depression" bool,
"suicidality" bool,
"neurodegenerative_disease" bool,
"unstable_asthmatic_condition" bool,
"vitamin_k_deficiency" bool,
"renal_disease" bool,
"cerebrovascular_disease" bool,
"hepatic_disease" bool,
"liver_disease" bool,
... | the subject has signs or symptoms of another neurodegenerative disease including parkinson's disease, diffuse lewy body dementia, or history of significant cerebrovascular disease | SELECT * FROM table_train_121 WHERE neurodegenerative_disease = 1 OR parkinson_disease = 1 OR lewy_body_dementia = 1 OR cerebrovascular_disease = 1 |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | Visualize the title and and the average star rating of the movie using a bar chart, sort bars in asc order. | SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
progr... | Is 520 available on Mondays and Wednesdays ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... |
CREATE TABLE table_name_72 (
binibining_pilipinas_world VARCHAR,
second_runner_up VARCHAR
) | Which Binibining Pilipinas-World has a Second runner-up of sonia santiago? | SELECT binibining_pilipinas_world FROM table_name_72 WHERE second_runner_up = "sonia santiago" |
CREATE TABLE table_name_79 (
away_team VARCHAR,
home_team VARCHAR
) | Who was Carlton's away team opponent? | SELECT away_team FROM table_name_79 WHERE home_team = "carlton" |
CREATE TABLE table_53735 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which driver has 45 laps? | SELECT "Driver" FROM table_53735 WHERE "Laps" = '45' |
CREATE TABLE table_71492 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" text
) | What years does plateau school serve? | SELECT "Years" FROM table_71492 WHERE "Name" = 'plateau school' |
CREATE TABLE table_train_163 (
"id" int,
"pulse_oximetry" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"allergy_to_adhesive" bool,
"creatinine_clearance_cl" float,
"NOUSE" float
) | pulse oximetry < 90 % | SELECT * FROM table_train_163 WHERE pulse_oximetry < 90 |
CREATE TABLE table_40841 (
"Western Title" text,
"Chinese Title" text,
"Pinyin" text,
"Released Date" text,
"Genre" text,
"Game Modes" text
) | What is the pinyin for the Chinese title ? | SELECT "Pinyin" FROM table_40841 WHERE "Chinese Title" = '直感一笔' |
CREATE TABLE table_204_212 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text,
"notes" text
) | what is the only wager that is not hair ? | SELECT "wager" FROM table_204_212 WHERE "wager" <> 'hair' |
CREATE TABLE table_32228 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What was the lowest round number that had an overall pick up 92? | SELECT MIN("Round") FROM table_32228 WHERE "Overall" = '92' |
CREATE TABLE table_204_851 (
id number,
"serial number" number,
"river" text,
"name" text,
"area (km2)" number,
"district" text,
"co-ordinate" text,
"altitude (m)" number
) | how many are in the palakkad district ? | SELECT COUNT(*) FROM table_204_851 WHERE "district" = 'palakkad' |
CREATE TABLE table_name_39 (
goals VARCHAR,
latest_cap VARCHAR
) | Latest cap of september 5, 2011 had how many goals? | SELECT goals FROM table_name_39 WHERE latest_cap = "september 5, 2011" |
CREATE TABLE table_30563 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | How many college/junior/club teams are from Sweden? | SELECT COUNT("College/junior/club team") FROM table_30563 WHERE "Nationality" = 'Sweden' |
CREATE TABLE table_name_47 (
game INTEGER,
date VARCHAR
) | Date of October 1 has what average game? | SELECT AVG(game) FROM table_name_47 WHERE date = "october 1" |
CREATE TABLE Project_outcomes (
project_id VARCHAR,
outcome_code VARCHAR
)
CREATE TABLE Projects (
project_details VARCHAR,
project_id VARCHAR
)
CREATE TABLE Research_outcomes (
outcome_code VARCHAR,
outcome_description VARCHAR
) | List the project details of the projects with the research outcome described with the substring 'Published'. | SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%' |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... | Top user from Punjab, India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%rajasthan, india%' OR UPPER(Location) LIKE '%Rajasthan, India%' OR Location LIKE '%rajasthan, india%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 25 |
CREATE TABLE table_75650 (
"Borough or Census Area" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | Which borough or census area has a $59,596 median household income? | SELECT "Borough or Census Area" FROM table_75650 WHERE "Median household income" = '$59,596' |
CREATE TABLE table_54486 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What years did the Utah Jazz Player from Southern Methodist, Play? | SELECT "Years for Jazz" FROM table_54486 WHERE "School/Club Team" = 'southern methodist' |
CREATE TABLE table_name_87 (
airline VARCHAR,
iata VARCHAR
) | What airline has a IATA of BX? | SELECT airline FROM table_name_87 WHERE iata = "bx" |
CREATE TABLE table_65768 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Ends" real
) | What is the highest goal for a GEO nat., that ended after 2010? | SELECT MAX("Goals") FROM table_65768 WHERE "Nat." = 'geo' AND "Ends" > '2010' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | how many patients were diagnosed with agitation - mild after the previous diagnosis of coagulopathy - coumadin administration in the same hospital visit? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'agitation - mild') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagno... |
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... | provide the number of patients whose year of death is less than or equal to 2165 and procedure icd9 code is 3523? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.icd9_code = "3523" |
CREATE TABLE table_59893 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Competition" text
) | What date was the UEFA Cup against Panathinaikos? | SELECT "Date" FROM table_59893 WHERE "Competition" = 'uefa cup' AND "Opponent" = 'panathinaikos' |
CREATE TABLE table_name_11 (
lane INTEGER,
rank INTEGER
) | What are the total lanes that have a rank larger than 22? | SELECT SUM(lane) FROM table_name_11 WHERE rank > 22 |
CREATE TABLE table_name_34 (
set_1 VARCHAR,
set_3 VARCHAR
) | What is the Set 1 when Set 3 was 25 15? | SELECT set_1 FROM table_name_34 WHERE set_3 = "25–15" |
CREATE TABLE table_15063 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"Career Win-Loss" text
) | What is the value in 2009 when 1R is in 2007? | SELECT "2009" FROM table_15063 WHERE "2007" = '1r' |
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... | count the number of patients whose age is less than 43 and days of hospital stay is greater than 23? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "43" AND demographic.days_stay > "23" |
CREATE TABLE table_35367 (
"Region" text,
"Total Population" real,
"Catholic" real,
"% Catholic" text,
"% of global Catholic pop." text
) | what is the catholic when the % catholic is 1.39%? | SELECT "Catholic" FROM table_35367 WHERE "% Catholic" = '1.39%' |
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... | what was the number of times patient 013-28507 had a crp test until 170 months ago? | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND lab.labname = 'crp' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIM... |
CREATE TABLE table_54049 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text,
"Purse" text
) | What's the Winner in the Year of 2000? | SELECT "Winner" FROM table_54049 WHERE "Year" = '2000' |
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category text,
Result text
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,... | Create a pie chart showing the total number across category. | SELECT Category, COUNT(*) FROM book_club GROUP BY Category |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | since 2105, what is the five most frequently ordered medication for patients of the age 40s? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', medication.drugstarttime) >= '2105' GROUP BY medication.drugn... |
CREATE TABLE table_name_19 (
yard_name VARCHAR,
ship_types_delivered VARCHAR,
total_vessels_built_for_usmc VARCHAR
) | 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? | 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" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.