table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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,
... | how many times does patient 010-1155 have a po liqs intake on the first icu visit? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unit... |
CREATE TABLE table_name_40 (
date VARCHAR,
competition VARCHAR,
venue VARCHAR
) | What date has 2006 fifa world cup qualification as the competition, and alamodome, san antonio, united States as the venue? | SELECT date FROM table_name_40 WHERE competition = "2006 fifa world cup qualification" AND venue = "alamodome, san antonio, united states" |
CREATE TABLE table_name_90 (
track VARCHAR
) | Who won the 350cc at Sachsenring? | SELECT 350 AS _cc FROM table_name_90 WHERE track = "sachsenring" |
CREATE TABLE table_40323 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the name of the tournament with 11 or more events a top-5 of 0 and a top-25 of 2? | SELECT "Tournament" FROM table_40323 WHERE "Events" > '11' AND "Top-5" = '0' AND "Top-25" = '2' |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | Line chart, let hire data as X and salary as Y, and filter for employees without the letter M in their first name, display by the x axis in ascending. | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE |
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
) | Show the number of venue from each venue | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue |
CREATE TABLE table_58322 (
"Mid Gippsland FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the largest amount of wins of someone who has an against score greater than 1249 and a number of losses less than 17? | SELECT MAX("Wins") FROM table_58322 WHERE "Against" > '1249' AND "Losses" < '17' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and salary , and visualize them by a bar chart. | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
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,
... | what did patient 033-3992's age be during this hospital encounter? | SELECT patient.age FROM patient WHERE patient.uniquepid = '033-3992' AND patient.hospitaldischargetime IS NULL |
CREATE TABLE table_50783 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text... | What shows for 2006 when 2000 is 1r, 1996 is A, and Tournament is Cincinnati Masters? | SELECT "2006" FROM table_50783 WHERE "2000" = '1r' AND "1996" = 'a' AND "Tournament" = 'cincinnati masters' |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Stacked bar chart of team_id for with each ACC_Home in each acc road | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | how many patients were prescribed sodium chloride 0.9% 500 ml lvp within 2 months after the diagnosis of sepsis, since 2103? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uniquepid, medicat... |
CREATE TABLE table_203_653 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what countries have the same amount of bronze medals as germany ? | SELECT COUNT("nation") FROM table_203_653 WHERE "nation" <> 'germany' AND "bronze" = (SELECT "bronze" FROM table_203_653 WHERE "nation" = 'germany') |
CREATE TABLE table_train_64 (
"id" int,
"hiv_infection" bool,
"receiving_parenteral_nutrition" bool,
"hypertriglyceridemia" bool,
"enteral_feeding" bool,
"body_mass_index_bmi" float,
"diarrhea" bool,
"NOUSE" float
) | patients with no indication for enteral feeding or in the imminence of receiving parenteral nutrition | SELECT * FROM table_train_64 WHERE enteral_feeding = 0 OR receiving_parenteral_nutrition = 1 |
CREATE TABLE table_44284 (
"College code" text,
"Faculty name" text,
"Designation" text,
"Qualification" text,
"Department" text,
"Experience" text
) | What department has an m.phil (physics) qualification? | SELECT "Department" FROM table_44284 WHERE "Qualification" = 'm.phil (physics)' |
CREATE TABLE table_name_21 (
home_team VARCHAR,
venue VARCHAR
) | Tell me the home team for vfl park venue | SELECT home_team FROM table_name_21 WHERE venue = "vfl park" |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAc... | Answers containing search term for questions that don't. | SELECT answers.Id AS "post_link" FROM Posts AS questions INNER JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE NOT (questions.Body LIKE '%shaken%') AND answers.Body LIKE '%shaken%' |
CREATE TABLE table_37927 (
"Date" text,
"Time" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | At what time was the game when they played the White Sox and had a record of 63-70? | SELECT "Time" FROM table_37927 WHERE "Opponent" = 'white sox' AND "Record" = '63-70' |
CREATE TABLE table_57431 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team played South Melbourne at their home game? | SELECT "Away team" FROM table_57431 WHERE "Home team" = 'south melbourne' |
CREATE TABLE table_61332 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Res has a Time of 11:58? | SELECT "Res." FROM table_61332 WHERE "Time" = '11:58' |
CREATE TABLE table_name_75 (
matches INTEGER,
loses VARCHAR,
pos VARCHAR
) | Loses of 2, and a Pos. smaller than 2 had how many highest matches? | SELECT MAX(matches) FROM table_name_75 WHERE loses = 2 AND pos < 2 |
CREATE TABLE table_name_12 (
rank INTEGER,
nation VARCHAR,
silver VARCHAR
) | Where does Iceland rank with under 19 silvers? | SELECT MAX(rank) FROM table_name_12 WHERE nation = "iceland" AND silver < 19 |
CREATE TABLE table_name_98 (
song VARCHAR,
language VARCHAR
) | What song was in french? | SELECT song FROM table_name_98 WHERE language = "french" |
CREATE TABLE table_53393 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the home team score at Princes Park? | SELECT "Home team score" FROM table_53393 WHERE "Venue" = 'princes park' |
CREATE TABLE table_name_61 (
name VARCHAR,
location VARCHAR
) | What is the name of the building at the Jewellery quarter? | SELECT name FROM table_name_61 WHERE location = "jewellery quarter" |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Catalogue of Comments Including <idownvotedbecau.se> Links. | SELECT Id AS "comment_link" FROM Comments LIMIT 100 |
CREATE TABLE table_name_32 (
head_of_household VARCHAR,
married_filing_jointly_or_qualified_widow_er_ VARCHAR
) | Name the head of household for married filing jointly or qualified widow(er) being $137,051 $208,850 | SELECT head_of_household FROM table_name_32 WHERE married_filing_jointly_or_qualified_widow_er_ = "$137,051–$208,850" |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | List all information about college sorted by enrollment number in the ascending order. | SELECT * FROM college ORDER BY enr |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | tell me what was the top three most common diagnosis since 4 years ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | most popular new tags by votes. | SELECT ROW_NUMBER() OVER (ORDER BY Votes.Votes DESC) AS VoteRank, Votes.TagName AS Tag, Votes.Votes AS "Votes " FROM (SELECT Tags.TagName, COUNT(DISTINCT Votes.Id) AS Votes FROM Tags, PostTags, Posts, Votes WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostTags.PostId AND Votes.PostId = Posts.Id AND Votes.CreationDate ... |
CREATE TABLE table_name_63 (
record VARCHAR,
date VARCHAR
) | What was the record on 12 march 2008? | SELECT record FROM table_name_63 WHERE date = "12 march 2008" |
CREATE TABLE table_name_75 (
last_update VARCHAR,
name VARCHAR
) | for the name of joe surratt what is the last update? | SELECT last_update FROM table_name_75 WHERE name = "joe surratt" |
CREATE TABLE table_name_57 (
total INTEGER,
bronze VARCHAR,
gold VARCHAR
) | Which Total has a Bronze larger than 1, and a Gold larger than 0? | SELECT MAX(total) FROM table_name_57 WHERE bronze > 1 AND gold > 0 |
CREATE TABLE table_70866 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the Result where Goal is 9? | SELECT "Result" FROM table_70866 WHERE "Goal" = '9' |
CREATE TABLE table_44146 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent" text,
"Score" text
) | Who were the opponents for the event in Milan, Italy? | SELECT "Opponent" FROM table_44146 WHERE "Tournament" = 'milan, italy' |
CREATE TABLE table_36169 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
) | Who was the opponent at the game with a result of w 14 6? | SELECT "Opponent" FROM table_36169 WHERE "Result" = 'w 14–6' |
CREATE TABLE table_57473 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the venue of North Melbourne? | SELECT "Venue" FROM table_57473 WHERE "Home team" = 'north melbourne' |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
... | Questions with a single-use tag that has no tag wiki. These single-use tags are candidates for being deleted by the cleanup script, unless a wiki excerpt is written. Some of these questions might become untagged if the single-use tag deletion script is turned back on. | SELECT TagName, PostId AS "post_link", p.Tags, p.CreationDate FROM Tags AS t LEFT JOIN Posts AS pe ON pe.Id = t.ExcerptPostId LEFT JOIN Posts AS pw ON pw.Id = t.WikiPostId LEFT JOIN PostTags AS pt ON TagId = t.Id LEFT JOIN Posts AS p ON p.Id = PostId WHERE Count = 1 AND (WikiPostId IS NULL OR (LENGTH(pe.Body) < 1 AND L... |
CREATE TABLE table_77021 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is Nation, when Rank is greater than 2, when Total is greater than 1, and when Bronze is less than 3? | SELECT "Nation" FROM table_77021 WHERE "Rank" > '2' AND "Total" > '1' AND "Bronze" < '3' |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | calculate the maximum age of english speaking patients who have sepsis primary disease. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "SEPSIS" |
CREATE TABLE table_12564633_1 (
series__number INTEGER,
written_by VARCHAR
) | What was the first series in this list that Jack Orman wrote? | SELECT MIN(series__number) FROM table_12564633_1 WHERE written_by = "Jack Orman" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give me the number of patients whose drug name is propofol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Propofol" |
CREATE TABLE table_34089 (
"Driver" text,
"Points" real,
"Season" real,
"Races" real,
"Percentage of possible points" text
) | Which races have points greater than 123, fernando alonso as the driver and a percentage of possible points of 74.44%? | SELECT "Races" FROM table_34089 WHERE "Points" > '123' AND "Driver" = 'fernando alonso' AND "Percentage of possible points" = '74.44%' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | has patient 009-13409 received a procedure until 4 years ago. | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(... |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | when was the first time that patient 015-91239 had the maximum value of respiration on the current icu visit? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-91239') AND patient.unitdischargetime IS NULL) ... |
CREATE TABLE table_name_60 (
home_team VARCHAR,
tie_no VARCHAR
) | Who was the home team when the Tie no was 7? | SELECT home_team FROM table_name_60 WHERE tie_no = "7" |
CREATE TABLE table_24426 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | Who was the originally artist when Jasmine Murray was selected? | SELECT "Original artist" FROM table_24426 WHERE "Result" = 'Selected' |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE table_name_24 (
opponent VARCHAR,
loss VARCHAR
) | What opponent has tomko (1-1) as a loss? | SELECT opponent FROM table_name_24 WHERE loss = "tomko (1-1)" |
CREATE TABLE table_19826 (
"North Carolina" text,
"273.7%" text,
"South Carolina" text,
"132.1%" text,
"Mississippi" text,
"95.8%" text,
"Wisconsin" text,
"59.4%" text,
"Vermont" text,
"32.5%" text
) | Name the 132.1% for where north carolina is colorado | SELECT "132.1%" FROM table_19826 WHERE "North Carolina" = 'Colorado' |
CREATE TABLE table_name_48 (
episode INTEGER,
performer_4 VARCHAR
) | What is the lowest episode number where john bird was the 4th performer? | SELECT MIN(episode) FROM table_name_48 WHERE performer_4 = "john bird" |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... | Unanswered questions by deleted users. | SELECT CreationDate, Id AS "post_link" FROM Posts WHERE OwnerUserId IS NULL AND ClosedDate IS NULL AND PostTypeId = 1 AND COALESCE(AnswerCount, 0) = 0 ORDER BY CreationDate |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
c... | what are the percentile of 6.7 in a total protein lab test given the same age of patient 030-52327 during their current hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'total protein' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '030-52327' AND pat... |
CREATE TABLE table_20882 (
"Parameter" text,
"1st stage" text,
"2nd stage" text,
"3rd stage" text,
"4th stage" text
) | Name the parameter for 2.67 m | SELECT "Parameter" FROM table_20882 WHERE "1st stage" = '2.67 m' |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and manager_id in a bar chart, and list by the X from low to high. | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | What is the name of school that has the smallest enrollment in each state? | SELECT cname, state, MIN(enr) FROM college GROUP BY state |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code te... | what were the five most frequent lab tests ordered since 2104 for patients in the age of 60 or above? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND STRFTIME('%y', labevents.charttime) >=... |
CREATE TABLE table_name_97 (
school_club_team VARCHAR,
player VARCHAR,
round VARCHAR,
pick VARCHAR
) | Which School/Club Team has a Round smaller than 5, a Pick larger than 1, and a Player of reggie mckenzie? | SELECT school_club_team FROM table_name_97 WHERE round < 5 AND pick > 1 AND player = "reggie mckenzie" |
CREATE TABLE table_18987377_1 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | Name the original title for the last metro | SELECT original_title FROM table_18987377_1 WHERE film_title_used_in_nomination = "The Last Metro" |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Create a bar chart showing meter_100 across meter 600, and could you order from low to high by the Y-axis? | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 |
CREATE TABLE STUDENT (
Fname VARCHAR,
city_code VARCHAR
)
CREATE TABLE VOTING_RECORD (
VICE_PRESIDENT_Vote VARCHAR
) | Find the distinct first names of all the students who have vice president votes and whose city code is not PIT. | SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = "PIT" |
CREATE TABLE table_31682 (
"Flight" text,
"Launch date/time (UTC)" text,
"Variant" text,
"Launch Pad" text,
"Payload" text,
"Payload Mass" text
) | Tell me the launch pad for 25 december 2010 10:34 | SELECT "Launch Pad" FROM table_31682 WHERE "Launch date/time (UTC)" = '25 december 2010 10:34' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | what are the four most frequent drugs that were prescribed to coronary artery disease female patients 20s within 2 months after they were diagnosed with coronary artery disease in this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND DATETIME(diagnosis.di... |
CREATE TABLE diagnoses (
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,
... | what is the diagnosis icd9 and diagnosis long title of subject id 92796? | SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "92796" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | how much does the weight of patient 006-161415 vary last measured on the first hospital visit compared to the second to last value measured on the first hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL O... |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of patients whose year of death is less than or equal to 2174 and drug code is osel75? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2174.0" AND prescriptions.formulary_drug_cd = "OSEL75" |
CREATE TABLE table_67243 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What chassis has a year of 1951? | SELECT "Chassis" FROM table_67243 WHERE "Year" = '1951' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid ... | patient 004-17866 has received a fio2 lab test in 2105? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-17866')) AND lab.labname = 'fio2' AND STRFTIME('%y', lab.labresulttime) = '2105' |
CREATE TABLE diagnoses (
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,
... | how many patients whose admission year is less than 2144 and diagnoses icd9 code is 28802? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "28802" |
CREATE TABLE table_12434380_1 (
institution VARCHAR,
mascot VARCHAR
) | What is the name of the institution with the mascot of blue devils? | SELECT institution FROM table_12434380_1 WHERE mascot = "Blue Devils" |
CREATE TABLE table_203_247 (
id number,
"district" text,
"counties represented" text,
"delegate" text,
"party" text,
"first elected" number,
"committee" text
) | how many delegates represented allegany ? | SELECT COUNT("delegate") FROM table_203_247 WHERE "counties represented" = 'allegany' |
CREATE TABLE table_name_12 (
title VARCHAR,
catalog__number VARCHAR
) | What CD has a catalog # of PCR 502? | SELECT title FROM table_name_12 WHERE catalog__number = "pcr 502" |
CREATE TABLE table_80170 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | What was the 2nd Party that had the 2nd Member John Barneby, when the 1st Party was Conservative? | SELECT "2nd Party" FROM table_80170 WHERE "2nd Member" = 'john barneby' AND "1st Party" = 'conservative' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid nu... | what was the maximum monthly number of patients diagnosed with adv eff insulin/antidiab until 2104? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff insulin/antidiab') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y... |
CREATE TABLE table_5620 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | On what date was the record 4 0 0? | SELECT "Date" FROM table_5620 WHERE "Record" = '4–0–0' |
CREATE TABLE table_20996923_20 (
date VARCHAR,
city VARCHAR
) | What is the date when the city is San Antonio, Texas? | SELECT date FROM table_20996923_20 WHERE city = "San Antonio, Texas" |
CREATE TABLE table_19751479_4 (
fastest_lap VARCHAR,
rnd VARCHAR,
pole_position VARCHAR
) | How many races had #99 gainsco/bob stallings racing in round 10? | SELECT COUNT(fastest_lap) FROM table_19751479_4 WHERE rnd = 10 AND pole_position = "#99 GAINSCO/Bob Stallings Racing" |
CREATE TABLE table_name_8 (
cover_model VARCHAR,
date VARCHAR
) | Which Cover Model was featured on 8-03? | SELECT cover_model FROM table_name_8 WHERE date = "8-03" |
CREATE TABLE table_76600 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
) | How many starts for an average finish greater than 43? | SELECT SUM("Starts") FROM table_76600 WHERE "Avg. Finish" > '43' |
CREATE TABLE table_43630 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is Time, when Round is less than 2, and when Opponent is 'Valentijn Overeem'? | SELECT "Time" FROM table_43630 WHERE "Round" < '2' AND "Opponent" = 'valentijn overeem' |
CREATE TABLE table_43168 (
"Name" text,
"Position" text,
"Number" text,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | What is the Season with an Acquisition via of rookie draft, and the number is 15? | SELECT "Season" FROM table_43168 WHERE "Acquisition via" = 'rookie draft' AND "Number" = '15' |
CREATE TABLE table_name_95 (
winning_constructor VARCHAR,
name VARCHAR
) | Which Constructor won the Roussillon Grand Prix? | SELECT winning_constructor FROM table_name_95 WHERE name = "roussillon grand prix" |
CREATE TABLE table_54492 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | When the Score was 4-10, what was the Attendance? | SELECT "Attendance" FROM table_54492 WHERE "Score" = '4-10' |
CREATE TABLE table_50174 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was the To par for the player whose final score was 67-71=138? | SELECT "To par" FROM table_50174 WHERE "Score" = '67-71=138' |
CREATE TABLE table_2679061_2 (
pick__number INTEGER,
nhl_team VARCHAR,
college_junior_club_team VARCHAR
) | what is the pick # when the nhl team is montreal canadiens and the college/junior/club team is trois-rivi res draveurs (qmjhl)? | SELECT MIN(pick__number) FROM table_2679061_2 WHERE nhl_team = "Montreal Canadiens" AND college_junior_club_team = "Trois-Rivières Draveurs (QMJHL)" |
CREATE TABLE table_46666 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Average 1" real,
"Points 2" real
) | For a team with a goals against less than 58, a position of 10, and a points 2 more than 53, what is the average lost? | SELECT AVG("Lost") FROM table_46666 WHERE "Goals Against" < '58' AND "Position" = '10' AND "Points 2" > '53' |
CREATE TABLE table_dev_38 (
"id" int,
"gender" string,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
"ace_inhibitors" bool,
"serum_creatinine" float,
... | have a serum creatinine greater than or equal to 1.5 milligrams / deciliter ( mg / dl ) ( male ) or greater than or equal to 1.4 mg / dl ( female ) , or a creatinine clearance less than 60 milliliters / minute ( ml / minute ) | SELECT * FROM table_dev_38 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female') OR creatinine_clearance_cl < 60 |
CREATE TABLE table_51472 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the score of the home team that played Collingwood? | SELECT "Home team score" FROM table_51472 WHERE "Away team" = 'collingwood' |
CREATE TABLE table_203_824 (
id number,
"pick #" number,
"player" text,
"position" text,
"nationality" text,
"nhl team" text,
"college/junior/club team" text
) | the most players picked came from which nationality ? | SELECT "nationality" FROM table_203_824 GROUP BY "nationality" ORDER BY COUNT("player") DESC LIMIT 1 |
CREATE TABLE table_31285 (
"Film Festival" text,
"Date of ceremony" text,
"Category" text,
"Participants/Recipients" text,
"Result" text
) | Which films participated in the 30th Hawaii International Film Festival? | SELECT "Participants/Recipients" FROM table_31285 WHERE "Film Festival" = '30th Hawaii International Film Festival' |
CREATE TABLE table_9299 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How much Gold has a Silver smaller than 14, and a Rank larger than 8, and a Bronze of 3? | SELECT COUNT("Gold") FROM table_9299 WHERE "Silver" < '14' AND "Rank" > '8' AND "Bronze" = '3' |
CREATE TABLE table_name_82 (
ratings__5_capital_cities_ VARCHAR,
episode_no VARCHAR
) | What was the rating of the episode Wonder Drug? | SELECT ratings__5_capital_cities_ FROM table_name_82 WHERE episode_no = "wonder drug" |
CREATE TABLE table_56898 (
"Week" real,
"EASTERN #1" text,
"Eastern #2" text,
"WESTERN #1" text,
"Western #2" text
) | Tell me the eastern #2 for western #2 of oakland | SELECT "Eastern #2" FROM table_56898 WHERE "Western #2" = 'oakland' |
CREATE TABLE table_44238 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | Who visited on march 26? | SELECT "Visitor" FROM table_44238 WHERE "Date" = 'march 26' |
CREATE TABLE table_name_32 (
agency VARCHAR,
birthday VARCHAR
) | What's the agency of the member born on 1998.11.09? | SELECT agency FROM table_name_32 WHERE birthday = "1998.11.09" |
CREATE TABLE table_name_6 (
losses INTEGER,
against VARCHAR,
wins VARCHAR,
club VARCHAR
) | What is the sum of losses when wins is more than 6, club is camperdown and against is more than 1238? | SELECT SUM(losses) FROM table_name_6 WHERE wins > 6 AND club = "camperdown" AND against > 1238 |
CREATE TABLE table_1566848_7 (
pictorials VARCHAR,
centerfold_model VARCHAR
) | Who were all the pictorials when the centerfold model was Rebekka Armstrong? | SELECT COUNT(pictorials) FROM table_1566848_7 WHERE centerfold_model = "Rebekka Armstrong" |
CREATE TABLE table_name_90 (
period VARCHAR,
country VARCHAR,
peak_position VARCHAR
) | Name the period for south korea with peak position of #1 | SELECT period FROM table_name_90 WHERE country = "south korea" AND peak_position = "#1" |
CREATE TABLE table_12982 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | What Week 4 has a Week 2 of samantha speer? | SELECT "Week 4" FROM table_12982 WHERE "Week 2" = 'samantha speer' |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | EECS 487 and EECS 521 , which one is easier ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 487 OR course.number = 521) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.