table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_53594 (
"Date" text,
"Tournament" text,
"Round" text,
"Ground" text,
"Opponent" text,
"Score 1" text
) | Which date's opponent was Dender when the tournament was in the Jupiler League and the ground was a? | SELECT "Date" FROM table_53594 WHERE "Opponent" = 'dender' AND "Tournament" = 'jupiler league' AND "Ground" = 'a' |
CREATE TABLE table_38000 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What position did the team finish in with a Difference of - 6, 3 losses, and over 4 draws? | SELECT COUNT("Position") FROM table_38000 WHERE "Difference" = '- 6' AND "Lost" = '3' AND "Drawn" > '4' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | how many times patient 002-4486 has taken per iv flush: forearm r 18 gauge in the previous day? | 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-4486')) 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients are admitted before the year 2158 and followed the procedure inject ca chemother nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Inject ca chemother NEC" |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid... | in 2105, what are the top four most frequent drugs prescribed to patients in the same month after the prescription of desipramine hcl? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'desipramine hcl' AND STRFTIME('%y', prescriptions.startdate) = '2... |
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,
... | give me the number of patients whose age is less than 50 and diagnoses long title is coronary atherosclerosis of native coronary artery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | what was the daily minimum amount of colostomy given to patient 006-80884 during this hospital visit? | 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 = '006-80884' AND patient.hospitaldischargetime IS ... |
CREATE TABLE table_203_89 (
id number,
"#" number,
"name\n(birth-death)" text,
"took office" text,
"left office" text,
"monarch" text,
"prime minister" text
) | how many governors did the union of south africa go through during the reign of george v ? | SELECT COUNT("name\n(birth-death)") FROM table_203_89 WHERE "monarch" = 'george v' |
CREATE TABLE table_74328 (
"Team" text,
"Stadium" text,
"Home Games" real,
"Average Attendance" real,
"Total Attendance" real,
"Capacity Percentage" text
) | What is the name of the team when the stadium is listed as Edward Jones Dome? | SELECT "Team" FROM table_74328 WHERE "Stadium" = 'Edward Jones Dome' |
CREATE TABLE table_name_91 (
winning_score VARCHAR,
runner_s__up VARCHAR
) | What is the winning score of the tournament with Charles Coody as the runner-up? | SELECT winning_score FROM table_name_91 WHERE runner_s__up = "charles coody" |
CREATE TABLE table_name_62 (
skip VARCHAR,
third VARCHAR
) | WHAT IS THE SKIP WITH A THIRD OF DEANNA DOIG? | SELECT skip FROM table_name_62 WHERE third = "deanna doig" |
CREATE TABLE table_47951 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
) | What is Label, when Date is 1987? | SELECT "Label" FROM table_47951 WHERE "Date" = '1987' |
CREATE TABLE table_57107 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | What constellation has a Declination ( J2000 ) of 32 39 ? | SELECT "Constellation" FROM table_57107 WHERE "Declination ( J2000 )" = '°32′39″' |
CREATE TABLE entrepreneur (
Investor VARCHAR
) | What are the investors that have invested in at least two entrepreneurs? | SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2 |
CREATE TABLE table_19131921_1 (
branding VARCHAR,
format VARCHAR
) | Which branding has the format of southern country? | SELECT branding FROM table_19131921_1 WHERE format = "Southern Country" |
CREATE TABLE table_25294 (
"Station" text,
"Extension" text,
"City/Neighborhood" text,
"Projected opening" real,
"Transit Connections" text,
"Park and ride?" text
) | Name the least projected opening | SELECT MIN("Projected opening") FROM table_25294 |
CREATE TABLE table_1708050_1 (
poles VARCHAR,
position VARCHAR
) | Name the poles for 25th position | SELECT poles FROM table_1708050_1 WHERE position = "25th" |
CREATE TABLE table_58510 (
"Round" text,
"Date" text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Crowd" real,
"Stadium" text,
"Match Details" text
) | What was the score of the match that took place in the playoff round? | SELECT "Score" FROM table_58510 WHERE "Round" = 'playoff' |
CREATE TABLE table_6194 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 1st leg of cs sfaxien? | SELECT "1st leg" FROM table_6194 WHERE "Team 2" = 'cs sfaxien' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | has patient 26777 had any surgery since 6 years ago? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26777) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') |
CREATE TABLE table_713 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the result for barney frank? | SELECT "Result" FROM table_713 WHERE "Incumbent" = 'Barney Frank' |
CREATE TABLE table_23014476_1 (
gore__number VARCHAR,
others__percentage VARCHAR
) | Name the gore number for others % being 5.3% | SELECT gore__number FROM table_23014476_1 WHERE others__percentage = "5.3%" |
CREATE TABLE table_43425 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which nations have more than 1 gold medal and 4 silver medals? | SELECT "Nation" FROM table_43425 WHERE "Gold" > '1' AND "Silver" = '4' |
CREATE TABLE table_55909 (
"Year" text,
"Language" text,
"Title" text,
"Translator" text,
"Company" text,
"Pages" real
) | What is the language for translators ritah meltser and amatsyah porat? | SELECT "Language" FROM table_55909 WHERE "Translator" = 'ritah meltser and amatsyah porat' |
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 primary disease is angioedema and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ANGIOEDEMA" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE table_75332 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
) | How many events are in South Africa? | SELECT SUM("Events") FROM table_75332 WHERE "Country" = 'south africa' |
CREATE TABLE table_name_17 (
constellation VARCHAR,
object_type VARCHAR,
ngc_number VARCHAR
) | What Constellation has a Object type of globular cluster and a NGC number of 5986? | SELECT constellation FROM table_name_17 WHERE object_type = "globular cluster" AND ngc_number = 5986 |
CREATE TABLE table_name_77 (
entrant VARCHAR,
laps VARCHAR
) | Can you tell me the Entrant that has the Laps of 17? | SELECT entrant FROM table_name_77 WHERE laps = 17 |
CREATE TABLE table_203_549 (
id number,
"player" text,
"team" text,
"date" text,
"opponent" text,
"venue" text
) | which teams faced off at miller park ? | SELECT "team" FROM table_203_549 WHERE "venue" = 'miller park' UNION SELECT "opponent" FROM table_203_549 WHERE "venue" = 'miller park' |
CREATE TABLE table_18798 (
"Player" text,
"Played" real,
"Sets Won" real,
"Sets Lost" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" text
) | what's the sets won with 140+ being 16 | SELECT "Sets Won" FROM table_18798 WHERE "140+" = '16' |
CREATE TABLE table_name_64 (
total INTEGER,
finish VARCHAR,
year_won VARCHAR
) | Which Total has a Finish of t64, and a Year won larger than 2006? | SELECT MAX(total) FROM table_name_64 WHERE finish = "t64" AND year_won > 2006 |
CREATE TABLE table_203_519 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | what is the total point difference between the driver who received the most points and the driver who received the least ? | SELECT MAX("points") - MIN("points") FROM table_203_519 |
CREATE TABLE table_58787 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Raiders points" real,
"Opponents" real,
"Raiders first downs" real,
"Record" text,
"Attendance" real
) | What is the lowest Opponents, when Raiders Poinsts is greater than 38, and when Attendance is greater than 51,267? | SELECT MIN("Opponents") FROM table_58787 WHERE "Raiders points" > '38' AND "Attendance" > '51,267' |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
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... | What upper level classes can I take to avoid exams and only do projects ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS' |
CREATE TABLE table_46850 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What is the played number with points 1 is 80, and goals for is more than 77? | SELECT COUNT("Played") FROM table_46850 WHERE "Points 1" = '80' AND "Goals For" > '77' |
CREATE TABLE table_43950 (
"Locale" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" text
) | In italy, when the stolen ends were 10 and blank ends were under 14, what's the lowest ends won? | SELECT MIN("Ends Won") FROM table_43950 WHERE "Stolen Ends" = '10' AND "Locale" = 'italy' AND "Blank Ends" < '14' |
CREATE TABLE table_65408 (
"Date" text,
"Internet Explorer" text,
"Chrome" text,
"Firefox" text,
"Safari" text
) | What was the percentage of safari when internet explorer was 20.27%? | SELECT "Safari" FROM table_65408 WHERE "Internet Explorer" = '20.27%' |
CREATE TABLE table_2503102_2 (
chassis VARCHAR,
team VARCHAR
) | What chassis is on the car repped by team rahal letterman lanigan racing? | SELECT chassis FROM table_2503102_2 WHERE team = "Rahal Letterman Lanigan Racing" |
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
color_code VARCHAR(15),
product_category_code VARCHAR(15),
product_name VARCHAR(80),
typical_buying_price VARCHAR(20),
typical_selling_price VARCHAR(20),
pro... | What are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, I want to display by the names in descending please. | 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 DESC |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | in 11/last year, when did patient 030-64961 get a first lab test? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-64961')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TI... |
CREATE TABLE table_dev_2 (
"id" int,
"nutrient_absorption" bool,
"systolic_blood_pressure_sbp" int,
"active_metabolic" bool,
"hepatic_disease" bool,
"surgery" bool,
"diastolic_blood_pressure_dbp" int,
"gastrointestinal_disease" bool,
"organ_failure" bool,
"NOUSE" float
) | subject states that he / she has end stage organ failure | SELECT * FROM table_dev_2 WHERE organ_failure = 1 |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | Compute the number of each type of job ids for employees who make more than the highest-earning employee with title PU_MAN, with a bar chart, sort in descending by the names. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY > (SELECT MAX(SALARY) FROM employees WHERE JOB_ID = 'PU_MAN') GROUP BY JOB_ID ORDER BY JOB_ID DESC |
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 age is less than 47 and days of hospital stay is greater than 6? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "47" AND demographic.days_stay > "6" |
CREATE TABLE table_39338 (
"Rank" real,
"Country/Territory" text,
"Miss World" real,
"1st Runner-up" real,
"2nd Runner-up" real,
"3rd Runner-up" real,
"4th Runner-up" real,
"5th Runner-up" real,
"6th Runner-up" real,
"Semifinalists" real,
"Total" real
) | 3rd Runner-up of 2, and a Country/Territory of venezuela has what sum of 4th runner-up? | SELECT SUM("4th Runner-up") FROM table_39338 WHERE "3rd Runner-up" = '2' AND "Country/Territory" = 'venezuela' |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),... | Return a scatter chart on how many distinct order ids correspond to each product? | SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is the number of patients whose year of birth is less than 2104 and drug route is td? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.route = "TD" |
CREATE TABLE table_45041 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College/junior/club team" text
) | What was the lowest pick number for a united states player picked before round 7? | SELECT MIN("Pick") FROM table_45041 WHERE "Round" > '7' AND "Nationality" = 'united states' |
CREATE TABLE table_name_64 (
gold INTEGER,
total VARCHAR,
silver VARCHAR,
bronze VARCHAR,
type VARCHAR
) | What is the average gold of the winter athlete with 1 bronze, less than 3 silver, and less than 4 total medals? | SELECT AVG(gold) FROM table_name_64 WHERE bronze = 1 AND type = "winter" AND silver < 3 AND total < 4 |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Descrip... | Show the number of documents in different ending date and group by ending date with a line chart, and display in desc by the X. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To ORDER BY Date_in_Locaton_To DESC |
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 procedure long title is (aorto)coronary bypass of two coronary arteries and lab test fluid is urine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "(Aorto)coronary bypass of two coronary arteries" AND lab.fluid = "Urine" |
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)... | Find all users who have written tips for ' Barrio Cafe ' in 2015 | SELECT user.name FROM business, tip, user WHERE business.name = 'Barrio Cafe' AND tip.business_id = business.business_id AND tip.year = 2015 AND user.user_id = tip.user_id |
CREATE TABLE table_name_27 (
teams VARCHAR,
home VARCHAR,
season VARCHAR
) | What teams has a home of 1-0, in the season 1988-89? | SELECT teams FROM table_name_27 WHERE home = "1-0" AND season = "1988-89" |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_pla... | What is the total number of all football games played by scholarship students? | SELECT SUM(gamesplayed) FROM sportsinfo WHERE sportname = "Football" AND onscholarship = 'Y' |
CREATE TABLE table_name_26 (
total INTEGER,
player VARCHAR
) | What is the average total for Tiger Woods? | SELECT AVG(total) FROM table_name_26 WHERE player = "tiger woods" |
CREATE TABLE table_40255 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
) | Which artist has a Spoofed title in June 1992? | SELECT "Artist" FROM table_40255 WHERE "Date" = 'june 1992' |
CREATE TABLE table_name_34 (
title VARCHAR,
type VARCHAR,
year VARCHAR
) | Which Title has a Type of album in 1983? | SELECT title FROM table_name_34 WHERE type = "album" AND year = 1983 |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | All tags of questions with tag in year and month. | SELECT PostTags.PostId, Tags.TagName, PostTags.TagId FROM PostTags INNER JOIN Posts ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE PostTags.PostId IN (SELECT Posts.Id FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE YEAR(Post... |
CREATE TABLE table_77143 (
"Rank" real,
"Mountain Peak" text,
"Region" text,
"Mountain Range" text,
"Location" text
) | Which Mountain Range has a Region of haiti, and a Location of 18.3601 n 71.9764 w? | SELECT "Mountain Range" FROM table_77143 WHERE "Region" = 'haiti' AND "Location" = '18.3601°n 71.9764°w' |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate ti... | what is the average amount of hospital cost which includes a ck-mb index testing lab test during this year? | SELECT AVG(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 = 'ck-mb index')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... |
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, draw a bar chart about the distribution of founder and the average of manufacturer , and group by attribute founder, and could you sort by the X in desc? | SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
CREATE TABLE table_name_8 (
stadium VARCHAR,
past_season VARCHAR
) | what stadium has a prior record of 7th? | SELECT stadium FROM table_name_8 WHERE past_season = "7th" |
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE nurse (
employeeid number,
name text,
position text,
registered boolean,
ssn number
)
CREATE TABLE block (
blockfloor number,
blockcode number
)
C... | What are names of patients who made an appointment? | SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn |
CREATE TABLE table_name_34 (
gold INTEGER,
silver VARCHAR,
nation VARCHAR,
bronze VARCHAR,
total VARCHAR
) | How many golds have a Bronze of 0, a Total larger than 1, a Nation of chad, and a Silver larger than 0? | SELECT SUM(gold) FROM table_name_34 WHERE bronze = 0 AND total > 1 AND nation = "chad" AND silver > 0 |
CREATE TABLE table_16999 (
"Season" real,
"Position" real,
"Win/Loss" text,
"Coach" text,
"Captain" text,
"Dudley Tuckey Medal" text,
"Leading goalkicker" text
) | who is the dudley tuckey medal where leading goalkicker is scott simister (46) | SELECT "Dudley Tuckey Medal" FROM table_16999 WHERE "Leading goalkicker" = 'Scott Simister (46)' |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | Visualize a bar chart for what are the average ages for male and female students? | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex |
CREATE TABLE table_52634 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
) | What is catcher Josh Donaldson's pick number? | SELECT "Pick" FROM table_52634 WHERE "Position" = 'catcher' AND "Player" = 'josh donaldson' |
CREATE TABLE table_name_61 (
team VARCHAR,
year VARCHAR,
chassis VARCHAR
) | What team has jordan 193 chassis after 1990? | SELECT team FROM table_name_61 WHERE year > 1990 AND chassis = "jordan 193" |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | When does the next 872 taught by Sara Holliday happen ? | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 872 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Sara Holliday%' AND offering_instructor.instr... |
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 intakeoutput (
in... | did patient 022-6959 ever excrete any urine during this month? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-6959')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput... |
CREATE TABLE table_8846 (
"Year" real,
"Ship" text,
"Departed From" text,
"Departed On" text,
"Returned On" text
) | From how many years did tampa, FL depart? | SELECT SUM("Year") FROM table_8846 WHERE "Departed From" = 'tampa, fl' |
CREATE TABLE table_30108930_6 (
cfl_team VARCHAR,
pick__number VARCHAR
) | Which CFL team got pick 34? | SELECT cfl_team FROM table_30108930_6 WHERE pick__number = 34 |
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 treatment (
treat... | retrieve patient ids of individuals who have been diagnosed with cardiac arrest until 4 years ago. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'cardiac arrest' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year')) |
CREATE TABLE table_36247 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
) | Which district had a first elected in 1882 with a result of re-elected? | SELECT "District" FROM table_36247 WHERE "First elected" = '1882' AND "Result" = 're-elected' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients are with single marital status and diagnosed with other preterm infants, 2500 grams and over? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Other preterm infants, 2,500 grams and over" |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilege... | Posts and Views by Date Range and Display Name. | SELECT PostType = pt.Name, Posts = COUNT(*), Views = SUM(COALESCE(p.ViewCount, parent.ViewCount)), Start = TIME_TO_STR(@startDate, '%B'), Finish = TIME_TO_STR(@endDate, '%B') FROM Posts AS p LEFT JOIN Posts AS parent ON p.ParentId = parent.Id JOIN Users AS u ON p.OwnerUserId = u.Id JOIN PostTypes AS pt ON p.PostTypeId ... |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restr... | i'm looking for a flight leaving DENVER traveling to ATLANTA and stopping at PITTSBURGH is this possible | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.ci... |
CREATE TABLE table_50156 (
"Season" text,
"Player" text,
"School" text,
"Position" text,
"Class" text
) | What is Position, when Player is 'Kevin Durant category:articles with hCards'? | SELECT "Position" FROM table_50156 WHERE "Player" = 'kevin durant category:articles with hcards' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | when was the last hospital visit since 2 years ago that patient 035-4428 was admitted via floor? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '035-4428' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE table_name_99 (
capacity___mw__ INTEGER,
rank VARCHAR,
province VARCHAR
) | what is the least capacity (mw) when the rank is less than 46 and the province is newfoundland and labrador? | SELECT MIN(capacity___mw__) FROM table_name_99 WHERE rank < 46 AND province = "newfoundland and labrador" |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
d... | Draw a bar chart for what is the name of every city that has at least 15 stations and how many stations does it have? | SELECT city, COUNT(*) FROM station GROUP BY city |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname 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,
good_feedback int,
... | This year will there be a colloquium on Advanced Personality Psychology ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%colloquium%' OR course.name LIKE '%colloquium%') AND (course.description LIKE '%Advanced Personality Psychology%' OR course.name LIKE '%Advanced Personality Psychology%') AND course.course_id = course_offering.course_id AND seme... |
CREATE TABLE table_79915 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height feet / m" text,
"Floors" real
) | How many floors does the Blue Diamond have? | SELECT SUM("Floors") FROM table_79915 WHERE "Name" = 'blue diamond' |
CREATE TABLE table_203_576 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many total medals were given out ? | SELECT SUM("total") FROM table_203_576 |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | how many patients were prescribed with magnesium sulfate within the same month after the treatment of cont inv mec ven <96 hrs? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv me... |
CREATE TABLE table_32896 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | What city is located in Oklahoma? | SELECT "City" FROM table_32896 WHERE "State" = 'oklahoma' |
CREATE TABLE table_72144 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which player from the 2004 CFL draft attended Wilfrid Laurier? | SELECT "Player" FROM table_72144 WHERE "College" = 'Wilfrid Laurier' |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | Show different teams in eliminations and the number of eliminations from each team by a bar chart, sort by the X from high to low. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team DESC |
CREATE TABLE table_8834 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Place, when Player is 'Justin Leonard'? | SELECT "Place" FROM table_8834 WHERE "Player" = 'justin leonard' |
CREATE TABLE table_33192 (
"Team" text,
"Game" real,
"Draw" real,
"Loss" real,
"Goal Gain" real,
"Goal Loss" real,
"Goal Diff" real,
"Point" real
) | What is the highest loss before game 14? | SELECT MAX("Loss") FROM table_33192 WHERE "Game" < '14' |
CREATE TABLE table_20602 (
"Country" text,
"Donor payment" text,
"Children per donor" text,
"Donor anonymity" text,
"Allowed recipients" text
) | What are the children per donor in the country where the allowed recipients are married or in cohabitation? | SELECT "Children per donor" FROM table_20602 WHERE "Allowed recipients" = 'Married or in cohabitation' |
CREATE TABLE table_24518 (
"Period" real,
"Civilians" text,
"Security forces" text,
"Insurgents" text,
"Total per period" real
) | What are the civilian total when the security force total is 36? | SELECT "Civilians" FROM table_24518 WHERE "Security forces" = '36' |
CREATE TABLE table_name_88 (
time VARCHAR,
nationality VARCHAR,
heat VARCHAR,
lane VARCHAR
) | What is the time in a heat smaller than 5, in Lane 5, for Vietnam? | SELECT time FROM table_name_88 WHERE heat < 5 AND lane = 5 AND nationality = "vietnam" |
CREATE TABLE table_name_54 (
category VARCHAR,
for_the_show VARCHAR,
year VARCHAR
) | For 2006 what category has the Show of kasautii zindagii kay? | SELECT category FROM table_name_54 WHERE for_the_show = "kasautii zindagii kay" AND year = 2006 |
CREATE TABLE table_54248 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | How many years does simon baker appear as a nominee? | SELECT COUNT("Year") FROM table_54248 WHERE "Nominee" = 'simon baker' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | patient 002-75209 had any #1:? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-75209')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu... |
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE tv_seri... | What is the number of actors in the movie ' Grumpier Old Men ' ? | SELECT COUNT(DISTINCT (actor.name)) FROM actor, cast, movie WHERE cast.aid = actor.aid AND movie.mid = cast.msid AND movie.title = 'Grumpier Old Men' |
CREATE TABLE table_name_77 (
record VARCHAR,
score VARCHAR
) | What was the record at the game with a score of 21-16? | SELECT record FROM table_name_77 WHERE score = "21-16" |
CREATE TABLE table_name_15 (
proto_germanic_origin VARCHAR,
sound__allophone_ VARCHAR
) | What is the Proto-Germanic origin associated with an allophone of [[[|k]]]? | SELECT proto_germanic_origin FROM table_name_15 WHERE sound__allophone_ = "[[[|k]]]" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
... | what were the five most frequently prescribed drugs that patients were prescribed during the same hospital visit after having been diagnosed with ac posthemorrhag anemia until 2104? | SELECT t3.drug FROM (SELECT t2.drug, 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_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
CREATE TABLE enzyme (
name VARCHAR,
LOCATION VARCHAR
) | List the names and the locations that the enzymes can make an effect. | SELECT name, LOCATION FROM enzyme |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.