table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_13456202_1 (
founded INTEGER,
school VARCHAR
) | WHat year was north college hill high school founded? | SELECT MAX(founded) FROM table_13456202_1 WHERE school = "North College Hill High school" |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zo... | what are the flights from PHOENIX ARIZONA to ST. PAUL MINNESOTA on tuesday | 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, date_day, days, flight, state AS STATE_0, state AS STATE_1 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND date_day.day_number = 2... |
CREATE TABLE table_name_33 (
name VARCHAR,
games VARCHAR
) | Who won a medal at the 2008 Beijing Olympics? | SELECT name FROM table_name_33 WHERE games = "2008 beijing" |
CREATE TABLE table_204_22 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number,
"record" text
) | how many of the games were the illini ranked ? | SELECT COUNT(*) FROM table_204_22 WHERE NOT "rank#" IS NULL |
CREATE TABLE table_26397 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | List the title for the season episode number of 8. | SELECT "Title" FROM table_26397 WHERE "Season #" = '8' |
CREATE TABLE table_61891 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | Who is the cyber girl in week 3 when Demi Jessica was the cyber girl in week 1? | SELECT "Week 3" FROM table_61891 WHERE "Week 1" = 'demi jessica' |
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... | provide the number of patients younger than 20 years who have stemi primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STEMI" AND demographic.age < "20" |
CREATE TABLE table_name_21 (
pop__2010_ INTEGER,
latitude VARCHAR,
land___sqmi__ VARCHAR,
ansi_code VARCHAR,
longitude VARCHAR
) | Which Pop (2010) has an ANSI code smaller than 1036864, and a Longitude larger than -98.46611, and a Land (sqmi) smaller than 36.238, and a Latitude smaller than 48.144102? | SELECT AVG(pop__2010_) FROM table_name_21 WHERE ansi_code < 1036864 AND longitude > -98.46611 AND land___sqmi__ < 36.238 AND latitude < 48.144102 |
CREATE TABLE table_name_73 (
money___$__ VARCHAR,
player VARCHAR
) | How much did Larry Nelson win? | SELECT money___$__ FROM table_name_73 WHERE player = "larry nelson" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | when was the last time patient 004-44470 was measured for a temperature that was greater than 37.139? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-44470')) AND vitalperiodic.temperature > 37.139... |
CREATE TABLE table_name_53 (
evening_gown INTEGER,
average VARCHAR,
swimsuit VARCHAR
) | Tell me the sum of evening gown for average of 9.06 and swimsuit less than 8.76 | SELECT SUM(evening_gown) FROM table_name_53 WHERE average = 9.06 AND swimsuit < 8.76 |
CREATE TABLE table_204_940 (
id number,
"year" number,
"tournaments\nplayed" number,
"cuts\nmade" number,
"wins" number,
"2nd" number,
"3rd" number,
"top 10s" number,
"best\nfinish" text,
"earnings\n(\u20ac)" number,
"money\nlist rank" number,
"scoring\naverage" number,
... | how many professional wins has christel boeljon had ? | SELECT SUM("wins") FROM table_204_940 |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Answered questions - Windows Phone. | SELECT Id, LastActivityDate, CreationDate, Score, ViewCount, Body, OwnerUserId, Title, Tags, AnswerCount FROM Posts WHERE Tags LIKE '%<windows-phone%' AND PostTypeId = 1 ORDER BY LastActivityDate DESC |
CREATE TABLE table_204_922 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which country scored the most gold medals at this event ? | SELECT "nation" FROM table_204_922 ORDER BY "gold" DESC LIMIT 1 |
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... | what is primary disease and procedure icd9 code of subject name brian brock? | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Brian Brock" |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,... | how much did patient 13837 weigh first measured since 166 months ago? | 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 = 13837)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... |
CREATE TABLE table_15765 (
"Shirt No" real,
"Player" text,
"Birth Date" text,
"Weight" real,
"Height" real
) | Birth Date of 8 November 1980, and a Weight smaller than 93 has what sum of a shirt number? | SELECT SUM("Shirt No") FROM table_15765 WHERE "Birth Date" = '8 november 1980' AND "Weight" < '93' |
CREATE TABLE table_19259 (
"AGR Power Station" text,
"Net MWe" real,
"Construction started" real,
"Connected to grid" real,
"Commercial operation" real,
"Accounting closure date" real
) | What year did construction start at Heysham 1 | SELECT "Construction started" FROM table_19259 WHERE "AGR Power Station" = 'Heysham 1' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
ro... | count the number of patients who had undergone 1 int mam-cor art bypass two or more times until 2103. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = '1 int mam-cor art byp... |
CREATE TABLE table_33009 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | What region does the University of California, Los Angeles play in? | SELECT "Region" FROM table_33009 WHERE "State" = 'california' AND "Host" = 'university of california, los angeles' |
CREATE TABLE table_23705843_1 (
original_air_date VARCHAR,
ratings__millions_ VARCHAR
) | What is the original air date if the ratings is 1.92 million? | SELECT original_air_date FROM table_23705843_1 WHERE ratings__millions_ = "1.92" |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | This semester , which courses are offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department |
CREATE TABLE table_27771406_1 (
club VARCHAR,
player VARCHAR
) | What club did Cyril Christiani play for? | SELECT club FROM table_27771406_1 WHERE player = "Cyril Christiani" |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | Draw a bar chart for how many players played each position?, order by the x axis from low to high. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is language of subject id 2560? | SELECT demographic.language FROM demographic WHERE demographic.subject_id = "2560" |
CREATE TABLE table_71812 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Which Host Team has Final Score of 42-23? | SELECT "Host Team" FROM table_71812 WHERE "Final Score" = '42-23' |
CREATE TABLE table_name_88 (
phonetic VARCHAR,
standard_thai VARCHAR
) | What is the phonetic when the standard thai is ? | SELECT phonetic FROM table_name_88 WHERE standard_thai = "ผ่า" |
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Products_in_Events (
Product_in_Event_ID INTEGER,
Event_ID INTEGER,
Pr... | What is the proportion of the different types of codes of products? | SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
... | Year-to-year ratio of single-word-requests questions. | SELECT YEAR(p.CreationDate), SUM(CASE WHEN NOT t.Id IS NULL THEN 1 ELSE 0 END) / CAST(COUNT(p.Id) AS FLOAT) AS "ratio of id requests" FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id LEFT OUTER JOIN Tags AS t ON t.Id = pt.TagId AND t.TagName = 'single-word-requests' WHERE p.PostTypeId = 1 GROUP BY YEAR(p.Creatio... |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate tim... | what were the number of patients discharged from hospital in 2103? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '2103' |
CREATE TABLE table_10975034_5 (
college VARCHAR,
player VARCHAR
) | What college did Craig Zimmer go to? | SELECT college FROM table_10975034_5 WHERE player = "Craig Zimmer" |
CREATE TABLE table_train_31 (
"id" int,
"allergy_to_insulin" bool,
"active_infection" bool,
"periodic_paralysis" bool,
"receiving_continuous_intravenous_inotropic_support" bool,
"age" float,
"NOUSE" float
) | known systemic allergy to insulin; | SELECT * FROM table_train_31 WHERE allergy_to_insulin = 1 |
CREATE TABLE table_67601 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the number of the rank for the name of Chen Yan in a lane less than 2? | SELECT COUNT("Rank") FROM table_67601 WHERE "Name" = 'chen yan' AND "Lane" < '2' |
CREATE TABLE table_name_74 (
service VARCHAR,
network VARCHAR
) | Which service does the network of atn urdu offer? | SELECT service FROM table_name_74 WHERE network = "atn urdu" |
CREATE TABLE table_43371 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Series" text
) | What is the Competition for Season 2002 03, and the Opponent was zenit st. petersburg? | SELECT "Competition" FROM table_43371 WHERE "Season" = '2002–03' AND "Opponent" = 'zenit st. petersburg' |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what is the minimum monthly number of patients who have had lower urinary tract infection - likely bacterial until 2104? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'lower urinary tract infection - likely bacterial' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 |
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 the number of patients whose admission location is emergency room admit and drug code is esmobase. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "ESMOBASE" |
CREATE TABLE table_name_15 (
report VARCHAR,
set_1 VARCHAR
) | What shows for Report hen there is a set 1 of 19 25? | SELECT report FROM table_name_15 WHERE set_1 = "19–25" |
CREATE TABLE table_train_133 (
"id" int,
"vascular" bool,
"interferon_alpha" bool,
"pulmonary_disease" bool,
"mini_mental_state_examination_mmse" int,
"cardiac" bool,
"neuropsychological_testing" bool,
"clinical_dementia_rating_scale" float,
"rituximab" bool,
"hematologic_disease... | be currently taking any of the following medications: systemic ( oral or injectable ) glucocorticoids; interferon _ alpha; anti _ cd20 antibody ( e.g., rituximab ) ; or anti _ ctla _ 4 antibody ( e.g., ipilimumab ) . | SELECT * FROM table_train_133 WHERE glucocorticoids = 1 OR interferon_alpha = 1 OR anti_cd20_antibody = 1 OR rituximab = 1 OR anti_ctla_4_antibody = 1 OR ipilimumab = 1 |
CREATE TABLE table_36216 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Which series episode has a netflix figure of s04e21? | SELECT "Series Ep." FROM table_36216 WHERE "Netflix" = 's04e21' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | in total what was the total amount of tpn d13.0 that patient 30044 had received until 1579 days ago? | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30044)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... |
CREATE TABLE table_name_93 (
pick VARCHAR,
round VARCHAR,
player VARCHAR
) | What was the pick number for the compensation-a round, for player Frank Catalanotto? | SELECT pick FROM table_name_93 WHERE round = "compensation-a" AND player = "frank catalanotto" |
CREATE TABLE table_name_64 (
player_name VARCHAR,
position VARCHAR,
college VARCHAR
) | Who was a linebacker at Tennessee? | SELECT player_name FROM table_name_64 WHERE position = "linebacker" AND college = "tennessee" |
CREATE TABLE table_4302 (
"Year" real,
"GDP at constant prices (THB trillions)" text,
"GDP at constant prices growth rate (percent change)" text,
"GDP at current prices (USD billions)" text,
"Export volume of goods and services (percent change)" text,
"Current account balance (percent of GDP)" t... | What is the current account balance for an export volume of goods and service value of -4.2? | SELECT "Current account balance (percent of GDP)" FROM table_4302 WHERE "Export volume of goods and services (percent change)" = '-4.2' |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | in this hospital encounter, had patient 83182 been diagnosed with any disease? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) |
CREATE TABLE table_59151 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL team" text,
"College/Junior/Club Team (League)" text
) | WHAT IS THE NHL TEAM OF FINLAND? | SELECT "NHL team" FROM table_59151 WHERE "Nationality" = 'finland' |
CREATE TABLE table_1354805_6 (
couple VARCHAR,
number_of_dances VARCHAR,
competition_finish VARCHAR
) | who danced 11 and finished at more than a 2.0 | SELECT couple FROM table_1354805_6 WHERE number_of_dances = 11 AND competition_finish > 2.0 |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Next Winter , will Prof. Jiarui Fei be teaching 280 ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 280 AND instructor.name LIKE '%Jiarui Fei%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_inst... |
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,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Which courses can I take in the Fall or Winter semester to satisfy my PreMajor requirement ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0... |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose primary disease is celo-vessicle fistula and age is less than 83? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" AND demographic.age < "83" |
CREATE TABLE table_202_114 (
id number,
"make/model" text,
"series" text,
"model" text,
"year" number,
"notes" text
) | which buses are the newest in the current fleet ? | SELECT "series" FROM table_202_114 ORDER BY "year" DESC LIMIT 1 |
CREATE TABLE table_203_180 (
id number,
"#" number,
"weekend end date" text,
"film" text,
"weekend gross (millions)" text,
"notes" text
) | what was the last film of the year ? | SELECT "film" FROM table_203_180 ORDER BY "weekend end date" DESC LIMIT 1 |
CREATE TABLE table_name_67 (
pregame_host VARCHAR,
color_commentator_s_ VARCHAR,
play_by_play VARCHAR,
year VARCHAR
) | What is the name of the pregame host when the Play-by-play was by JP Dellacamera, earlier than 2009, and Color commentator(s) was Ty Keough? | SELECT pregame_host FROM table_name_67 WHERE play_by_play = "jp dellacamera" AND year < 2009 AND color_commentator_s_ = "ty keough" |
CREATE TABLE table_67133 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score of the game that had a loss of Coates (0 2)? | SELECT "Score" FROM table_67133 WHERE "Loss" = 'coates (0–2)' |
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 asian patients had colonoscopy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.long_title = "Colonoscopy" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is maximum age of patients whose admission location is phys referral/normal deli and discharge location is home health care? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "HOME HEALTH CARE" |
CREATE TABLE table_204_535 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | what is next after joan o. | SELECT "rider" FROM table_204_535 WHERE "pos" = (SELECT "pos" FROM table_204_535 WHERE "rider" = 'joan olive') + 1 |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number... | what's the last prescription time for vancomycin hcl for patient 5364 in the first hospital encounter? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5364 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'vancomycin hcl' ORDER BY prescriptions.startdate DESC LIMIT... |
CREATE TABLE table_72783 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | Name the total number of grounds for essendon | SELECT COUNT("Ground") FROM table_72783 WHERE "Home team" = 'Essendon' |
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... | Questions and Answers per Day since 27 Sept 2019. | SELECT DATE(CreationDate), SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) >= '2019-09-27' GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) DESC |
CREATE TABLE table_72075 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | What are the total number of positions on the Toronto team in 2006-07? | SELECT COUNT("Position") FROM table_72075 WHERE "Years in Toronto" = '2006-07' |
CREATE TABLE table_2668352_16 (
district VARCHAR,
incumbent VARCHAR
) | How many districts have John C. Calhoun as the incumbent? | SELECT COUNT(district) FROM table_2668352_16 WHERE incumbent = "John C. Calhoun" |
CREATE TABLE table_30657 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
) | What is listed in tor floysvik when karianne gulliksen is 6? | SELECT MIN("Tor Fl\u00f8ysvik") FROM table_30657 WHERE "Karianne Gulliksen" = '6' |
CREATE TABLE table_2144389_9 (
vocalist VARCHAR,
rōmaji VARCHAR
) | When pok mon ieru kana? bw is the romaji who is the vocalist? | SELECT vocalist FROM table_2144389_9 WHERE rōmaji = "Pokémon ieru kana? BW" |
CREATE TABLE table_name_43 (
state VARCHAR,
home_venue VARCHAR
) | What is the State with a home venue of suwon sports complex? | SELECT state FROM table_name_43 WHERE home_venue = "suwon sports complex" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (... | what lab tests did patient 22782 receive in 04/this year for the first time? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22782) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ... |
CREATE TABLE table_166346_1 (
population__july_2012_ INTEGER,
area__km²_ VARCHAR
) | What is the highest poplulation in July 2012 in the country with an area of 2149690 square kilometers? | SELECT MAX(population__july_2012_) FROM table_166346_1 WHERE area__km²_ = 2149690 |
CREATE TABLE table_name_62 (
college VARCHAR,
position VARCHAR
) | The safety position is represented in the draft by which colleges? | SELECT college FROM table_name_62 WHERE position = "safety" |
CREATE TABLE table_16661199_2 (
attendance INTEGER,
giants_points VARCHAR
) | Name the most attendance for giants points of 10 | SELECT MAX(attendance) FROM table_16661199_2 WHERE giants_points = 10 |
CREATE TABLE table_74194 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who did the most high rebounds on April 6? | SELECT "High rebounds" FROM table_74194 WHERE "Date" = 'April 6' |
CREATE TABLE table_31154 (
"Division" text,
"Brigade" text,
"Regiment" text,
"Colonel" text,
"County" text
) | in how many of the arkansas colomel the county was pope | SELECT COUNT("Colonel") FROM table_31154 WHERE "County" = 'Pope' |
CREATE TABLE table_27293285_2 (
bonus_points VARCHAR,
points_for VARCHAR
) | How many bonus points did the club who had 379 points for have? | SELECT bonus_points FROM table_27293285_2 WHERE points_for = "379" |
CREATE TABLE table_20569 (
"Year" real,
"GDP Nominal ($ billions)" text,
"GDP Adjusted ($ billions)" text,
"Population (millions)" text,
"GDP per capita Nominal ($)" real,
"GDP per capita Adjusted ($)" real
) | What is the adjusted GDP when the nominal GDP is 8.43 (in billions)? | SELECT "GDP Adjusted ($ billions)" FROM table_20569 WHERE "GDP Nominal ($ billions)" = '8.43' |
CREATE TABLE table_7946 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is Player, when Score is '71-69-72-72=284'? | SELECT "Player" FROM table_7946 WHERE "Score" = '71-69-72-72=284' |
CREATE TABLE table_203_637 (
id number,
"player" text,
"for" text,
"against" text,
"result" text,
"date" text
) | what was the result of the match between queens park rangers and everton ? | SELECT "result" FROM table_203_637 WHERE "for" = 'queens park rangers' AND "against" = 'everton' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (... | tell me how long patient 028-23341 stayed in the hospital last time. | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '028-23341' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE table_18042409_1 (
alma_mater VARCHAR,
player VARCHAR
) | What university did Steve Hoar attend. | SELECT alma_mater FROM table_18042409_1 WHERE player = "Steve Hoar" |
CREATE TABLE Settlements (
Date_Claim_Made VARCHAR,
Date_Claim_Settled VARCHAR
) | What are the claim dates and settlement dates of all the settlements? | SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements |
CREATE TABLE table_19915 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Whats the name of segment D in the episode where segment A is tequila | SELECT "Segment D" FROM table_19915 WHERE "Segment A" = 'Tequila' |
CREATE TABLE table_name_11 (
player VARCHAR,
to_par VARCHAR
) | What Player has a +3 To par? | SELECT player FROM table_name_11 WHERE to_par = "+3" |
CREATE TABLE table_40742 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What content is provided by the television service ewtn? | SELECT "Content" FROM table_40742 WHERE "Television service" = 'ewtn' |
CREATE TABLE table_name_84 (
away_team VARCHAR,
home_team VARCHAR
) | What was the away score when the home team was Melbourne? | SELECT away_team AS score FROM table_name_84 WHERE home_team = "melbourne" |
CREATE TABLE table_78938 (
"City" text,
"Country" text,
"Airport" text,
"IATA" text,
"ICAO" text
) | In what Country is Haugesund? | SELECT "Country" FROM table_78938 WHERE "City" = 'haugesund' |
CREATE TABLE table_46903 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) | What is Score, when Date is greater than 7, and when Game is '82'? | SELECT "Score" FROM table_46903 WHERE "Date" > '7' AND "Game" = '82' |
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... | Highest Reputation by Country - NGQ. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') AND Reputation > '##Reputation##' ORDER BY Reputation DESC |
CREATE TABLE table_3609 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who were the incumbent(s) in the election featuring john murray (dr) 50.4% george denison (dr) 49.6% with a result of a retired democratic-republican hold? | SELECT "Incumbent" FROM table_3609 WHERE "Candidates" = 'John Murray (DR) 50.4% George Denison (DR) 49.6%' AND "Result" = 'Retired Democratic-Republican hold' |
CREATE TABLE table_177273_2 (
surface VARCHAR,
score VARCHAR
) | On what surface was the game played with a score of 6 4, 6 4? | SELECT surface FROM table_177273_2 WHERE score = "6–4, 6–4" |
CREATE TABLE table_13336122_6 (
us_viewers__million_ VARCHAR,
no_in_season VARCHAR
) | Name the number of shows when there was 2 million views | SELECT COUNT(us_viewers__million_) FROM table_13336122_6 WHERE no_in_season = 2 |
CREATE TABLE table_13116 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | Who got 13 score points at wc kerrville? | SELECT "Shooter" FROM table_13116 WHERE "Score points" = '13' AND "Event" = 'wc kerrville' |
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 (... | count the number of patients whose admission location is emergency room admit and procedure short title is closed liver biopsy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Closed liver biopsy" |
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,
... | provide the number of patients whose ethnicity is black/haitian and year of birth is less than 2087? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2087" |
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 most common laboratory tests that patients have during the same month after being diagnosed with s/p thoracoscopic procedure - lung reduction in 2105? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p thoracoscopic procedure - lung reduction' AND ST... |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | what's patient 031-23724's sao2 difference second measured on the first intensive care unit visit compared to the first value measured on the first intensive care unit visit? | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724') AND NOT patient.unitdischargetime IS NULL ... |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Minor_in (
StuID INTEGER,
DNO INTEGER
)
CREATE TABLE Member_of (
FacID INTEGER,
DNO INTEGER,... | Show me about the correlation between CID and DNO in a scatter chart. | SELECT CID, DNO FROM Course ORDER BY Credits |
CREATE TABLE table_name_78 (
attendance VARCHAR,
opponent VARCHAR
) | Which Attendance has an Opponent of crawley town? | SELECT attendance FROM table_name_78 WHERE opponent = "crawley town" |
CREATE TABLE table_71382 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
) | Name the height with 9 floors | SELECT "Height ft / m" FROM table_71382 WHERE "Floors" = '9' |
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... | tell me the number of patients admitted before 2155 who had homocysteine lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2155" AND lab.label = "Homocysteine" |
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 diagnoses (
... | find the number of patients whose diagnoses short title is crbl art ocl nos w infrc and lab test result is abnormal. | 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 = "Crbl art ocl NOS w infrc" AND lab.flag = "abnormal" |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time... | Of all the upper-level classes , which are 11 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 11 AND program_course.category LIKE 'ULCS' |
CREATE TABLE table_16444 (
"Series #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What was the original air date for Series 36? | SELECT "Original air date" FROM table_16444 WHERE "Series #" = '36' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.