table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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
)
... | find out the number of patients who have liver transplant primary disease and were admitted for more than 8 days in hospital. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "8" |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | until 2104 what are the top three most frequent procedures that patients received in the same hospital encounter after the diagnosis of disease of pharynx nec? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid ... | since 05/2103, what was the monthly minimum dose of enteral tube feeds via gt of patient 030-10559? | SELECT MIN(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 = '030-10559')) AND intakeoutput.celllabel = 'enter... |
CREATE TABLE table_name_52 (
being__qualities_ VARCHAR,
having__things_ VARCHAR
) | Name the being for having things of language, religions, work, customs, values, norms? | SELECT being__qualities_ FROM table_name_52 WHERE having__things_ = "language, religions, work, customs, values, norms" |
CREATE TABLE table_name_28 (
fast_laps VARCHAR,
points VARCHAR,
series VARCHAR,
races VARCHAR
) | How many fast laps are in 6 races with 30 points in the World Series by Nissan? | SELECT fast_laps FROM table_name_28 WHERE series = "world series by nissan" AND races = "6" AND points = "30" |
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
... | Return the name of the member who is in charge of the most events. | SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_51944 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" real
) | There is a building at 800 Boylston Street, how many floors does it have? | SELECT SUM("Floors") FROM table_51944 WHERE "Street address" = '800 boylston street' |
CREATE TABLE table_27734769_8 (
date VARCHAR,
high_rebounds VARCHAR
) | How many times was the high rebounds by marcus camby (18)? | SELECT COUNT(date) FROM table_27734769_8 WHERE high_rebounds = "Marcus Camby (18)" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | tell me the yearly maximum amount of volume expanders in patient 016-27397's body since 05/09/2103? | SELECT MAX(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 = '016-27397')) AND intakeoutput.celllabel = 'volum... |
CREATE TABLE table_55889 (
"Name" text,
"Entered office" text,
"Left office" text,
"Political party" text,
"Monarchs served" text,
"Birth Place" text
) | To which political party did the prime minister who served under George V and was born in Manchester belong? | SELECT "Political party" FROM table_55889 WHERE "Monarchs served" = 'george v' AND "Birth Place" = 'manchester' |
CREATE TABLE table_23987362_2 (
hicham_el_guerrouj___mar__ VARCHAR
) | How many of 3:26.00 when hicham el guerrouj ( mar ) is hudson de souza ( bra )? | SELECT COUNT(3) AS :2600 FROM table_23987362_2 WHERE hicham_el_guerrouj___mar__ = "Hudson de Souza ( BRA )" |
CREATE TABLE table_name_26 (
first_issued INTEGER,
color VARCHAR
) | When was Color of green last issued? | SELECT MAX(first_issued) FROM table_name_26 WHERE color = "green" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose age is less than 54 and diagnoses icd9 code is 7470? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "54" AND diagnoses.icd9_code = "7470" |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
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,
g... | Who is the professor for PreMajor classes next Winter ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... |
CREATE TABLE table_10726 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | What's the school of the player with a hometown of little rock, arkansas? | SELECT "School" FROM table_10726 WHERE "Hometown" = 'little rock, arkansas' |
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 patients diagnosed with unspecified hypertensive heart disease with heart failure who had joint fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hyp ht dis NOS w ht fail" AND lab.fluid = "Joint Fluid" |
CREATE TABLE table_25790 (
"Rank" real,
"City/Town" text,
"County" text,
"Region/Province" text,
"Population" real,
"Country" text
) | When birkenhead is the city/town and merseyside is the county and england is the country how many ranks are there? | SELECT COUNT("Rank") FROM table_25790 WHERE "Country" = 'England' AND "County" = 'Merseyside' AND "City/Town" = 'Birkenhead' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, and rank from high to low by the Y. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
... | Quality of tag over a weekly cycle. The average score of a question with a specified tag over one hour, for every hour in the week, in the range [0, 168).
The idea was to test whether certain times of the week produce better questions than other times. | SELECT AVG(CAST(Score AS FLOAT)) AS score, DH FROM (SELECT TagName, Tags.Id, (TIME_TO_STR(CreationDate, '%W') - 1) * 24 + TIME_TO_STR(CreationDate, '%h') AS DH, Score FROM Tags INNER JOIN PostTags ON TagId = Tags.Id INNER JOIN Posts ON PostId = Posts.Id WHERE Posts.ParentId IS NULL AND TagName = '##TagName##') AS sq GR... |
CREATE TABLE table_27605 (
"Team" text,
"Played" real,
"Won" real,
"Lost" real,
"No-Result" real,
"Abandoned" real,
"Bonus Points" real,
"Total Points" real,
"Net Run Rate" text
) | What team had a net run rate of 0.134? | SELECT "Team" FROM table_27605 WHERE "Net Run Rate" = '0.134' |
CREATE TABLE table_25143284_1 (
location VARCHAR,
score_qualifying VARCHAR
) | Where was the competition with a qualifying score of 58.425? | SELECT location FROM table_25143284_1 WHERE score_qualifying = "58.425" |
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 whose admission year is less than 2194 and diagnoses short title is diabetic retinopathy nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.short_title = "Diabetic retinopathy NOS" |
CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Cod... | What is the total number of names of products?, order in descending by the the number of product name. | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name) DESC |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | what are the three lab tests that are most common until 2 years ago? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3 |
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... | what is the number of patients whose year of birth is less than 2071? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2071" |
CREATE TABLE table_64791 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the Time of the Great Britain players with Notes of SA/B? | SELECT "Time" FROM table_64791 WHERE "Notes" = 'sa/b' AND "Country" = 'great britain' |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | when was the first time patient 015-23047's heartrate was greater than 104.0 on the current icu visit. | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047') AND patient.unitdischargetime IS NULL) ... |
CREATE TABLE table_18042 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | How many U.S. viewers, in millions, watched the episode that aired on November 13, 2007? | SELECT "U.S. viewers (millions)" FROM table_18042 WHERE "Original air date" = 'November 13, 2007' |
CREATE TABLE table_22621 (
"Country" text,
"TV Network(s)" text,
"Series Premiere" text,
"Weekly Schedule" text,
"Status" text
) | What is every TV network with a weekly schedule of Monday to Thursday @ 11:00 pm? | SELECT "TV Network(s)" FROM table_22621 WHERE "Weekly Schedule" = 'Monday to Thursday @ 11:00 pm' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is drug name of drug code mago140? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "MAGO140" |
CREATE TABLE table_204_94 (
id number,
"outcome" text,
"date" text,
"tournament" text,
"surface" text,
"partnering" text,
"opponent in the final" text,
"score in the final" text
) | how many surfaces are grass ? | SELECT COUNT("surface") FROM table_204_94 WHERE "surface" = 'grass' |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | until 2 years ago what were the top three most frequent procedures that patients received in the same hospital visit after the diagnosis of traumatic subdural hem? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose admission location is clinic referral/premature and diagnoses icd9 code is 25541? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541" |
CREATE TABLE table_name_39 (
margin_of_victory VARCHAR,
tournament VARCHAR
) | What is the margin of victory in a semgroup championship? | SELECT margin_of_victory FROM table_name_39 WHERE tournament = "semgroup championship" |
CREATE TABLE table_name_21 (
team VARCHAR,
year_entered_league VARCHAR,
location VARCHAR
) | Which team had a year entering the league under 2009, located in Bath? | SELECT team FROM table_name_21 WHERE year_entered_league < 2009 AND location = "bath" |
CREATE TABLE table_name_41 (
player VARCHAR,
school_club_team VARCHAR
) | Which player is from Dartmouth? | SELECT player FROM table_name_41 WHERE school_club_team = "dartmouth" |
CREATE TABLE table_14725 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Where was a game played on 23,24,25,26 july 1992? | SELECT "Venue" FROM table_14725 WHERE "Date" = '23,24,25,26 july 1992' |
CREATE TABLE table_name_38 (
domestic_passengers INTEGER,
_percentage_change_2005_2006 VARCHAR,
freight__metric_tonnes_ VARCHAR
) | What is the sum of all domestic passengers with 10.9% change and less than 4,022 tonnes in freight? | SELECT SUM(domestic_passengers) FROM table_name_38 WHERE _percentage_change_2005_2006 = "10.9%" AND freight__metric_tonnes_ < 4 OFFSET 022 |
CREATE TABLE table_66025 (
"Rank" real,
"Archer" text,
"1st Half" real,
"2nd Half" real,
"Score" real
) | What is the lowest first half when the score is larger than 621 and the rank 35? | SELECT MIN("1st Half") FROM table_66025 WHERE "Score" > '621' AND "Rank" = '35' |
CREATE TABLE table_17476 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | Who's the writer of the episode see by 12.13 million US viewers? | SELECT "Written by" FROM table_17476 WHERE "U.S. viewers (millions)" = '12.13' |
CREATE TABLE table_53649 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did Fitzroy play as the away team? | SELECT "Date" FROM table_53649 WHERE "Away team" = 'fitzroy' |
CREATE TABLE table_name_63 (
music VARCHAR,
uncut_run_time VARCHAR
) | What music is in the film with an Uncut run time of 95 minutes? | SELECT music FROM table_name_63 WHERE uncut_run_time = "95 minutes" |
CREATE TABLE table_53566 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the opponent when Footscray played as the home team? | SELECT "Away team score" FROM table_53566 WHERE "Home team" = 'footscray' |
CREATE TABLE table_name_96 (
loss VARCHAR,
record VARCHAR
) | What was the loss of the Mariners game when they had a record of 22-35? | SELECT loss FROM table_name_96 WHERE record = "22-35" |
CREATE TABLE table_name_42 (
team_name VARCHAR,
school VARCHAR
) | What is the team name from Hammond Bishop Noll? | SELECT team_name FROM table_name_42 WHERE school = "hammond bishop noll" |
CREATE TABLE table_39564 (
"Role" text,
"D'Oyly Carte 1920 Tour" text,
"D'Oyly Carte 1930 Tour" text,
"D'Oyly Carte 1939 Tour" text,
"D'Oyly Carte 1945 Tour" text,
"D'Oyly Carte 1950 Tour" text
) | D'Oyly Carte 1920 Tour of james turnbull is what D'Oyly Carte 1945 Tour? | SELECT "D'Oyly Carte 1945 Tour" FROM table_39564 WHERE "D'Oyly Carte 1920 Tour" = 'james turnbull' |
CREATE TABLE table_36605 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How much Bronze has a Gold larger than 0, and a Total smaller than 1? | SELECT COUNT("Bronze") FROM table_36605 WHERE "Gold" > '0' AND "Total" < '1' |
CREATE TABLE table_73023 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Time Frame" text,
"Starring Actors" text,
"Theme Song(s)" text,
"Episodes" real,
"Average Ratings" text
) | What is the Japanese title with an average rating of 11.6%? | SELECT "Japanese Title" FROM table_73023 WHERE "Average Ratings" = '11.6%' |
CREATE TABLE table_203_489 (
id number,
"year" number,
"title" text,
"system" text,
"developer" text,
"publisher" text
) | what is the total amount of games activision developed ? | SELECT COUNT("title") FROM table_203_489 WHERE "developer" = 'activision' |
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Ref_Cha... | A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and list names in ascending order. | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description |
CREATE TABLE table_45663 (
"Rank" real,
"Title" text,
"Studio" text,
"Director(s)" text,
"Worldwide Gross" text
) | What rank has skyfall as the title? | SELECT "Rank" FROM table_45663 WHERE "Title" = 'skyfall' |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | Show the number of companies in each headquarter with a bar chart, show y-axis from low to high order please. | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters) |
CREATE TABLE table_45625 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is the Score of the game against Philadelphia 76ers? | SELECT "Score" FROM table_45625 WHERE "Opponent" = 'philadelphia 76ers' |
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 total number of patients who had their calcium urine tested by lab and remained admitted in hospital for more than 15 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Calcium, Urine" |
CREATE TABLE table_name_63 (
power__kw_ VARCHAR,
coverage VARCHAR
) | What is the power in kW corresponding to the station that covers General Santos? | SELECT power__kw_ FROM table_name_63 WHERE coverage = "general santos" |
CREATE TABLE table_34682 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many Field goals have Touchdowns smaller than 3, and a Player of willis ward, and an Extra points smaller than 0? | SELECT SUM("Field goals") FROM table_34682 WHERE "Touchdowns" < '3' AND "Player" = 'willis ward' AND "Extra points" < '0' |
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperda... | How many times was alex snoeren cited ? | SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'alex snoeren' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, what is the relationship between price and code , and group by attribute founder? | SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder |
CREATE TABLE table_train_55 (
"id" int,
"ejection_fraction_ef" int,
"systolic_dysfunction" bool,
"language" string,
"valvular_dysfunction" bool,
"consent" bool,
"heart_disease" bool,
"left_bundle_branch_block" bool,
"trauma" bool,
"pericardial_disease" bool,
"complete_fluid_c... | patients unable to provide consent such as non english speaking patients or patient / health care proxy unable to give consent | SELECT * FROM table_train_55 WHERE consent = 0 OR language <> 'english' |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | which flights go from PHILADELPHIA to SAN FRANCISCO | 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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | give me the number of patients whose admission type is emergency and item id is 51256? | 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.itemid = "51256" |
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... | how many patients born before the year 2080 had drug code posa2001? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2080" AND prescriptions.formulary_drug_cd = "POSA200L" |
CREATE TABLE table_74640 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the venue where Fitzroy played as the home team? | SELECT "Venue" FROM table_74640 WHERE "Home team" = 'fitzroy' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | how many times has patient 005-9883 got an enteral tube intake: nasoduodenal nostril, r until 03/13/2101? | 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 = '005-9883')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel... |
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 procedures (
... | what is the number of emergency hospital admission patients who had aortography? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Aortography" |
CREATE TABLE table_54891 (
"Year" real,
"Place" text,
"Event" text,
"Performance" text,
"Age (years)" real
) | What is the year when the performance is 60.73m and the age (years) is more than 45? | SELECT COUNT("Year") FROM table_54891 WHERE "Performance" = '60.73m' AND "Age (years)" > '45' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | did patient 025-27850 ever have oxygen therapy (40% to 60%) - face mask during this year? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-27850')) AND treatment.treatmentname = 'oxygen therapy (40% to 60%) - fa... |
CREATE TABLE table_64701 (
"Player" text,
"Matches" text,
"Runs" text,
"Balls" text,
"Strike Rate" text,
"Average" text,
"100s" text
) | With 10 as matches, and 469 runs, what is the strike rate? | SELECT "Strike Rate" FROM table_64701 WHERE "Matches" = '10' AND "Runs" = '469' |
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 ... | what is patient 64983's maximum po2 value in 10/this year? | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64983) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT... |
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... | when was the last time that patient 003-33922 had a maximum systemicsystolic. | 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 = '003-33922')) AND NOT vitalperiodic.systemicsystolic... |
CREATE TABLE table_10811 (
"Round" text,
"Opponent" text,
"Date" text,
"Venue" text,
"Competition" text
) | what round saw wakefield trinity wildcats u21 as the opponenet at belle vue? | SELECT "Round" FROM table_10811 WHERE "Opponent" = 'wakefield trinity wildcats u21' AND "Venue" = 'belle vue' |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE pape... | How many papers have Dan Suciu and Magdalena Balazinska ? | SELECT DISTINCT COUNT(1) FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Dan Suciu' AND AUTHOR_1.authorname = 'Magdalena Balazinska' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperi... |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | find duplicates that have their targets as duplicates. | SELECT MONTH(CURRENT_TIMESTAMP()) |
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 use the drug code phos250? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "PHOS250" |
CREATE TABLE music_festival (
RESULT VARCHAR
) | What is the most common result of the music festival? | SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Pie chart, group and count the decor of rooms that have a king bed. | SELECT decor, COUNT(decor) FROM Rooms WHERE bedType = 'King' GROUP BY decor |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code ... | nonstop flights from SEATTLE to DENVER | 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 (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE... |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | Calculate the number of actors in each duration of actors using a bar chart. | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration |
CREATE TABLE table_name_9 (
laps INTEGER,
qual VARCHAR
) | How many laps did Duke Nelson complete when his qualifying time was 136.498? | SELECT MAX(laps) FROM table_name_9 WHERE qual = "136.498" |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | the last time the previous month, when was patient 19175 prescribed d5w and pantoprazole at the same time? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'd5w' AND admissions.subject_id = 19175 AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of... |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | tell me the price for bilirubin, total, pleural? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total, pleural')) |
CREATE TABLE table_20010140_10 (
location_attendance VARCHAR,
record VARCHAR
) | state the number of location attendance where record is 15 10 (5 7) | SELECT COUNT(location_attendance) FROM table_20010140_10 WHERE record = "15–10 (5–7)" |
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 ... | what procedure was last taken to patient 25796 on their first hospital visit? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25796 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit... |
CREATE TABLE table_name_75 (
publication VARCHAR,
country VARCHAR
) | Which publication happened in the UK? | SELECT publication FROM table_name_75 WHERE country = "uk" |
CREATE TABLE table_name_55 (
played INTEGER,
team VARCHAR,
losses VARCHAR
) | Which Played has a Team of cerro cor , and Losses larger than 4? | SELECT AVG(played) FROM table_name_55 WHERE team = "cerro corá" AND losses > 4 |
CREATE TABLE table_17507 (
"Overall Pick #" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which college did Dennis Byrd come from? | SELECT "College" FROM table_17507 WHERE "Player" = 'Dennis Byrd' |
CREATE TABLE table_3377 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | What is the PA when skip (club) is mary-anne arsenault (nsca)? | SELECT MIN("PA") FROM table_3377 WHERE "Skip (Club)" = 'Mary-Anne Arsenault (NSCA)' |
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 is the size of the 445 class ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 445 |
CREATE TABLE table_name_63 (
nationality___opponent VARCHAR,
competition VARCHAR,
result VARCHAR
) | Name the Nationality / Opponent of the Competition of welsh rugby union challenge trophy and a Result of 38-29? | SELECT nationality___opponent FROM table_name_63 WHERE competition = "welsh rugby union challenge trophy" AND result = "38-29" |
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,
... | When will Developmental Disturbances of Childhood be offered next ? | SELECT DISTINCT semester.semester, semester.year FROM semester INNER JOIN course_offering ON semester.semester_id = course_offering.semester INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name LIKE '%Developmental Disturbances of Childhood%' AND semester.semester_id > (SELECT SEMESTERali... |
CREATE TABLE table_78732 (
"Date" text,
"Airline" text,
"Aircraft type" text,
"Registration" text,
"People on board" real,
"Fatalities" real
) | How many fatalities shows for the lockheed l-1049g? | SELECT SUM("Fatalities") FROM table_78732 WHERE "Aircraft type" = 'lockheed l-1049g' |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | 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 sum of manager_id bin hire_date by weekday, display by the y axis in asc. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) |
CREATE TABLE table_name_30 (
region VARCHAR,
venue VARCHAR
) | What region is William R. Johnson Coliseum in? | SELECT region FROM table_name_30 WHERE venue = "william r. johnson coliseum" |
CREATE TABLE table_44851 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the highest pick of scott turner, who has a round greater than 2? | SELECT MAX("Pick") FROM table_44851 WHERE "Round" > '2' AND "Name" = 'scott turner' |
CREATE TABLE table_38725 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | Who did Yugoslavia play against that led to a result of 2:3? | SELECT "Opponent" FROM table_38725 WHERE "Results\u00b9" = '2:3' |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, show me about the distribution of name and manufacturer , and group by attribute founder in a bar chart, and sort X-axis from high to low order please. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC |
CREATE TABLE table_name_85 (
theme VARCHAR,
original_artist VARCHAR,
week__number VARCHAR
) | What is the Theme when the Original artist was carole king, and a Week # shows hollywood? | SELECT theme FROM table_name_85 WHERE original_artist = "carole king" AND week__number = "hollywood" |
CREATE TABLE table_25703_1 (
death_2012 VARCHAR,
death_2013 VARCHAR,
january_september_2013 VARCHAR
) | What are the death/2012 number when death/2013 is 140 and January September 2013 is Moscow Oblast? | SELECT death_2012 FROM table_25703_1 WHERE death_2013 = 140 AND january_september_2013 = "Moscow Oblast" |
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 restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturd... | what are the flights from BOSTON to WASHINGTON | 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 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.city_name = 'WASHING... |
CREATE TABLE table_name_62 (
city VARCHAR,
home_arena VARCHAR
) | Which city includes the Target Center arena? | SELECT city FROM table_name_62 WHERE home_arena = "target center" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.