table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | give me the number of urgent hospital admission patients who have prescription for donepezil. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Donepezil" |
CREATE TABLE table_name_54 (
week_3 VARCHAR,
week_2 VARCHAR
) | Who is the cyber girl in week 3 when Ashley Lowe was the cyber girl in week 2? | SELECT week_3 FROM table_name_54 WHERE week_2 = "ashley lowe" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... | what were the five most frequent specimen tests performed since 6 years ago? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 |
CREATE TABLE table_2820584_3 (
score_in_the_final VARCHAR,
partner VARCHAR
) | What was the score in the final played with Fred McNair as partner? | SELECT score_in_the_final FROM table_2820584_3 WHERE partner = "Fred McNair" |
CREATE TABLE table_17709 (
"Club" text,
"Overall Record" text,
"Goals For" real,
"Goals For Avg." text,
"Goals Against" real,
"Goals Against Avg." text
) | The Dallas Burn had a 12-9-7 record and what number of goals for? | SELECT "Goals For" FROM table_17709 WHERE "Overall Record" = '12-9-7' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | what was patient 13897's daily maximum value of body weight in their first hospital encounter? | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13897 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent... |
CREATE TABLE table_20393 (
"N\u00b0" text,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) | What DAR is available for n. 336 in Italian? | SELECT "DAR" FROM table_20393 WHERE "N\u00b0" = '336' AND "Language" = 'Italian' |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose admission year is less than 2133 and item id is 51132? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2133" AND lab.itemid = "51132" |
CREATE TABLE table_name_62 (
partner VARCHAR,
tournament_name VARCHAR
) | Who was the Partner in the United Airlines Tournament (1)? | SELECT partner FROM table_name_62 WHERE tournament_name = "united airlines tournament (1)" |
CREATE TABLE table_name_22 (
opponents VARCHAR,
venue VARCHAR
) | Who was the opponent at Ullevi? | SELECT opponents FROM table_name_22 WHERE venue = "ullevi" |
CREATE TABLE election (
Delegate VARCHAR,
District VARCHAR
)
CREATE TABLE county (
County_id VARCHAR,
Population INTEGER
) | How many distinct delegates are from counties with population larger than 50000? | SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | What EPID classes are offered in Spring term ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EPID' AND semester.semester = 'Spring' |
CREATE TABLE table_4575 (
"Commodity" text,
"2001-02" text,
"2002-03" text,
"2003-04" text,
"2004-05" text,
"2005-06" text,
"2006-07" text
) | What was the production in 2006-07 for the commodity that produced 2,601 in 2005-06? | SELECT "2006-07" FROM table_4575 WHERE "2005-06" = '2,601' |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
) | List the total scores of body builders in ascending order. | SELECT total FROM body_builder ORDER BY total |
CREATE TABLE table_204_169 (
id number,
"athlete" text,
"event" text,
"race 1\ntime" text,
"race 2\ntime" text,
"total\ntime" text,
"total\nrank" number
) | how long did it take for lyubomir popov to finish the giant slalom in race 1 ? | SELECT "race 1\ntime" FROM table_204_169 WHERE "athlete" = 'lyubomir popov' AND "event" = 'giant slalom' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time, list by the Y from low to high please. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | count the number of times patient 002-34744 had a drain 1 output ml output today. | 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 = '002-34744')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | what were the five frequent specimen tests that were conducted since 2102? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2102' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 |
CREATE TABLE table_39439 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the gold medal count that has a silver medal count less than 0? | SELECT MAX("Gold") FROM table_39439 WHERE "Silver" < '0' |
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 medication (
medi... | what is the monthly minimum amount of acetaminophen of patient 006-168146 until 1 year ago? | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-168146')) AND lab.labname = 'acetaminophen' AND DATETIME(lab.labresulttime) <=... |
CREATE TABLE table_9184 (
"% people under 18 (2005)" text,
"Seine-Saint-Denis" text,
"Paris" text,
"Val-de-Marne" text,
"Val-d'Oise" text,
"France" text
) | WHAT IS THE VAL-D-OISE WITH A FRANCE OF 1.4%? | SELECT "Val-d'Oise" FROM table_9184 WHERE "France" = '1.4%' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | how many hours has it been since patient 011-55642 was admitted for to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL |
CREATE TABLE table_name_95 (
position VARCHAR,
points VARCHAR,
passenger VARCHAR
) | Which position has 30 points and Reiner Stuyvenberg as a passenger? | SELECT position FROM table_name_95 WHERE points = 30 AND passenger = "reiner stuyvenberg" |
CREATE TABLE table_name_99 (
score1 VARCHAR,
opponent VARCHAR
) | What was the final score for the Thurrock? | SELECT score1 FROM table_name_99 WHERE opponent = "thurrock" |
CREATE TABLE table_name_10 (
method VARCHAR,
record VARCHAR,
round VARCHAR,
res VARCHAR
) | What method did Mikhail Ilyukhin win the fight in round 1 when his record was 13-5? | SELECT method FROM table_name_10 WHERE round = "1" AND res = "win" AND record = "13-5" |
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... | how much is the maximum hospital bill that involves a lactate lab test since 2105? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate')) AND STRFTIME('%y', cost.chargetime) >= '2105' GROUP BY cost.hadm_id) AS t1 |
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 (
... | How many white-russian ethnic background patients have prescription for readi-cat 2 (barium sulfate 2% suspension)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Readi-Cat 2 (Barium Sulfate 2% Suspension)" |
CREATE TABLE table_name_15 (
judaism VARCHAR,
other VARCHAR,
buddhism VARCHAR
) | What is the Judaism percentage associated with Buddhism at 0.01% and Other at 0.13%? | SELECT judaism FROM table_name_15 WHERE other = "0.13%" AND buddhism = "0.01%" |
CREATE TABLE table_name_40 (
week VARCHAR,
attendance VARCHAR
) | How many weeks have an attendance of 64,116? | SELECT COUNT(week) FROM table_name_40 WHERE attendance = "64,116" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many of the patients diagnosed with constipation nos had a lab test for cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Constipation NOS" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
CREATE TABLE table_name_38 (
competition VARCHAR,
event VARCHAR,
year VARCHAR
) | what is the competition for the event team all-round in the year before 1913? | SELECT competition FROM table_name_38 WHERE event = "team all-round" AND year < 1913 |
CREATE TABLE table_52948 (
"English Name" text,
"Japanese orthography" text,
"Pronouciation" text,
"abbreviation" text,
"Provider(national government)" text,
"Foundation" real
) | What is the english name of the ministry of defense with an abbreviation of nda b ei-dai( )? | SELECT "English Name" FROM table_52948 WHERE "Provider(national government)" = 'ministry of defense' AND "abbreviation" = 'nda bōei-dai(防衛大)' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 job_history (
EMPLOYEE_ID decimal(6,0... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID |
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... | A bar chart for finding the number of the names of swimmers who has a result of 'win', could you display by the y-axis from high to low? | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY COUNT(name) DESC |
CREATE TABLE table_203_574 (
id number,
"track number" number,
"russian title" text,
"english title" text,
"music" text,
"lyrics" text
) | what it the english title of the only song done with lyrics by v. shumsky ? | SELECT "english title" FROM table_203_574 WHERE "lyrics" = 'v. shumsky' |
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... | since 114 months ago, when did patient 015-1581 last get prescribed hydromorphone hcl and potassium chloride at the same time? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'hydromorphone hcl' AND patient.uniquepid = '015-1581' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), ... |
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 ... | how many days since the last time patient 31088 was diagnosed with mch cmp autm mplnt dfbrl during their current hospital encounter. | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mch cmp autm mplnt dfbrl') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm... |
CREATE TABLE table_name_45 (
years VARCHAR,
soap_opera VARCHAR,
actor VARCHAR
) | What are the years that have un posto al sole as the soap opera, with riccardo polizzy carbonelli as the actor? | SELECT years FROM table_name_45 WHERE soap_opera = "un posto al sole" AND actor = "riccardo polizzy carbonelli" |
CREATE TABLE table_6681 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the highest round that had a pick lower than 8? | SELECT MAX("Round") FROM table_6681 WHERE "Pick #" < '8' |
CREATE TABLE table_48976 (
"Competition" text,
"Played" real,
"Millwall wins" real,
"Drawn" real,
"West Ham wins" real,
"Millwall goals" real,
"West Ham goals" real
) | How many wins did West Ham get when Millwall had more than 23 goal and 5 wins, and they tied 8 times? | SELECT "West Ham wins" FROM table_48976 WHERE "Millwall wins" > '5' AND "Millwall goals" > '23' AND "Drawn" = '8' |
CREATE TABLE table_61311 (
"Player" text,
"Club" text,
"Qualifying Goals" real,
"Finals Goals" real,
"Total Goals" real
) | Which Player has a Total Goals greater than 1 and Qualifying Goals smaller than 3? | SELECT "Player" FROM table_61311 WHERE "Total Goals" > '1' AND "Qualifying Goals" < '3' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | How many patients were diagnosed with venous (peripheral) insufficeincy, unspecified with a drug route of iv? | 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 = "Venous (peripheral) insufficiency, unspecified" AND prescriptions.route = "IV" |
CREATE TABLE market (
market_id number,
country text,
number_cities number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate n... | What are the low and high estimates of film markets? | SELECT low_estimate, high_estimate FROM film_market_estimation |
CREATE TABLE Certificate (
eid VARCHAR,
aid VARCHAR
)
CREATE TABLE Aircraft (
aid VARCHAR,
name VARCHAR
)
CREATE TABLE Employee (
name VARCHAR,
eid VARCHAR
) | Show names for all employees who do not have certificate of Boeing 737-800. | SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" |
CREATE TABLE table_name_6 (
score VARCHAR,
loss VARCHAR
) | The game with a loss of smith (2-4) ended with what score? | SELECT score FROM table_name_6 WHERE loss = "smith (2-4)" |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
) | how many tracks were produced by milanna miles and rick long ? | SELECT COUNT("title") FROM table_203_37 WHERE "producer(s)" = 'milann miles, rick long' |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number... | Tag edits which do not change tags. | WITH tagedits_cte AS (SELECT Ph1.PostId AS pid, Ph1.Id AS phid, MIN(ph2.Id) AS MinId FROM PostHistory AS ph1 INNER JOIN PostHistory AS ph2 ON ph2.PostId = ph1.PostId WHERE (ph2.Id > ph1.Id) AND (ph1.PostHistoryTypeId IN (3, 6, 9)) AND (ph2.PostHistoryTypeId IN (3, 6, 9)) GROUP BY ph1.PostId, Ph1.Id) SELECT t.pid AS "po... |
CREATE TABLE table_name_97 (
home_team VARCHAR
) | What is melbourne's home team score? | SELECT home_team AS score FROM table_name_97 WHERE home_team = "melbourne" |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
) | Show the names of climbers and the heights of mountains they climb Show bar chart, show from low to high by the Y-axis please. | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height |
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
de... | Show names for all employees who do not have certificate of Boeing 737-800. | SELECT name FROM employee EXCEPT SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" |
CREATE TABLE table_10313 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | I want to know the average Gold for total smaller 12 and bronze less than 1 and wushu with silver more than 3 | SELECT AVG("Gold") FROM table_10313 WHERE "Total" < '12' AND "Bronze" < '1' AND "Sport" = 'wushu' AND "Silver" > '3' |
CREATE TABLE table_242785_1 (
notes VARCHAR,
main_legionary_base VARCHAR
) | What are the notes for svishtov , bulgaria? | SELECT notes FROM table_242785_1 WHERE main_legionary_base = "Svishtov , Bulgaria" |
CREATE TABLE table_79126 (
"Date" text,
"Time (UTC)" text,
"Epicenter" text,
"Magnitude" text,
"Depth" text,
"Intensity" text
) | What is the depth of the quake that occurred at 19:48? | SELECT "Depth" FROM table_79126 WHERE "Time (UTC)" = '19:48' |
CREATE TABLE table_name_16 (
years_active VARCHAR,
titles VARCHAR
) | What is the average number of 2nd place finishes for racers active in the year 2000 and more than 0 titles? | SELECT AVG(2 AS nd_pl) FROM table_name_16 WHERE years_active = "2000" AND titles > 0 |
CREATE TABLE table_name_67 (
score VARCHAR,
place VARCHAR
) | What was the score of T3 place? | SELECT score FROM table_name_67 WHERE place = "t3" |
CREATE TABLE table_name_3 (
time VARCHAR,
opponent VARCHAR
) | Which Time has an Opponent of josh branham? | SELECT time FROM table_name_3 WHERE opponent = "josh branham" |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
) | which player can call notre dame his alma matter ? | SELECT "player" FROM table_204_93 WHERE "college" = 'notre dame' |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | Is there a lab with 493 ? | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 493 |
CREATE TABLE table_name_15 (
points INTEGER,
lyricist VARCHAR
) | What is the total number of points for ray agius | SELECT SUM(points) FROM table_name_15 WHERE lyricist = "ray agius" |
CREATE TABLE table_73831 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What is the Deliblato village known as in Cyrillic? | SELECT "Cyrillic Name Other Names" FROM table_73831 WHERE "Settlement" = 'Deliblato' |
CREATE TABLE table_7299 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
) | What is the Set 3 on 30 may, and a Set 1 is 20 25? | SELECT "Set 3" FROM table_7299 WHERE "Date" = '30 may' AND "Set 1" = '20–25' |
CREATE TABLE table_68476 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What's the 1st leg score when Team 1 was Gor Mahia? | SELECT "1st leg" FROM table_68476 WHERE "Team 1" = 'gor mahia' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | what is last weight of patient 15986 in this month. | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15986)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... |
CREATE TABLE table_30344 (
"Character" text,
"Game" text,
"Platform" text,
"Status" text,
"Mystic Arte" text,
"Character Voice" text
) | Which character is yumi kakazu the character voice? | SELECT "Character" FROM table_30344 WHERE "Character Voice" = 'Yumi Kakazu' |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | Return a bar chart on how many counties correspond to each police force?, sort by the Y-axis in asc. | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id numbe... | how many patients were diagnosed with chrnc hpt c wo hpat coma but did not come back to the hospital within 2 months in the previous year? | SELECT (SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'chrnc hpt ... |
CREATE TABLE team_half (
year number,
league_id text,
team_id text,
half number,
div_id text,
div_win text,
rank number,
g number,
w number,
l number
)
CREATE TABLE team_franchise (
franchise_id text,
franchise_name text,
active text,
na_assoc text
)
CREATE TABL... | Compute the total salary that the player with first name Len and last name Barker received between 1985 to 1990. | SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990 |
CREATE TABLE table_41534 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the highest lost number of the team with less than 14 points and less than 18 played? | SELECT MAX("Lost") FROM table_41534 WHERE "Points" < '14' AND "Played" < '18' |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE locations (
location_id number,
stre... | display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara. | SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara") |
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
) | What are the nations that have more than two ships? | SELECT nationality FROM ship GROUP BY nationality HAVING COUNT(*) > 2 |
CREATE TABLE table_name_91 (
completed VARCHAR,
pennant_number VARCHAR
) | When is the completed date of the destroyer with a pennant number h63? | SELECT completed FROM table_name_91 WHERE pennant_number = "h63" |
CREATE TABLE table_29209 (
"Model" text,
"Speed (GHz)" text,
"L2 Cache (MB)" real,
"L3 Cache (MB)" real,
"FSB (MHz)" real,
"TDP (W)" real
) | What's the maximal L3 cache for any of the models given? | SELECT MAX("L2 Cache (MB)") FROM table_29209 |
CREATE TABLE table_73771 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
) | What is shown for august 21-22 when november 3 is november 3, 1994? | SELECT "August 21-22" FROM table_73771 WHERE "November 3" = 'November 3, 1994' |
CREATE TABLE table_name_11 (
format VARCHAR,
owner VARCHAR,
frequency VARCHAR
) | What is the format for Cherry Creek Radio with frequency of 0 92.1 fm? | SELECT format FROM table_name_11 WHERE owner = "cherry creek radio" AND frequency = "0 92.1 fm" |
CREATE TABLE table_name_39 (
bronze VARCHAR,
rank VARCHAR,
silver VARCHAR
) | Name the total number of bronze with rank of 5 and silver more than 1 | SELECT COUNT(bronze) FROM table_name_39 WHERE rank = "5" AND silver > 1 |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | how many patients underwent bronchodilator - nebulized during the same hospital encounter after the diagnosis with acute renal failure - due to sepsis, in 2104? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute renal failure - due to sepsis' AND STRFTIME('%y', diagnosis.diagnos... |
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... | calculate the number of patients diagnosed with icd9 code 5589 who had a blood test | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "5589" AND lab.fluid = "Blood" |
CREATE TABLE table_train_227 (
"id" int,
"gender" string,
"diabetic" string,
"allergic_to_study_products" bool,
"hba1c" float,
"a1c" float,
"age" float,
"NOUSE" float
) | a diagnosis of type i diabetes | SELECT * FROM table_train_227 WHERE diabetic = 'i' |
CREATE TABLE table_name_53 (
grid VARCHAR,
time_retired VARCHAR
) | What is the total grid of the team with a time/retired of +7.346? | SELECT COUNT(grid) FROM table_name_53 WHERE time_retired = "+7.346" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | How many patients are admitted before admission year 2145 with drug route ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2145" AND prescriptions.route = "IVPCA" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | when was the last measuring of heartrate of patient 022-89058 on the last 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 = '022-89058') AND NOT patient.unitdischargetime IS NU... |
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | Show the number of brand from each brand, and I want to show by the how many brand from high to low. | SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand) DESC |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | let me know the time of admission and days for which patient paul edwards was hospitalized. | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.name = "Paul Edwards" |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Show me about the distribution of Sex and the average of Weight , and group by attribute Sex in a bar chart, I want to sort from high to low by the X please. | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC |
CREATE TABLE table_name_65 (
penanced VARCHAR,
executions_in_effigie VARCHAR,
total VARCHAR
) | How many were penanced with 0 executions in effigie for a total of 21? | SELECT penanced FROM table_name_65 WHERE executions_in_effigie = "0" AND total = "21" |
CREATE TABLE table_17846 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many points does Croesyceiliog RFC have? | SELECT "Points" FROM table_17846 WHERE "Club" = 'Croesyceiliog RFC' |
CREATE TABLE table_170958_2 (
population INTEGER,
area_km_2 VARCHAR
) | What is the maximum population of the land with an area of 276.84 km2? | SELECT MAX(population) FROM table_170958_2 WHERE area_km_2 = "276.84" |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | Upvoted questions where all answers are downvoted. | WITH cte AS (SELECT DISTINCT q.Id AS "post_link", COUNT(p.Id) OVER (PARTITION BY q.Id) AS "upvotedanswercount", COUNT(a.Id) OVER (PARTITION BY q.Id) AS totalAnswers, q.Score FROM Posts AS q LEFT JOIN Posts AS p ON q.Id = p.ParentId AND p.Score >= 0 INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.Score >= 1) SELECT *... |
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE domain_publi... | return me all the keywords . | SELECT keyword FROM keyword |
CREATE TABLE table_21945 (
"Actor in original production" text,
"Actor required" text,
"GamePlan" text,
"FlatSpin" text,
"RolePlay" text
) | How many RolePlay actors played the role requiring a 'male, younger' actor? | SELECT COUNT("RolePlay") FROM table_21945 WHERE "Actor required" = 'Male, younger' |
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 name and the sum of code , and group by attribute name, could you order by the Y in ascending? | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code |
CREATE TABLE table_name_33 (
seats_2006 INTEGER,
parties_and_voter_communities VARCHAR,
_percentage_2006 VARCHAR
) | what is the total number of seats 2006 that has parties and voter turnout in % and whose %2006 is greater than 51.5? | SELECT SUM(seats_2006) FROM table_name_33 WHERE parties_and_voter_communities = "voter turnout in %" AND _percentage_2006 > 51.5 |
CREATE TABLE table_23242933_2 (
title VARCHAR,
us_viewers__millions_ VARCHAR
) | How many different titles are there of episodes that have been seen by 7.84 million people in the US/ | SELECT COUNT(title) FROM table_23242933_2 WHERE us_viewers__millions_ = "7.84" |
CREATE TABLE table_59227 (
"Date" text,
"Round" text,
"Opponents" text,
"H / A" text,
"Result F\u2013A" text,
"Attendance" real
) | What is the H/A of the game on 24 january 2009? | SELECT "H / A" FROM table_59227 WHERE "Date" = '24 january 2009' |
CREATE TABLE table_name_77 (
year INTEGER,
co_drivers VARCHAR
) | What is the earliest year that had a co-driver of Roger Enever? | SELECT MIN(year) FROM table_name_77 WHERE co_drivers = "roger enever" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | calculate the total number of outputs from patient 015-23047 today. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.cellpath LIKE '%ou... |
CREATE TABLE table_name_74 (
trailing_party VARCHAR,
party_won VARCHAR,
year VARCHAR
) | What is Trailing Party, when Party Won is 'Janata Dal', and when Year is '1996'? | SELECT trailing_party FROM table_name_74 WHERE party_won = "janata dal" AND year = 1996 |
CREATE TABLE table_name_45 (
time_retired VARCHAR,
grid VARCHAR,
driver VARCHAR
) | What is the time/retired for jo siffert with a grid under 11? | SELECT time_retired FROM table_name_45 WHERE grid < 11 AND driver = "jo siffert" |
CREATE TABLE table_name_48 (
team_2 VARCHAR,
team_1 VARCHAR
) | Which Team 2 faced Team 1 from Barcelona? | SELECT team_2 FROM table_name_48 WHERE team_1 = "barcelona" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.