table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_38 (
season VARCHAR,
away VARCHAR,
league VARCHAR,
home VARCHAR
) | What season has a regionalliga s d league, a 1-0 home, and an away of 2-3? | SELECT season FROM table_name_38 WHERE league = "regionalliga süd" AND home = "1-0" AND away = "2-3" |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | Top editors with type breakdown. Does not count edits to one's own posts.
Does not count rollbacks.
Does not count edits to community wiki posts after they were made CW. | SELECT h.UserId AS "user_link", SUM(CASE WHEN PostHistoryTypeId = 6 THEN 1 ELSE 0 END) AS "retags", SUM(CASE WHEN PostHistoryTypeId = 5 THEN 1 ELSE 0 END) AS "body_edits", SUM(CASE WHEN PostHistoryTypeId = 4 THEN 1 ELSE 0 END) AS "title_edits", COUNT(DISTINCT h.CreationDate) AS "total_edits", COUNT(DISTINCT h.PostId) A... |
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,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid numbe... | what is the top five most common procedures that followed within 2 months for patients who received ins nondrug elut cor st since 2105? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... |
CREATE TABLE table_76538 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" text,
"League Cup goals" real,
"Texaco Cup goals" text,
"Euro competitions" text,
"Total" real
) | What is FA Cup Goals, when Euro Competitions is 1, and when League Goals is 11? | SELECT "FA Cup goals" FROM table_76538 WHERE "Euro competitions" = '1' AND "League goals" = '11' |
CREATE TABLE table_9768 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which player had a position of OT during round 27? | SELECT "Name" FROM table_9768 WHERE "Position" = 'ot' AND "Round" = '27' |
CREATE TABLE table_name_59 (
premiere INTEGER,
chinese_title VARCHAR,
peak VARCHAR
) | What is the premiere rating for a Chinese title of , and a Peak smaller than 41? | SELECT SUM(premiere) FROM table_name_59 WHERE chinese_title = "野蠻奶奶大戰戈師奶" AND peak < 41 |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | what is the yearly average amount of cpk-mb index of patient 015-59552 since 01/2105? | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND lab.labname = 'cpk-mb index' AND STRFTIME('%y-%m', lab.labresultt... |
CREATE TABLE table_name_81 (
runner_up VARCHAR,
winner VARCHAR
) | Who is the runner-up for Ilhwa Chunma? | SELECT runner_up FROM table_name_81 WHERE winner = "ilhwa chunma" |
CREATE TABLE table_name_89 (
location VARCHAR,
record VARCHAR
) | Where was the location when the record was 12-5? | SELECT location FROM table_name_89 WHERE record = "12-5" |
CREATE TABLE table_name_50 (
date VARCHAR,
streak VARCHAR
) | What is the date when streak was won 8? | SELECT date FROM table_name_50 WHERE streak = "won 8" |
CREATE TABLE table_name_59 (
score VARCHAR,
runners_up VARCHAR
) | What is the score when TSV Siegen was the runner-up? | SELECT score FROM table_name_59 WHERE runners_up = "tsv siegen" |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text... | get SATURDAY fares from WASHINGTON to BOSTON | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND DAYS_1.day_name = ... |
CREATE TABLE table_name_67 (
name VARCHAR,
position VARCHAR
) | Which player is in the position of Guard/Forward? | SELECT name FROM table_name_67 WHERE position = "guard/forward" |
CREATE TABLE table_name_99 (
fall_07 INTEGER,
fall_09 INTEGER
) | What was the average value for Fall 07 when Fall 09 is less than 296? | SELECT AVG(fall_07) FROM table_name_99 WHERE fall_09 < 296 |
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,
... | what is the number of patients whose admission location is clinic referral/premature and primary disease is aortic valve insuffiency\aortic valve replacement /sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" |
CREATE TABLE table_name_43 (
gold_medals VARCHAR,
total_medals INTEGER
) | How many gold medals for the school with less than 1 total? | SELECT COUNT(gold_medals) FROM table_name_43 WHERE total_medals < 1 |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | calculate the minimum age of patients who were hospitalized for 23 days and were discharged to skilled nursing facility. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.days_stay = "23" |
CREATE TABLE table_17563 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
) | What's the leader team in the Trofeo Fast Team in stage 20? | SELECT "Trofeo Fast Team" FROM table_17563 WHERE "Stage" = '20' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose days of hospital stay is greater than 14 and diagnoses short title is noninf gastroenterit nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "14" AND diagnoses.short_title = "Noninf gastroenterit NEC" |
CREATE TABLE table_204_295 (
id number,
"model" text,
"origin" text,
"type" text,
"version" text,
"in service" number,
"notes" text
) | what is the model of the only utility vehicle used by the philippine marines that has its origin in the united kingdom ? | SELECT "model" FROM table_204_295 WHERE "origin" = 'united kingdom' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | What is the number of inpatient hospital admission patients who are less than 59 years old? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.age < "59" |
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id number
)
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
not... | For each team, how many technicians are there? | SELECT team, COUNT(*) FROM technician GROUP BY team |
CREATE TABLE table_1676073_12 (
club VARCHAR,
points_against VARCHAR
) | What clubs had 608 points against? | SELECT club FROM table_1676073_12 WHERE points_against = "608" |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TA... | Answers with references to Wikipedia by user. Returns all answers by chosen user that have 'en.wikipedia.org/wiki' in them somewhere. | SELECT A.Id AS "post_link", A.CreationDate AS "answer_date" FROM Posts AS A WHERE A.PostTypeId = 2 AND (A.Body LIKE '%en.m.wikipedia.org/wiki%') ORDER BY 'answer_date' DESC |
CREATE TABLE table_71931 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What year did she compete in tampere, finland? | SELECT AVG("Year") FROM table_71931 WHERE "Venue" = 'tampere, finland' |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | The 546 class - how big is it ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 546 |
CREATE TABLE table_8384 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | How many years did Real Colorado Foxes make it to the Open Cup 1st Round? | SELECT COUNT("Year") FROM table_8384 WHERE "Open Cup" = '1st round' |
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 demographic ... | give me the number of patients whose death status is 0 and lab test name is hematocrit, other fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Other Fluid" |
CREATE TABLE table_68016 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | Which Adelaide has a Melbourne of yes, an Auckland of yes, and a Perth of yes? | SELECT "Adelaide" FROM table_68016 WHERE "Melbourne" = 'yes' AND "Auckland" = 'yes' AND "Perth" = 'yes' |
CREATE TABLE table_203_577 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number
) | how long was thomas stouch coach ? | SELECT "years" FROM table_203_577 WHERE "coach" = 'thomas stouch' |
CREATE TABLE table_name_96 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
) | How many laps did the grid 1 engine have? | SELECT SUM(laps) FROM table_name_96 WHERE time_retired = "engine" AND grid = 1 |
CREATE TABLE table_name_61 (
club VARCHAR,
sport VARCHAR,
league VARCHAR
) | Which club plays soccer in the nwsl? | SELECT club FROM table_name_61 WHERE sport = "soccer" AND league = "nwsl" |
CREATE TABLE table_3784 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
) | What was the teams record when they played the ottawa senators? | SELECT "Record" FROM table_3784 WHERE "Opponent" = 'Ottawa Senators' |
CREATE TABLE table_204_598 (
id number,
"name" text,
"state of residence" text,
"took office" text,
"left office" text,
"president served under" text
) | which senior advisor is after pete rouse ? | SELECT "name" FROM table_204_598 WHERE "took office" > (SELECT "took office" FROM table_204_598 WHERE "name" = 'pete rouse') ORDER BY "took office" LIMIT 1 |
CREATE TABLE manufacturers (
name VARCHAR,
revenue INTEGER
) | Find the name of companies whose revenue is between 100 and 150. | SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150 |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | since 2105 what were the top four most frequent diagnoses that patients were given within the same month after receiving umbilical vein cath? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... |
CREATE TABLE table_76591 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the average Game, when Date is 'December 23'? | SELECT AVG("Game") FROM table_76591 WHERE "Date" = 'december 23' |
CREATE TABLE table_25852 (
"Mother Tongue" text,
"Population (2006)" real,
"Percentage (2006)" text,
"Population (2011)" real,
"Percentage (2011)" text
) | What was the minimum population in 2011? | SELECT MIN("Population (2011)") FROM table_25852 |
CREATE TABLE table_14423 (
"Date" text,
"Opponent" text,
"City" text,
"Result" text,
"Score" text
) | What team was the opponent when the score was 25-0? | SELECT "Opponent" FROM table_14423 WHERE "Score" = '25-0' |
CREATE TABLE table_204_529 (
id number,
"year" number,
"personnel" text,
"album" text,
"label" text,
"peak positions\nnor" number
) | how long was there between tarpan seasons and antologie ? | SELECT ABS((SELECT "year" FROM table_204_529 WHERE "album" = 'tarpan seasons') - (SELECT "year" FROM table_204_529 WHERE "album" = 'antologie')) |
CREATE TABLE table_1847 (
"No." text,
"Summoned" text,
"Elected" text,
"Assembled" text,
"Dissolved" text,
"1st member" text,
"2nd member" text
) | When 1462/63 was the elected what was the no.? | SELECT "No." FROM table_1847 WHERE "Elected" = '1462/63' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | when was the last time that patient 73155 was prescribed with insulin during their last hospital encounter? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73155 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'insulin' ORDER BY prescriptions.startdate DESC LIMIT ... |
CREATE TABLE table_7346 (
"Name" text,
"Years" text,
"League a" text,
"FA Cup" text,
"League Cup" text,
"Other b" text,
"Total" text
) | What is the League Cup for 1947 1958? | SELECT "League Cup" FROM table_7346 WHERE "Years" = '1947–1958' |
CREATE TABLE table_48661 (
"Province" text,
"Region" text,
"Capital" text,
"Districts" real,
"UBIGEO" real
) | What province in Tumbes has less than 11 districts and a UBIGEO of 2401? | SELECT "Province" FROM table_48661 WHERE "Districts" < '11' AND "Region" = 'tumbes' AND "UBIGEO" = '2401' |
CREATE TABLE table_14739 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What score has won as the result on the date of December 14, 2004? | SELECT "Score" FROM table_14739 WHERE "Result" = 'won' AND "Date" = 'december 14, 2004' |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | For those employees who did not have any job in the past, what is the relationship between employee_id and commission_pct ? | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | what is the number of hours since patient 017-88691 had their first procedure in this hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691... |
CREATE TABLE table_name_63 (
rank INTEGER,
director VARCHAR
) | What is the highest Rank, when Director is 'Henry Hathaway'? | SELECT MAX(rank) FROM table_name_63 WHERE director = "henry hathaway" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose primary disease is abdominal pain and age is less than 68? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "68" |
CREATE TABLE table_10684 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Who was the opponent when the score was 6 4, 6 7 (2 7) , 7 5? | SELECT "Opponent" FROM table_10684 WHERE "Score" = '6–4, 6–7 (2–7) , 7–5' |
CREATE TABLE table_name_5 (
erp_w INTEGER,
call_sign VARCHAR
) | What is the sum of the erp w of the k222al call sign? | SELECT SUM(erp_w) FROM table_name_5 WHERE call_sign = "k222al" |
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 VoteTypes (
Id number,
Name text
)
CREATE TABLE Po... | \\ bug query on markdown. with bits stolen from http://data.stackexchange.com/stackoverflow/query/494264/longest-answers-by-markdown | SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.OwnerUserId AS "user_link", p.CreationDate FROM Posts AS p, PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId IN (2, 5, 8) AND NOT EXISTS(SELECT * FROM PostHistory AS phtwo WHERE phtwo.PostId = p.Id AN... |
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 procedure long title is intraoperative cardiac pacemaker and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Intraoperative cardiac pacemaker" AND lab."CATEGORY" = "Chemistry" |
CREATE TABLE table_204_681 (
id number,
"2011 rank" number,
"2010 rank" number,
"2009 rank" number,
"2008 rank" number,
"2007 rank" number,
"company (country)" text,
"2011 arms sales (us$ m.)" number,
"2010 arms sales (us$ m.)" number,
"2009 arms sales (us$ m.)" number,
"2008... | which is the only company to have under 10 % arms sales as share of company 's total sales ? | SELECT "company (country)" FROM table_204_681 WHERE "arms sales as share of company's total sales (%)," < 10 |
CREATE TABLE table_14735 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the highest goal difference that the club with 33-5 points and less than 12 wins? | SELECT MAX("Goal Difference") FROM table_14735 WHERE "Points" = '33-5' AND "Wins" < '12' |
CREATE TABLE table_21991074_3 (
lost INTEGER
) | Name the least lost | SELECT MIN(lost) FROM table_21991074_3 |
CREATE TABLE table_name_91 (
goals INTEGER,
minutes VARCHAR
) | What was the highest number of goals when 2428 minutes were played? | SELECT MAX(goals) FROM table_name_91 WHERE minutes = 2428 |
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 demographic (
subject_id text,
hadm_id t... | provide the number of patients whose insurance is self pay and lab test name is c-reactive protein? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "C-Reactive Protein" |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | Draw a pie chart for what are the proportion of the teams in elimination? | SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team |
CREATE TABLE table_21792 (
"Rank" real,
"Country" text,
"Miss United Continent" real,
"Virreina" real,
"1st RU" real,
"2nd RU" real,
"3rd RU" real,
"4th RU" real,
"Semifinalists" real,
"Total" real
) | What is the least number of miss united continents? | SELECT MIN("Miss United Continent") FROM table_21792 |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what is patient 18726's insurance plan in the last hospital encounter. | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 18726 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_70053 (
"County" text,
"Live births 2006" real,
"GFR 2006" real,
"TFR 2006" real,
"Whites as % of Pop." text
) | What is the lowest total GFR that has 95.80% of the population as Whites, and a TFR total larger than 2.14, in 2006? | SELECT MIN("GFR 2006") FROM table_70053 WHERE "Whites as % of Pop." = '95.80%' AND "TFR 2006" > '2.14' |
CREATE TABLE table_20233 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Who was asked 20 questions in the issue where the cover model is Linda Brava? | SELECT "20 Questions" FROM table_20233 WHERE "Cover model" = 'Linda Brava' |
CREATE TABLE table_name_34 (
record VARCHAR,
date VARCHAR
) | Name the record for october 11 | SELECT record FROM table_name_34 WHERE date = "october 11" |
CREATE TABLE table_train_256 (
"id" int,
"mini_mental_state_examination_mmse" int,
"language" string,
"mild_cognitive_impairment" bool,
"moca_score" int,
"dementia" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | english ( wumc ) or spanish speaking ( dh ) | SELECT * FROM table_train_256 WHERE language = 'english' OR language = 'spanish' |
CREATE TABLE table_name_98 (
visitor VARCHAR,
decision VARCHAR,
home VARCHAR
) | Who was the visiting team at the game where Edmonton was the home team and the decision was Osgood? | SELECT visitor FROM table_name_98 WHERE decision = "osgood" AND home = "edmonton" |
CREATE TABLE table_25030512_4 (
first_elected VARCHAR,
district VARCHAR
) | Name the first elected for alabama 3 | SELECT COUNT(first_elected) FROM table_25030512_4 WHERE district = "Alabama 3" |
CREATE TABLE table_name_24 (
matches VARCHAR,
runs VARCHAR,
inns VARCHAR
) | Runs smaller than 6106, and Inns smaller than 146 has what total number of matches? | SELECT COUNT(matches) FROM table_name_24 WHERE runs < 6106 AND inns < 146 |
CREATE TABLE table_53520 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On which date was the game where the home teams score was 22.15 (147), and the away teams score was 9.8 (62) | SELECT "Date" FROM table_53520 WHERE "Home team score" = '22.15 (147)' AND "Away team score" = '9.8 (62)' |
CREATE TABLE table_21480 (
"Year" real,
"West Manila" text,
"East Manila" text,
"Consumer Price Index (2005=100)" text,
"West Manila as a share of 1996 real tariff" text,
"East Manila as a share of 1996 real tariff" text
) | What was the year when West Manila has a tariff increase of 6.5? | SELECT "Year" FROM table_21480 WHERE "West Manila" = '6.5' |
CREATE TABLE table_43964 (
"Bank type" text,
"Number of branches" real,
"On-site ATMs" real,
"Off-site ATMs" real,
"Total ATMs" real
) | What is the mean on-site ATMS that have off-site ATMs of 1567, and the total number of ATMs less than 4772? | SELECT AVG("On-site ATMs") FROM table_43964 WHERE "Off-site ATMs" = '1567' AND "Total ATMs" < '4772' |
CREATE TABLE table_43536 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What date is aston villa away? | SELECT "Date" FROM table_43536 WHERE "Away team" = 'aston villa' |
CREATE TABLE table_name_39 (
conv VARCHAR,
pens VARCHAR,
tries VARCHAR
) | How many conversions had 0 pens and 0 tries? | SELECT conv FROM table_name_39 WHERE pens = "0" AND tries = "0" |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL tex... | How many players played each position. Show a pie chart. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position |
CREATE TABLE table_name_21 (
score_in_final VARCHAR,
date VARCHAR
) | What was the Final Score on February 24, 2002? | SELECT score_in_final FROM table_name_21 WHERE date = "february 24, 2002" |
CREATE TABLE table_name_53 (
format VARCHAR,
date VARCHAR
) | What is the format of the date February 14, 2002? | SELECT format FROM table_name_53 WHERE date = "february 14, 2002" |
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 who are diagnosed with severe sepsis and have pb route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Severe sepsis" AND prescriptions.route = "PB" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_care... | what is an insurance plan for patient 138 in the first hospital visit? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 138 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE table_61449 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2009 value with lq in 2012, 2r in 2011, and lq in 2008? | SELECT "2009" FROM table_61449 WHERE "2012" = 'lq' AND "2011" = '2r' AND "2008" = 'lq' |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
U... | [draft] Questions with no up-voted or down-voted answers. | SELECT DISTINCT * FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND a.DeletionDate IS NULL AND q.ClosedDate IS NULL AND q.AnswerCount >= '##numOfAnswers?1##' |
CREATE TABLE table_name_39 (
date VARCHAR,
attendance VARCHAR
) | What was the date of the game attended by 45,122? | SELECT date FROM table_name_39 WHERE attendance = "45,122" |
CREATE TABLE table_204_56 (
id number,
"year" number,
"song" text,
"us r&b" number,
"us rap" number,
"album" text
) | what was the only single released in 1993 ? | SELECT "song" FROM table_204_56 WHERE "year" = 1993 |
CREATE TABLE table_name_14 (
rank VARCHAR,
points VARCHAR
) | What is the highest 2nd in (m) that has a Rank more than 2 and Points more than 249.3 | SELECT MAX(2 AS nd__m_) FROM table_name_14 WHERE rank > 2 AND points > 249.3 |
CREATE TABLE table_13067 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | How many games have been played when there are 13 wins and 45 goals were conceded? | SELECT "Games played" FROM table_13067 WHERE "Wins" = '13' AND "Goals conceded" = '45' |
CREATE TABLE table_34084 (
"Week" real,
"Date" text,
"Opponent" text,
"Time / Time Zone" text,
"Game Site" text,
"Final Score" text,
"Record" text,
"Match Report" text
) | Where is the game site for the game that had a packers record of 2-3? | SELECT "Game Site" FROM table_34084 WHERE "Record" = '2-3' |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name var... | what is DL 's schedule of morning flights to ATLANTA | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.departure_time BETWEEN 0 AND 1200 AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'DL' |
CREATE TABLE table_47178 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is the place of the player who scored less than 70? | SELECT "Place" FROM table_47178 WHERE "Score" < '70' |
CREATE TABLE table_name_71 (
location VARCHAR,
record VARCHAR
) | What is the location of the game with a 6-11-8 record? | SELECT location FROM table_name_71 WHERE record = "6-11-8" |
CREATE TABLE table_name_74 (
dvd_release_date VARCHAR,
season VARCHAR,
episodes VARCHAR
) | On what date was the DVD released for the season with fewer than 13 episodes that aired before season 8? | SELECT dvd_release_date FROM table_name_74 WHERE season < 8 AND episodes < 13 |
CREATE TABLE table_1111 (
"Rank" real,
"Country" text,
"UNWTO Region" text,
"International tourist arrivals (2012)" text,
"International tourist arrivals (2011)" text,
"Change (2011 to 2012)" text,
"Change (2010 to 2011)" text
) | Which country has a rank of 5? | SELECT "Country" FROM table_1111 WHERE "Rank" = '5' |
CREATE TABLE table_name_7 (
opponent VARCHAR,
score VARCHAR
) | Who was the opponent with a score of 109 108? | SELECT opponent FROM table_name_7 WHERE score = "109–108" |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Creation... | Percentage of questions with at least one answer (restrict dates). | SELECT TIME_TO_STR(CreationDate, '%j'), CAST(SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(Posts.Id) AS Ratio FROM Posts WHERE (PostTypeId = 1 AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##') GROUP BY TIME_TO_STR(CreationDate, '%j') ORDER BY TIME_TO_STR(CreationDate, '%j') |
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
)
... | how many patients diagnosed with short title other alter consciousnes have had ascites fluid lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Other alter consciousnes" AND lab.fluid = "Ascites" |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What is the easiest class to fulfill the MDE requirement for me ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... |
CREATE TABLE table_18018214_4 (
games_played VARCHAR,
points VARCHAR
) | How many games had 22 points? | SELECT COUNT(games_played) FROM table_18018214_4 WHERE points = 22 |
CREATE TABLE table_name_79 (
circuit VARCHAR,
date VARCHAR,
name VARCHAR
) | Tell me the circuit for 10 may for targa florio | SELECT circuit FROM table_name_79 WHERE date = "10 may" AND name = "targa florio" |
CREATE TABLE customers (
customer_id number,
customer_type_code text,
address_line_1 text,
address_line_2 text,
town_city text,
state text,
email_address text,
phone_number text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
product_category_code text... | What are all the different product names, and how many complains has each received? | SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name |
CREATE TABLE table_68754 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Who was the visiting team who played at the hubert h. humphrey metrodome stadium? | SELECT "Visiting Team" FROM table_68754 WHERE "Stadium" = 'hubert h. humphrey metrodome' |
CREATE TABLE table_name_86 (
attendance VARCHAR,
record VARCHAR
) | What is the attendance that has a record of 43-28? | SELECT attendance FROM table_name_86 WHERE record = "43-28" |
CREATE TABLE table_25887826_17 (
pos INTEGER,
avg VARCHAR
) | How many POS when the average is 1.8529? | SELECT MAX(pos) FROM table_25887826_17 WHERE avg = "1.8529" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.