table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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... | how many patients whose diagnoses long title is cellulitis and abscess of leg, except foot and drug route is po? | 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.long_title = "Cellulitis and abscess of leg, except foot" AND prescriptions.route = "PO" |
CREATE TABLE table_40037 (
"Country" text,
"Local name" text,
"Host" text,
"Network" text,
"Date premiered" text
) | Which Country has a Network of channel 1? | SELECT "Country" FROM table_40037 WHERE "Network" = 'channel 1' |
CREATE TABLE table_203_320 (
id number,
"rank in\n2011" number,
"name of\nconcern" text,
"location of\nheadquarters" text,
"revenue\n(thou.\npln)" number,
"profit\n(thou.\npln)" number,
"employees" number
) | how many companies had over $ 1,000,000 profit ? | SELECT COUNT("name of\nconcern") FROM table_203_320 WHERE "profit\n(thou.\npln)" > 1000000 |
CREATE TABLE table_name_82 (
played VARCHAR,
points_difference VARCHAR
) | What are the played points difference? | SELECT played FROM table_name_82 WHERE points_difference = "points difference" |
CREATE TABLE table_80210 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What chassis did the porsche flat-4 use before 1958? | SELECT "Chassis" FROM table_80210 WHERE "Engine" = 'porsche flat-4' AND "Year" < '1958' |
CREATE TABLE table_12032893_1 (
_number VARCHAR,
name VARCHAR
) | What number (#) is associated with the Name Ron Baxter? | SELECT COUNT(_number) FROM table_12032893_1 WHERE name = "Ron Baxter" |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
) | Draw a bar chart of name versus age, and I want to rank by the x axis in asc. | SELECT Name, Age FROM editor ORDER BY Name |
CREATE TABLE table_name_19 (
margin_of_victory VARCHAR,
runner_s__up VARCHAR
) | Which Margin of victory has a Runner(s)-up of mark o'meara? | SELECT margin_of_victory FROM table_name_19 WHERE runner_s__up = "mark o'meara" |
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 patients who were admitted before the year 2115 for insertion of non-drug-eluting coronary artery stent(s)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2115" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(s)" |
CREATE TABLE table_17773 (
"Sequencer" text,
"Ion Torrent PGM" text,
"454 GS FLX" text,
"HiSeq 2000" text,
"SOLiDv4" text,
"PacBio" text,
"Sanger 3730xl" text
) | What is the sequencer when ion torrent pgm is 200-400 bp? | SELECT "Sequencer" FROM table_17773 WHERE "Ion Torrent PGM" = '200-400 bp' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | give me the number of patients whose admission type is emergency and lab test name is creatine kinase, mb isoenzyme? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Creatine Kinase, MB Isoenzyme" |
CREATE TABLE table_26428602_1 (
absorb__nm_ INTEGER,
color VARCHAR
) | How much absorption in nm does the orange dye have? | SELECT MIN(absorb__nm_) FROM table_26428602_1 WHERE color = "orange" |
CREATE TABLE table_204_565 (
id number,
"game" number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" number,
"goalscorers" text
) | how many games were played in september 1978 ? | SELECT COUNT(*) FROM table_204_565 WHERE "date" = 9 AND "date" = 1978 |
CREATE TABLE table_name_88 (
year INTEGER,
points VARCHAR,
chassis VARCHAR
) | Which year has a total of 0 points and a chassis of Toleman tg181? | SELECT AVG(year) FROM table_name_88 WHERE points = 0 AND chassis = "toleman tg181" |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | I want to see International Economics courses of 3 credits . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%International Economics%' OR name LIKE '%International Economics%') AND credits = 3 |
CREATE TABLE table_24187 (
"No in Series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What episode number in the series was directed by John Behring? | SELECT MAX("No in Series") FROM table_24187 WHERE "Directed by" = 'John Behring' |
CREATE TABLE table_10710 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home score for the Home team Melbourne? | SELECT "Home team score" FROM table_10710 WHERE "Home team" = 'melbourne' |
CREATE TABLE table_2076516_1 (
enrollment__2012_ VARCHAR,
founded VARCHAR
) | When 1927 is the founded year how many measurements of enrollment in 2012 are there? | SELECT COUNT(enrollment__2012_) FROM table_2076516_1 WHERE founded = 1927 |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | how many patients died after being diagnosed in 2104 with hematuria in the same hospital encounter? | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... |
CREATE TABLE table_name_93 (
census_ranking VARCHAR,
area_km_2 VARCHAR,
population VARCHAR
) | What is the census ranking for the community with an area smaller than 9.94 km2 and a population smaller than 817? | SELECT census_ranking FROM table_name_93 WHERE area_km_2 < 9.94 AND population < 817 |
CREATE TABLE table_name_5 (
away_team VARCHAR,
home_team VARCHAR
) | What is the away team when the home team is Cheltenham Town? | SELECT away_team FROM table_name_5 WHERE home_team = "cheltenham town" |
CREATE TABLE table_204_622 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | which competition did this competitor compete in next after the world indoor championships in 2008 ? | SELECT "competition" FROM table_204_622 WHERE id = (SELECT id FROM table_204_622 WHERE "competition" = 'world indoor championships' AND "year" = 2008) + 1 |
CREATE TABLE table_29842201_1 (
subject VARCHAR,
highest_mark VARCHAR
) | What is the subject when the highest mark is 79? | SELECT subject FROM table_29842201_1 WHERE highest_mark = 79 |
CREATE TABLE table_name_2 (
tournament VARCHAR
) | Which 2010 stat featured the tournament of the Olympic Games? | SELECT 2010 FROM table_name_2 WHERE tournament = "olympic games" |
CREATE TABLE table_56631 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which Position has a Player of patrick macdonald? | SELECT "Position" FROM table_56631 WHERE "Player" = 'patrick macdonald' |
CREATE TABLE table_68328 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | Which Perth's gold coast and Adelaide were yes when Auckland was no? | SELECT "Perth" FROM table_68328 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'yes' AND "Auckland" = 'no' |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Show me a bar chart comparing the total number of captains of different classes, order from high to low by the the number of class. | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY COUNT(Class) DESC |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | Percent closed per canonical tag. | WITH canon AS (SELECT Tags.Id, Count, Tags.TagName AS otag, COALESCE(c.TargetTagName, b.TargetTagName, a.TargetTagName, TagName) AS tagname FROM Tags LEFT JOIN TagSynonyms AS a ON (a.SourceTagName = TagName) LEFT JOIN TagSynonyms AS b ON (b.SourceTagName = a.TargetTagName) LEFT JOIN TagSynonyms AS c ON (c.SourceTagName... |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | Find those themes and years for all exhibitions with ticket prices lower than 15, show me a stacked bar chart that groups by themes, counts year, and the x-axis is Year. | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme |
CREATE TABLE table_23739 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real,
"Others%" text,
"Others#" real,
"Total" real
) | Name the county for mccain being 38.78% | SELECT "County" FROM table_23739 WHERE "McCain%" = '38.78%' |
CREATE TABLE table_29866 (
"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 overall number of times when the calendar showed october 6 | SELECT COUNT("Record") FROM table_29866 WHERE "Date" = 'October 6' |
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... | What is the admission time and for how many days did the subject id 4333 stay in the hospital? | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "4333" |
CREATE TABLE table_1346137_4 (
candidates VARCHAR,
incumbent VARCHAR
) | How many different set of candidates were there when the incumbent was david e. finley? | SELECT COUNT(candidates) FROM table_1346137_4 WHERE incumbent = "David E. Finley" |
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
)
... | how many patients have stayed in the hospital for more than 14 days with a ou drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "14" AND prescriptions.route = "OU" |
CREATE TABLE table_name_52 (
nationality VARCHAR,
fate VARCHAR,
ship VARCHAR
) | What was the nationality of the sunk ship named Rinos? | SELECT nationality FROM table_name_52 WHERE fate = "sunk" AND ship = "rinos" |
CREATE TABLE table_name_69 (
livery VARCHAR,
year_built VARCHAR,
locomotive_type VARCHAR
) | What livery belongs to the steam Locomotive type builder that was building before 1989? | SELECT livery FROM table_name_69 WHERE year_built < 1989 AND locomotive_type = "steam" |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees who did not have any job in the past, give me the trend about department_id over hire_date , I want to order in desc by the X-axis. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC |
CREATE TABLE table_50913 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Who is the player from round 8? | SELECT "Player" FROM table_50913 WHERE "Round" = '8' |
CREATE TABLE table_name_79 (
gold VARCHAR,
total VARCHAR
) | What is Gold, when Total is 6? | SELECT gold FROM table_name_79 WHERE total = 6 |
CREATE TABLE table_204_54 (
id number,
"pondicherry assembly" text,
"duration" text,
"name of m.l.a." text,
"party affiliation" text,
"election year" number
) | who won the election after s. sivaprakasam in the fifth pondicherry assembly ? | SELECT "name of m.l.a." FROM table_204_54 WHERE "pondicherry assembly" = 'fifth' |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE R... | Top 10 tags with top 5 tags. | SELECT Tags FROM Posts WHERE Tags IN (SELECT Tags FROM Tags ORDER BY Count DESC LIMIT 10) LIMIT 5 |
CREATE TABLE table_29563 (
"A\u00f1o" real,
"Trabajo nominado" text,
"Premio" text,
"Categor\u00eda" text,
"Country" text,
"Resultado" text
) | How many premio are there when 'Artist of the Year' was the categoria? | SELECT COUNT("Premio") FROM table_29563 WHERE "Categor\u00eda" = 'Artist of the Year' |
CREATE TABLE table_name_67 (
points INTEGER,
played INTEGER
) | Can you tell me the highest Points that has the Played smaller than 30? | SELECT MAX(points) FROM table_name_67 WHERE played < 30 |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is drug route and drug dose of drug name miconazole 2% cream? | SELECT prescriptions.route, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Miconazole 2% Cream" |
CREATE TABLE table_75128 (
"Year" real,
"Chart" text,
"Track" text,
"Peak" real,
"Weeks on Chart" real
) | Name the total number of weeks for si te vas and peak less than 7 and year less than 2000 | SELECT COUNT("Weeks on Chart") FROM table_75128 WHERE "Track" = 'si te vas' AND "Peak" < '7' AND "Year" < '2000' |
CREATE TABLE table_30281 (
"Position" text,
"Number" real,
"Player" text,
"Super League" real,
"Champions League" real,
"Swiss Cup" real,
"Total" real
) | What is the minimum sum? | SELECT MIN("Total") FROM table_30281 |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | what was the total replete w/fiber dose for patient 22517? | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22517)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... |
CREATE TABLE table_9225 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"2012 club" text
) | What is the name for the 2012 CN Sabadell? | SELECT "Name" FROM table_9225 WHERE "2012 club" = 'cn sabadell' |
CREATE TABLE table_name_68 (
saturday VARCHAR,
name VARCHAR
) | Which Saturday has a Name of confederation? | SELECT saturday FROM table_name_68 WHERE name = "confederation" |
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... | find the number of patients who were born before the year 2120 and their drug route is ivpca. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2120" AND prescriptions.route = "IVPCA" |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advis... | Find the last names of the members of the club 'Bootup Baltimore'. | SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" |
CREATE TABLE table_203_409 (
id number,
"rank" number,
"representative" text,
"party" text,
"district" text,
"seniority date" text,
"notes" text
) | does each congressman have a party listed ? | SELECT COUNT(*) = 0 FROM table_203_409 WHERE "party" IS NULL |
CREATE TABLE table_203_330 (
id number,
"year of election" number,
"candidates elected" number,
"# of seats available" number,
"# of votes" number,
"% of popular vote" text
) | what year had the most candidates elected ? | SELECT "year of election" FROM table_203_330 ORDER BY "candidates elected" DESC LIMIT 1 |
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... | just count how many patients have been prescribed spironolactone in 2105. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'spironolactone' AND STRFTIME('%y', prescriptions.startdate) = '2105') |
CREATE TABLE playlisttrack (
playlistid number,
trackid number
)
CREATE TABLE artist (
artistid number,
name text
)
CREATE TABLE invoiceline (
invoicelineid number,
invoiceid number,
trackid number,
unitprice number,
quantity number
)
CREATE TABLE invoice (
invoiceid number,
... | What are the different first names for customers from Brazil who have also had an invoice? | SELECT DISTINCT T1.firstname FROM customer AS T1 JOIN invoice AS T2 ON T1.customerid = T2.customerid WHERE T1.country = "Brazil" |
CREATE TABLE table_17426 (
"Number" real,
"Builder" text,
"Built" text,
"Rebuilt" text,
"Name as rebuilt" text,
"Scrapped/Sold" text
) | What is the highest number listed? | SELECT MAX("Number") FROM table_17426 |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE T... | what is the most expensive flight from BOSTON to DALLAS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
CREATE TABLE table_name_91 (
polling_firm VARCHAR,
t_papadopoulos VARCHAR
) | Which polling firm put T. Papadopoulos at 31%? | SELECT polling_firm FROM table_name_91 WHERE t_papadopoulos = "31%" |
CREATE TABLE table_203_517 (
id number,
"#" number,
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text,
"pts" number
) | is the total score for december 26 the same score as january 2 ? | SELECT (SELECT "score" FROM table_203_517 WHERE "date" = 'december 26') = (SELECT "score" FROM table_203_517 WHERE "date" = 'january 2') |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | what is the last d5 1/2ns dose that patient 65962 was prescribed in 05/2103? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65962) AND prescriptions.drug = 'd5 1/2ns' AND STRFTIME('%y-%m', prescriptions.startdate) = '2103-05' ORDER BY prescriptions.startdate DESC LIMIT 1 |
CREATE TABLE table_2508 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many poles were there in 1996? | SELECT MIN("Poles") FROM table_2508 WHERE "Year" = '1996' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | when was patient 007-16517 prescribed for the last time a medication via inhale medication in the current hospital visit? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517' AND patient.hospitaldischargetime IS NULL)) AND med... |
CREATE TABLE table_26124171_1 (
team VARCHAR,
series VARCHAR
) | How many teams were in the series championnat de france formula renault 2.0? | SELECT team FROM table_26124171_1 WHERE series = "Championnat de France Formula Renault 2.0" |
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 ... | is patient 25696's urea nitrogen last measured on the last hospital visit greater than second to last measured on the last hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25696 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... |
CREATE TABLE table_24549777_1 (
player VARCHAR
) | How man 3-dart averages did gary anderson have? | SELECT COUNT(3 AS _dart_average) FROM table_24549777_1 WHERE player = "Gary Anderson" |
CREATE TABLE table_30120556_1 (
area__acres__ VARCHAR,
civil_parish VARCHAR,
townland VARCHAR
) | What is the area of the civil parish kilworth and townland monadrishane? | SELECT area__acres__ FROM table_30120556_1 WHERE civil_parish = "Kilworth" AND townland = "Monadrishane" |
CREATE TABLE table_61421 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft ( m )" text,
"Floors" real
) | WHAT IS THE NAME WITH 01.0 10 light street? | SELECT "Name" FROM table_61421 WHERE "Street address" = '01.0 10 light street' |
CREATE TABLE table_61734 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Location" text
) | What is the location when KO is the method, the result is a win, and the record is 2-0? | SELECT "Location" FROM table_61734 WHERE "Method" = 'ko' AND "Result" = 'win' AND "Record" = '2-0' |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | For all storms with at least 1 death, show me the name and the total number of deaths with a bar chart, order by the bar in descending. | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Name DESC |
CREATE TABLE table_28307 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
) | What bran is the callsign dytc-fm? | SELECT "Branding" FROM table_28307 WHERE "Callsign" = 'DYTC-FM' |
CREATE TABLE table_2453243_5 (
written_by VARCHAR,
no_in_series VARCHAR
) | Who write episode number 48 in the series? | SELECT written_by FROM table_2453243_5 WHERE no_in_series = "48" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | 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 commission_pct in a bar chart, and order in asc by the y axis. | SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and show Y-axis in descending order. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC |
CREATE TABLE table_4413 (
"Country" text,
"Sales (X1000)" text,
"No. of stores" real,
"Sales area (m\u00b2)" real,
"Sales per area" text,
"Average store size (m\u00b2)" real
) | What is the smallest sales area (m ) that has 4,094/m and more than 2 stores? | SELECT MIN("Sales area (m\u00b2)") FROM table_4413 WHERE "Sales per area" = '€4,094/m²' AND "No. of stores" > '2' |
CREATE TABLE table_41561 (
"Branch" text,
"Address" text,
"Neighborhood" text,
"First branch opened" real,
"Current branch opened" real
) | What is the highest Current Branch Opened, when Neighborhood is W. Portland Park? | SELECT MAX("Current branch opened") FROM table_41561 WHERE "Neighborhood" = 'w. portland park' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the maximum age of patients primarily diagnosed with posterior communicating aneurysm/sda before the admission year 2203? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" AND demographic.admityear >= "2203" |
CREATE TABLE table_4590 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what Date is there a Home team score of 8.15 (63)? | SELECT "Date" FROM table_4590 WHERE "Home team score" = '8.15 (63)' |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | What 300 -level classes do you have available for the Spring or Summer term ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou... |
CREATE TABLE table_54764 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance when Essendon played as the home team? | SELECT COUNT("Crowd") FROM table_54764 WHERE "Home team" = 'essendon' |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | Return a bar chart on what is the state and enrollment of the colleges where have any students who got accepted in the tryout decision. | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' |
CREATE TABLE table_204_604 (
id number,
"year" number,
"date" text,
"driver" text,
"team" text,
"manufacturer" text,
"race distance\nlaps" number,
"race distance\nmiles (km)" text,
"race time" text,
"average speed\n(mph)" number,
"report" text
) | how many total cars did chevrolet manufacture ? | SELECT COUNT(*) FROM table_204_604 WHERE "manufacturer" = 'chevrolet' |
CREATE TABLE table_13038 (
"Average population (x 1000)" real,
"Live births" text,
"Deaths" text,
"Natural change" text,
"Crude birth rate (per 1000)" real,
"Crude death rate (per 1000)" real,
"Natural change (per 1000)" real
) | What is the highest crude death rate when deaths are 3 433 and average population is greater than 298? | SELECT MAX("Crude death rate (per 1000)") FROM table_13038 WHERE "Deaths" = '3 433' AND "Average population (x 1000)" > '298' |
CREATE TABLE table_77332 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | What is the number of 40 to 44 when the 50 to 54 is less than 4,184, and the 15 to 17 is less than 3? | SELECT COUNT("40 to 44") FROM table_77332 WHERE "50 to 54" < '4,184' AND "15 to 17" < '3' |
CREATE TABLE table_name_63 (
director_s_ VARCHAR,
recipient VARCHAR
) | Who directed the film that Avie Luthra received an award for? | SELECT director_s_ FROM table_name_63 WHERE recipient = "avie luthra" |
CREATE TABLE table_56904 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home score with a crowd larger than 25,603? | SELECT "Home team score" FROM table_56904 WHERE "Crowd" > '25,603' |
CREATE TABLE table_name_34 (
Id VARCHAR
) | What 2006 has q2 as the 2007? | SELECT 2006 FROM table_name_34 WHERE 2007 = "q2" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | what were the three most frequent drugs prescribed to patients with an age 60 or above after they had been diagnosed with adv eff arom analgsc nec during a year before within 2 months? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... |
CREATE TABLE table_43908 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
) | What was the score of the game which featured the gold coast blaze as the away team and the adelaide 36ers as the home team? | SELECT "Score" FROM table_43908 WHERE "Away team" = 'gold coast blaze' AND "Home team" = 'adelaide 36ers' |
CREATE TABLE table_name_72 (
year VARCHAR,
status VARCHAR
) | In what year is the status of won? | SELECT year FROM table_name_72 WHERE status = "won" |
CREATE TABLE table_70144 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings (\u20ac)" real,
"Money list rank" real
) | What is the sum of number of wins that have earnings of more than ( )2,864,342 and money list rank of 3? | SELECT SUM("Wins") FROM table_70144 WHERE "Earnings (\u20ac)" > '2,864,342' AND "Money list rank" = '3' |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
pati... | what is the number of patients admitted to hospital since 2103? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) >= '2103' |
CREATE TABLE table_44649 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | what is the highest round when the overall is less than 17? | SELECT MAX("Round") FROM table_44649 WHERE "Overall" < '17' |
CREATE TABLE table_name_40 (
hometown VARCHAR,
name VARCHAR
) | What is Hasan Shah's hometown? | SELECT hometown FROM table_name_40 WHERE name = "hasan shah" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | list the top three most common drugs that patients are prescribed with during the same month after being diagnosed with hypocalcemia - due to rhabdomyolysis until 2 years ago. | 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 = 'hypocalcemia - due to rhabdomyolysis' AND DATETIME... |
CREATE TABLE table_73538 (
"Date" text,
"Opponent" text,
"Location" text,
"Irish Points" real,
"Opp. Points" real,
"Record" text
) | what is the record where the opponent is central connecticut? | SELECT "Record" FROM table_73538 WHERE "Opponent" = 'Central Connecticut' |
CREATE TABLE table_29595 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"First Star" text,
"Decision" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What was the October 22 record? | SELECT "Record" FROM table_29595 WHERE "Date" = 'October 22' |
CREATE TABLE table_name_35 (
school VARCHAR,
mascot VARCHAR
) | Which School has a Mascot of squires? | SELECT school FROM table_name_35 WHERE mascot = "squires" |
CREATE TABLE table_name_95 (
attendance VARCHAR,
week INTEGER
) | What's the attendance when the week was more than 16? | SELECT attendance FROM table_name_95 WHERE week > 16 |
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 allergy (
allergyid number... | did levaquin, dextrose 50 % in water (d50w) iv syringe, or d50 during this hospital encounter be prescribed to patient 018-20179? | 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 = '018-20179' AND patient.hospitaldischargetime IS NULL)) AND medication.drug... |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | At what times is 473 taught during the Summer terms ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.