table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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 number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | tell me the sex of patient 29806. | SELECT patients.gender FROM patients WHERE patients.subject_id = 29806 |
CREATE TABLE table_46384 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Series" text
) | Which Visitor has a Series of 2 1? | SELECT "Visitor" FROM table_46384 WHERE "Series" = '2 – 1' |
CREATE TABLE table_47910 (
"Reservation" text,
"Location" text,
"1969" real,
"1979" real,
"1989" real,
"2000" real
) | What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9? | SELECT SUM("1979") FROM table_47910 WHERE "Reservation" = 'standing rock indian reservation' AND "1989" < '54.9' |
CREATE TABLE table_22423 (
"No. in series" text,
"Title" text,
"Directed By" text,
"Written By" text,
"air date" text,
"Production code" text
) | When 1008/1009 is the production code how many directors are there? | SELECT COUNT("Directed By") FROM table_22423 WHERE "Production code" = '1008/1009' |
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 ... | specify the primary disease and gender of patient id 1121 | SELECT demographic.gender, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "1121" |
CREATE TABLE table_name_21 (
lineup VARCHAR,
location VARCHAR
) | Name the lineup for washington dc | SELECT lineup FROM table_name_21 WHERE location = "washington dc" |
CREATE TABLE table_name_34 (
rank INTEGER,
country VARCHAR,
total VARCHAR
) | What rank was Peru with a total greater than 3? | SELECT MAX(rank) FROM table_name_34 WHERE country = "peru" AND total > 3 |
CREATE TABLE table_name_12 (
games INTEGER,
lost INTEGER
) | What is the lowest number of games with less than 1 loss? | SELECT MIN(games) FROM table_name_12 WHERE lost < 1 |
CREATE TABLE table_31760 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Rank" text,
"Points" text
) | How many points did the 2005 1st place team receive? | SELECT "Points" FROM table_31760 WHERE "Year" = '2005' |
CREATE TABLE table_68693 (
"Episode #" real,
"Title" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Part 5" text,
"Part 6" text
) | When is Part 2, when Part 4 is on December 9, 2007? | SELECT "Part 2" FROM table_68693 WHERE "Part 4" = 'december 9, 2007' |
CREATE TABLE table_45690 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the sum of December, when Game is greater than 31, and when Score is '5 - 2'? | SELECT SUM("December") FROM table_45690 WHERE "Game" > '31' AND "Score" = '5 - 2' |
CREATE TABLE pilot (
Pilot_name VARCHAR,
Pilot_ID VARCHAR
)
CREATE TABLE aircraft (
Model VARCHAR,
Aircraft_ID VARCHAR
)
CREATE TABLE pilot_record (
Aircraft_ID VARCHAR,
Pilot_ID VARCHAR
) | Show the names of pilots and models of aircrafts they have flied with. | SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID |
CREATE TABLE EMPLOYEE (
city VARCHAR
) | How many distinct cities does the employees live in? | SELECT COUNT(DISTINCT city) FROM EMPLOYEE |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | For those days with the 3 largest maximum gust speeds, can you plot a bar chart to compare the average of mean humidity of each day of the weeks? | SELECT date, AVG(mean_humidity) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 |
CREATE TABLE table_30108346_1 (
country VARCHAR,
troops_per_one_million_population VARCHAR
) | Name the country for troops per one million being 54.9 | SELECT country FROM table_30108346_1 WHERE troops_per_one_million_population = "54.9" |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | Draw a bar chart that counts the number of venues of each workshop, and I want to order in ascending by the X. | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY Venue |
CREATE TABLE table_29356 (
"Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." real,
"Series No." real,
"Episode" text,
"Director" text,
"Writer" text,
"Original airdate" text
) | What is every episode number for the series number 3? | SELECT "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." FROM table_29356 WHERE "Series No." = '3' |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate t... | Users with more than 10,000 reputation. | SELECT COUNT(Id) FROM Users WHERE Reputation >= 10000 |
CREATE TABLE table_53492 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
) | What was Rudy Harris' pick number in round 4? | SELECT MAX("Pick") FROM table_53492 WHERE "Round" = 'round 4' AND "Player" = 'rudy harris' |
CREATE TABLE table_39089 (
"Election" real,
"Labour" real,
"Conservative" real,
"Liberal" real,
"Social Democratic Party" real,
"Social and Liberal Democrats/ Liberal Democrats" real,
"Independent" real,
"Green" real,
"Other" text,
"Control" text
) | Which Other has a Green of 0, and an Independent of 1, and a Labour smaller than 45, and a Control of labour lose to no overall control? | SELECT "Other" FROM table_39089 WHERE "Green" = '0' AND "Independent" = '1' AND "Labour" < '45' AND "Control" = 'labour lose to no overall control' |
CREATE TABLE table_7473 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the label for the catalog of none, and is in the United Kingdom? | SELECT "Label" FROM table_7473 WHERE "Catalog" = 'none' AND "Region" = 'united kingdom' |
CREATE TABLE table_name_9 (
visitor VARCHAR,
date VARCHAR
) | Who was the visitor on March 27? | SELECT visitor FROM table_name_9 WHERE date = "march 27" |
CREATE TABLE table_43963 (
"Bank type" text,
"Number of branches" real,
"On-site ATMs" real,
"Off-site ATMs" real,
"Total ATMs" real
) | What is the minimum total ATMs with new private sector banks as the bank type, and the on-site ATMs are greater than 1883? | SELECT MIN("Total ATMs") FROM table_43963 WHERE "Bank type" = 'new private sector banks' AND "On-site ATMs" > '1883' |
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 marital status is divorced and admission year is less than 2121? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2121" |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_... | find a flight between DENVER and OAKLAND the flight should be in the afternoon and arrive close to 5pm the flight should be nonstop | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((((flight.arrival_time <= 1715 AND flight.arrival_time >= 1645) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.t... |
CREATE TABLE table_19926 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What is the first episode with a netflix episode code of s02e20? | SELECT MIN("Episode") FROM table_19926 WHERE "Netflix" = 'S02E20' |
CREATE TABLE table_49785 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Points" real
) | How many points are there for rank 5 with more than 34 games? | SELECT COUNT("Points") FROM table_49785 WHERE "Rank" = '5' AND "Games" > '34' |
CREATE TABLE employee (
employeeid number,
lastname text,
firstname text,
title text,
reportsto number,
birthdate time,
hiredate time,
address text,
city text,
state text,
country text,
postalcode text,
phone text,
fax text,
email text
)
CREATE TABLE playlist... | Count the number of tracks that are of the media type 'AAC audio file'. | SELECT COUNT(*) FROM mediatype AS T1 JOIN track AS T2 ON T1.mediatypeid = T2.mediatypeid WHERE T1.name = "AAC audio file" |
CREATE TABLE table_29093 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
) | Who is the director where title is 'the comeback'? | SELECT "Director" FROM table_29093 WHERE "Title" = 'The Comeback' |
CREATE TABLE table_25318033_1 (
races VARCHAR,
points VARCHAR
) | Which races have 137 points? | SELECT races FROM table_25318033_1 WHERE points = "137" |
CREATE TABLE table_49494 (
"Issued" real,
"Type" text,
"Design" text,
"Serial format" text,
"Serials issued" text
) | What was the issued serial for yellow on blue design issued in 1955? | SELECT "Serials issued" FROM table_49494 WHERE "Design" = 'yellow on blue' AND "Issued" = '1955' |
CREATE TABLE table_36181 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | How many games have more than 10 points and more than 2 draws? | SELECT COUNT("Games") FROM table_36181 WHERE "Points" = '10' AND "Drawn" > '2' |
CREATE TABLE table_name_27 (
away_team VARCHAR,
home_team VARCHAR
) | What is the score of the away team that played richmond? | SELECT away_team AS score FROM table_name_27 WHERE home_team = "richmond" |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of code , and group by attribute founder. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder |
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... | Which classes do I have to take to declare an CHEM major ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CHEM%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
CREATE TABLE table_57909 (
"Year" real,
"Title" text,
"Original channel" text,
"Role" text,
"Note" text
) | what is the original channel when the year is after 2012? | SELECT "Original channel" FROM table_57909 WHERE "Year" > '2012' |
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 prescriptions... | provide the number of patients whose primary disease is st elevated myocardial infarction\cardiac cath and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Joint Fluid" |
CREATE TABLE table_27042 (
"\u2116" real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What is the most recent episode number written by Matthew Pitts? | SELECT MAX("#") FROM table_27042 WHERE "Written by" = 'Matthew Pitts' |
CREATE TABLE table_name_49 (
place VARCHAR,
player VARCHAR
) | What Place has a Player of bernhard langer? | SELECT place FROM table_name_49 WHERE player = "bernhard langer" |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose marital status is married and diagnoses short title is dmii hprosmlr uncontrold? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "DMII hprosmlr uncontrold" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | when was the last time since 07/20/2103 patient 004-32407 reached the minimum heartrate? | 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 = '004-32407')) AND NOT vitalperiodic.heartrate IS NUL... |
CREATE TABLE table_name_66 (
bronze INTEGER,
gold VARCHAR,
rank VARCHAR
) | How many bronzes for nations with over 22 golds and ranked under 2? | SELECT MAX(bronze) FROM table_name_66 WHERE gold > 22 AND rank < 2 |
CREATE TABLE table_name_38 (
third_vice_president VARCHAR,
inaugurated VARCHAR
) | What is Third Vice President, when Inaugurated is '15 March 1934'? | SELECT third_vice_president FROM table_name_38 WHERE inaugurated = "15 march 1934" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | how many days have passed since the first time that patient 10855 has had an d10w intake on the current icu visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) ... |
CREATE TABLE table_35709 (
"Source" text,
"Date" text,
"Fidesz" text,
"MSZP" text,
"SZDSZ" text,
"Jobbik" text,
"others" text
) | What is the Jobbik percentage with a Fidesz of 61% and others of 2%? | SELECT "Jobbik" FROM table_35709 WHERE "Fidesz" = '61%' AND "others" = '2%' |
CREATE TABLE table_name_1 (
finish VARCHAR,
qual VARCHAR
) | Name the finish which has qual of 144.817 | SELECT finish FROM table_name_1 WHERE qual = "144.817" |
CREATE TABLE table_204_15 (
id number,
"year" number,
"date" text,
"venue" text,
"city" text,
"country" text,
"notes" text
) | how many times was a conference held in san francisco ? | SELECT COUNT(*) FROM table_204_15 WHERE "city" = 'san francisco' |
CREATE TABLE table_16388478_2 (
home_team VARCHAR,
ground VARCHAR
) | What were the home team scores at york park? | SELECT home_team AS score FROM table_16388478_2 WHERE ground = "York Park" |
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE inst (
instid number,
name text,
country text
) | Which authors belong to the institution 'Google'? Show the first names and last names. | SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google" |
CREATE TABLE table_10195 (
"Goal" real,
"Date" text,
"Venue" text,
"Result" text,
"Competition" text
) | What day is miami the venue with 38 goals? | SELECT "Date" FROM table_10195 WHERE "Venue" = 'miami' AND "Goal" = '38' |
CREATE TABLE table_name_79 (
province VARCHAR,
party VARCHAR,
name VARCHAR
) | Ken Wright of the National Party was from which province? | SELECT province FROM table_name_79 WHERE party = "national" AND name = "ken wright" |
CREATE TABLE table_62372 (
"1999/ 00" text,
"2000/ 01" text,
"2001/ 02" text,
"2002/ 03" text,
"2003/ 04" text,
"2004/ 05" text,
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
... | Which 2008/ 09 has a 1999/ 00 of non-ranking tournaments? | SELECT "2008/ 09" FROM table_62372 WHERE "1999/ 00" = 'non-ranking tournaments' |
CREATE TABLE table_12120 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the score for the 2nd leg when Belasica is team 2? | SELECT "2nd leg" FROM table_12120 WHERE "Team 2" = 'belasica' |
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,
... | how many patients whose ethnicity is white and drug route is ou? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "OU" |
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 number of patients whose ethnicity is american indian/alaska native and diagnoses icd9 code is v4581? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "V4581" |
CREATE TABLE table_1308 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What was the title when there were 14.39 million viewers? | SELECT "Title" FROM table_1308 WHERE "U.S. viewers (millions)" = '14.39' |
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,
... | show me the top five most common diagnoses for patients with 30s? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
di... | What is the name and salary of the employee with the id 242518965? | SELECT name, salary FROM employee WHERE eid = 242518965 |
CREATE TABLE table_27383390_4 (
team VARCHAR,
date_of_vacancy VARCHAR
) | What is the team with the date of vacancy 8 dec 2010? | SELECT team FROM table_27383390_4 WHERE date_of_vacancy = "8 Dec 2010" |
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... | give me the number of patients whose procedure long title is automatic implantable cardioverter/defibrillator (aicd) check? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Automatic implantable cardioverter/defibrillator (AICD) check" |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id n... | when was the first time patient 1014 got a lab test for platelet count since 19 months ago? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1014) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '... |
CREATE TABLE table_name_6 (
game INTEGER,
high_rebounds VARCHAR
) | What is the sum of Game(s), when High Rebounds is 'Pierson (6)'? | SELECT SUM(game) FROM table_name_6 WHERE high_rebounds = "pierson (6)" |
CREATE TABLE table_37649 (
"Commune" text,
"Area (km 2 )" real,
"2002 population" real,
"Density (km 2 )" real,
"Government website" text
) | What is the density that has an area smaller than 2,200.2 and a population larger than 2,599? | SELECT COUNT("Density (km 2 )") FROM table_37649 WHERE "Area (km 2 )" < '2,200.2' AND "2002 population" > '2,599' |
CREATE TABLE table_name_40 (
Box VARCHAR,
away_team VARCHAR
) | What was the box score for the game where the away team was the sydney spirit? | SELECT Box AS score FROM table_name_40 WHERE away_team = "sydney spirit" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | in 2105 how many patients with diabetes mellitus were diagnosed during the same month after previously being diagnosed with acute respiratory distress? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniquepi... |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients who were born before 2182? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2182" |
CREATE TABLE table_56818 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine \u2020" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | What engine did David Coulthard have in his mp4-13 chassis? | SELECT "Engine \u2020" FROM table_56818 WHERE "Chassis" = 'mp4-13' AND "Driver" = 'david coulthard' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | count the number of patients whose days of hospital stay is greater than 4 and procedure short title is other phototherapy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.short_title = "Other phototherapy" |
CREATE TABLE table_name_45 (
identifier VARCHAR,
power VARCHAR
) | What is the identifier that has 50,000 watts of power? | SELECT identifier FROM table_name_45 WHERE power = "50,000 watts" |
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 number of patients whose insurance is medicaid and diagnoses long title is observation for suspected genetic or metabolic condition? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.long_title = "Observation for suspected genetic or metabolic condition" |
CREATE TABLE table_64220 (
"Event" text,
"Date" text,
"Location" text,
"Winning skip" text,
"Runner-up skip" text
) | What event did Patti Lank have the winning skip? | SELECT "Event" FROM table_64220 WHERE "Winning skip" = 'patti lank' |
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 ethnicity is black/cape verdean and age is less than 30? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "30" |
CREATE TABLE table_name_62 (
transfer_fee VARCHAR,
type VARCHAR,
name VARCHAR
) | WHAT TRANSFER FEE HAS A TYPE OF TRANSFER FOR DOS SANTOS? | SELECT transfer_fee FROM table_name_62 WHERE type = "transfer" AND name = "dos santos" |
CREATE TABLE table_35591 (
"Year" text,
"Winners" text,
"Score" text,
"Runner-up" text,
"Venue" text
) | What is the venue of the match with a score of 33-22? | SELECT "Venue" FROM table_35591 WHERE "Score" = '33-22' |
CREATE TABLE table_name_7 (
team VARCHAR,
date VARCHAR
) | Which team did they play on March 11? | SELECT team FROM table_name_7 WHERE date = "march 11" |
CREATE TABLE table_38195 (
"Rank" real,
"Name" text,
"Height m (ft)" text,
"Floors" real,
"Year" real
) | What is the highest floors with rank greater than 1 in Conrad Dubai? | SELECT MAX("Floors") FROM table_38195 WHERE "Rank" > '1' AND "Name" = 'conrad dubai' |
CREATE TABLE table_62528 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Place of the Player with a To par of 6? | SELECT "Place" FROM table_62528 WHERE "To par" = '–6' |
CREATE TABLE table_name_87 (
d_48_√ VARCHAR,
d_46_√ VARCHAR
) | What is the D 48 with a D 46 with r 33 o? | SELECT d_48_√ FROM table_name_87 WHERE d_46_√ = "r 33 o" |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Guests (
gue... | Show each gender code and the corresponding count of guests sorted by the count in descending order. Show bar chart. | SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC |
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_... | Return a bar chart on what are the name and assets of each company, sorted in ascending order of company name? | SELECT name, Assets_billion FROM Companies ORDER BY name |
CREATE TABLE table_name_35 (
score VARCHAR,
away_team VARCHAR
) | What is the score for the away team Chelsea? | SELECT score FROM table_name_35 WHERE away_team = "chelsea" |
CREATE TABLE table_47952 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
) | What is Date, when Format is Vinyl, and when Label is Mercury? | SELECT "Date" FROM table_47952 WHERE "Format" = 'vinyl' AND "Label" = 'mercury' |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
... | What is the most recent paper of image understanding ? | SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'image understanding' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC |
CREATE TABLE table_name_35 (
example_code__huc_ INTEGER,
level VARCHAR,
example_name VARCHAR,
digits VARCHAR
) | What is the mean huc example code when the example name's lower snake, there are 6 digits, and less than 3 levels? | SELECT AVG(example_code__huc_) FROM table_name_35 WHERE example_name = "lower snake" AND digits = 6 AND level < 3 |
CREATE TABLE table_32738 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What away team played when the home team scoreed 5.7 (37)? | SELECT "Away team" FROM table_32738 WHERE "Home team score" = '5.7 (37)' |
CREATE TABLE table_24921 (
"School" text,
"Location" text,
"Team Name" text,
"Colors" text,
"Varsity Teams" real,
"NJCAA Championships" real
) | What is the minimum possible NJCAA championships? | SELECT MIN("NJCAA Championships") FROM table_24921 |
CREATE TABLE table_name_65 (
moving_to VARCHAR,
date_from VARCHAR
) | Where did the player loaned out on 27 november 2008 move to ? | SELECT moving_to FROM table_name_65 WHERE date_from = "27 november 2008" |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me a bar chart for all_games_percent of each team name, could you list in asc by the y axis please? | SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
CREATE TABLE table_name_39 (
points_jury VARCHAR,
dance VARCHAR
) | What is the Points Jury for Dance pop? | SELECT points_jury FROM table_name_39 WHERE dance = "pop" |
CREATE TABLE table_name_37 (
final_rank VARCHAR,
rank_in_fs VARCHAR,
rank_in_sp VARCHAR
) | How many skaters have a Rank in FS of 3, and a Rank in SP larger than 4? | SELECT COUNT(final_rank) FROM table_name_37 WHERE rank_in_fs = 3 AND rank_in_sp > 4 |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | Find the number of students whose age is older than the average age for each gender, and I want to sort by the x axis in desc. | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex DESC |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE savings (
custid number,
balance number
) | Find the number of accounts with a savings balance that is higher than the average savings balance. | SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings) |
CREATE TABLE table_name_54 (
pick__number INTEGER,
overall VARCHAR,
position VARCHAR,
college VARCHAR
) | What was the Pick Number when the position was wide receiver, the college was Southern Miss with an overall less than 186? | SELECT AVG(pick__number) FROM table_name_54 WHERE position = "wide receiver" AND college = "southern miss" AND overall < 186 |
CREATE TABLE table_19934 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Name the number of episode for phyllo dough | SELECT COUNT("Episode") FROM table_19934 WHERE "Segment C" = 'Phyllo Dough' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is the admission location and discharge location of subject id 4589? | SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "4589" |
CREATE TABLE table_203_186 (
id number,
"painter" text,
"composition" number,
"drawing" number,
"color" number,
"expression" number
) | which artists scored at least 16 for composition ? | SELECT "painter" FROM table_203_186 WHERE "composition" >= 16 |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Fo... | Bar graph to show the number of took office from different took office, and show by the Y in ascending. | SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office) |
CREATE TABLE table_25486 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the high points when rebounds were Terrence Williams (8)? | SELECT "High points" FROM table_25486 WHERE "High rebounds" = 'Terrence Williams (8)' |
CREATE TABLE table_21584646_10 (
champion VARCHAR,
runner_up VARCHAR
) | How many champions are shown for the runner-up of stefan edberg? | SELECT COUNT(champion) FROM table_21584646_10 WHERE runner_up = "Stefan Edberg" |
CREATE TABLE table_name_20 (
visitor VARCHAR,
home VARCHAR
) | Which visitor has a Los Angeles home? | SELECT visitor FROM table_name_20 WHERE home = "los angeles" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.