table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_37713 (
"Score" text,
"Opposition" text,
"Venue" text,
"City" text,
"Year" real
) | What was the score for 1911? | SELECT "Score" FROM table_37713 WHERE "Year" = '1911' |
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... | Among patients admitted before 2148, how many of them had pressure ulcer, buttock? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2148" AND diagnoses.long_title = "Pressure ulcer, buttock" |
CREATE TABLE table_70196 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | Which city has frequency under 106.5MHz and a callsign of w218ck? | SELECT "City of license" FROM table_70196 WHERE "Frequency MHz" < '106.5' AND "Call sign" = 'w218ck' |
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 of the patients with icd9 code 9229 were discharged for long term care hospital? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.icd9_code = "9229" |
CREATE TABLE table_73444 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | What is the status of the county that has a 17.3% poverty rate? | SELECT "Status" FROM table_73444 WHERE "Poverty Rate" = '17.3%' |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | what is the last flight from DALLAS to BOSTON | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 varcha... | For those employees who did not have any job in the past, find hire_date and the sum of employee_id bin hire_date by time, and visualize them by a bar chart, and rank in asc by the sum employee id please. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) |
CREATE TABLE table_79660 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in final" text,
"Score" text,
"Prize Money" text
) | What is the score of the hard court Ramat Hasharon tournament? | SELECT "Score" FROM table_79660 WHERE "Surface" = 'hard' AND "Tournament" = 'ramat hasharon' |
CREATE TABLE table_23182 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) | Where is the school whose students are nicknamed Panthers located? | SELECT "Location" FROM table_23182 WHERE "Nickname" = 'Panthers' |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | Find those themes and years for all exhibitions with ticket prices lower than 15, group by themes, count year, and the x-axis is Year, show from low to high by the y-axis. | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme ORDER BY COUNT(Year) |
CREATE TABLE table_name_80 (
lane VARCHAR,
heat VARCHAR,
name VARCHAR
) | What lane is David Carry in heat 1? | SELECT COUNT(lane) FROM table_name_80 WHERE heat = 1 AND name = "david carry" |
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... | Recommend human computer interaction courses which are easier than HISTORY 195 . | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%human computer interaction%' AND program_course.workload < (SELECT MIN(P... |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Visualize a bar chart about the distribution of name and ID . | SELECT name, ID FROM swimmer |
CREATE TABLE table_49829 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which Manufacturer has a Laps of 21, a Grid larger than 16, and a Rider of akira ry ? | SELECT "Manufacturer" FROM table_49829 WHERE "Laps" = '21' AND "Grid" > '16' AND "Rider" = 'akira ryō' |
CREATE TABLE table_36261 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
) | Date of october 10, 1965 had what lowest attendance? | SELECT MIN("Attendance") FROM table_36261 WHERE "Date" = 'october 10, 1965' |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagn... | for patients who received spinal struct repair nec until 3 years ago, what are the top four most frequent specimens tested afterwards within 2 months? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 FR... |
CREATE TABLE table_203_459 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
) | how many townships have no water area ? | SELECT COUNT("township") FROM table_203_459 WHERE "water area\nkm2 (sq mi)" = 0 |
CREATE TABLE table_76763 (
"Name" text,
"Years" text,
"Regular season" real,
"Playoffs" real,
"Total" real
) | what is the years when playoffs is 115? | SELECT "Years" FROM table_76763 WHERE "Playoffs" = '115' |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and salary in a bar chart, could you sort by the names in asc? | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME |
CREATE TABLE table_name_26 (
pick VARCHAR,
player VARCHAR
) | What pick was roger holdinsky? | SELECT pick FROM table_name_26 WHERE player = "roger holdinsky" |
CREATE TABLE table_name_27 (
opponent VARCHAR,
result VARCHAR
) | When the result was l 13-7 ot, who was the opponent? | SELECT opponent FROM table_name_27 WHERE result = "l 13-7 ot" |
CREATE TABLE table_65524 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
) | What country was the Pegasus, build by Royal Dockyard, from? | SELECT "Country" FROM table_65524 WHERE "Builder" = 'royal dockyard' AND "Ship" = 'pegasus' |
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year in... | Can you draw a bar chart to show the number of positions of the pilots? | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position |
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives... | What are the names of the all-female dorms? | SELECT dorm_name FROM dorm WHERE gender = 'F' |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, and display by the y-axis from high to low. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC |
CREATE TABLE review (
a_id integer,
u_id integer,
i_id integer,
rating integer,
rank integer
)
CREATE TABLE item (
i_id integer,
title varchar(20)
)
CREATE TABLE useracct (
u_id integer,
name varchar(128)
)
CREATE TABLE trust (
source_u_id integer,
target_u_id integer,
... | For each user, return the name and the average rating of reviews given by them. Plot them as pie chart. | SELECT name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id |
CREATE TABLE table_name_28 (
college VARCHAR,
player VARCHAR
) | What college did john sullivan attend? | SELECT college FROM table_name_28 WHERE player = "john sullivan" |
CREATE TABLE table_2897457_2 (
nhl_team VARCHAR,
player VARCHAR
) | What NHL team picked richard borgo? | SELECT nhl_team FROM table_2897457_2 WHERE player = "Richard Borgo" |
CREATE TABLE table_name_6 (
erp_w INTEGER,
call_sign VARCHAR
) | What is the lowest ERP W of w223bp? | SELECT MIN(erp_w) FROM table_name_6 WHERE call_sign = "w223bp" |
CREATE TABLE table_name_79 (
position VARCHAR,
overall VARCHAR,
player VARCHAR
) | Which position did David Nugent play with an overall small than 187? | SELECT position FROM table_name_79 WHERE overall > 187 AND player = "david nugent" |
CREATE TABLE table_name_57 (
year INTEGER,
category VARCHAR,
nominated_for VARCHAR
) | Name the year that Birds of a feather category for most popular actress was nominated | SELECT AVG(year) FROM table_name_57 WHERE category = "most popular actress" AND nominated_for = "birds of a feather" |
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 average age of patients whose admission type is emergency and primary disease is bladder cancer/sda? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA" |
CREATE TABLE table_name_5 (
satellite VARCHAR,
launch_site VARCHAR
) | Which satellite was launched from Vandenberg? | SELECT satellite FROM table_name_5 WHERE launch_site = "vandenberg" |
CREATE TABLE table_3058 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
) | Name the awardees for best special effects | SELECT "Awardee(s)" FROM table_3058 WHERE "Name of Award" = 'Best Special Effects' |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Count questions not answered per tag count. | SELECT x.total, COUNT(x.Id), CAST(COUNT(x.Id) AS FLOAT) / (SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1) FROM (SELECT Q.Id, COUNT(PT.TagId) AS total FROM Posts AS Q INNER JOIN PostTags AS PT ON Q.Id = PT.PostId WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1 GROUP BY Q.Id) AS x GROUP BY ... |
CREATE TABLE table_78975 (
"Lexton Plains" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the most wins with 0 byes? | SELECT MAX("Wins") FROM table_78975 WHERE "Byes" > '0' |
CREATE TABLE table_name_92 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
) | What is Tom Kite with a Score of 68's To Par? | SELECT to_par FROM table_name_92 WHERE score = 68 AND player = "tom kite" |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, and order y axis in descending order please. | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC |
CREATE TABLE table_203_611 (
id number,
"player" text,
"hr" number,
"date reached 500 hr" text,
"team" text,
"seasons played" text
) | which boston red sox player got the most career home runs ? | SELECT "player" FROM table_203_611 WHERE "team" = 'boston red sox' ORDER BY "hr" DESC LIMIT 1 |
CREATE TABLE table_24033 (
"Ep." real,
"Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. Code" text
) | When 'jobless' is the title who are the writers? | SELECT "Written by" FROM table_24033 WHERE "Title" = 'Jobless' |
CREATE TABLE table_40448 (
"Draw" real,
"Artist" text,
"Song" text,
"Result" text,
"Place" real
) | What is the name of Aleko Berdzenishvili's song? | SELECT "Song" FROM table_40448 WHERE "Artist" = 'aleko berdzenishvili' |
CREATE TABLE table_12422 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | Name the District which has a Reserved for ( SC / ST /None) of sc? | SELECT "District" FROM table_12422 WHERE "Reserved for ( SC / ST /None)" = 'sc' |
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 was the last height of patient 728 until 32 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 = 728)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' A... |
CREATE TABLE table_45302 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What country is Jack Nicklaus from? | SELECT "Country" FROM table_45302 WHERE "Player" = 'jack nicklaus' |
CREATE TABLE table_train_180 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"post_load_glucose" int,
"diastolic_blood_pressure_dbp" int,
"impaired_glucose_tolerance" bool,
"fasting_gl... | fasting glucose of 100 _ 125 mg / dl ( impaired fasting glucose tolerance ) and / or 2 _ hour post _ load glucose of 140 _ 199 mg / dl ( impaired glucose tolerance ) | SELECT * FROM table_train_180 WHERE fasting_glucose >= 100 AND fasting_glucose <= 125 OR impaired_glucose_tolerance = 1 OR (post_load_glucose >= 140 AND post_load_glucose <= 199) OR impaired_glucose_tolerance = 1 |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TAB... | What has ras bodik published ? | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'ras bodik' AND writes.authorid = author.authorid |
CREATE TABLE table_train_268 (
"id" int,
"basal_rate" float,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"major_illness" bool,
"creatinine_clearance_cl" float,
"injury_to_body" bool,
"diastolic_blood_pressure_dbp" int,
"injury_to_limb" bool,
"hypertension" bool,
... | a recent injury to body or limb | SELECT * FROM table_train_268 WHERE injury_to_body = 1 OR injury_to_limb = 1 |
CREATE TABLE table_203_228 (
id number,
"#" number,
"title" text,
"songwriters" text,
"producer(s)" text,
"performer (s)" text
) | who produced the track no main topic ? | SELECT "producer(s)" FROM table_203_228 WHERE "title" = '"no main topic"' |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test... | Find the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and count them by a bar chart | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" |
CREATE TABLE table_name_32 (
february VARCHAR,
game VARCHAR,
opponent VARCHAR,
record VARCHAR
) | How many Februarys have montreal canadiens as the opponent, and 18-25-10 as the record, with a game greater than 53? | SELECT COUNT(february) FROM table_name_32 WHERE opponent = "montreal canadiens" AND record = "18-25-10" AND game > 53 |
CREATE TABLE table_name_86 (
location VARCHAR,
size VARCHAR
) | What location was the campus that has a size of 245 acres? | SELECT location FROM table_name_86 WHERE size = "245 acres" |
CREATE TABLE table_32973 (
"Year" real,
"Sportsperson" text,
"Nation of birth" text,
"Team" text,
"Competition , federation , or league" text,
"Sport" text
) | What team has a year listed of 2008? | SELECT "Team" FROM table_32973 WHERE "Year" = '2008' |
CREATE TABLE table_23851574_2 (
name VARCHAR,
nationality_sponsors VARCHAR
) | Which telescopes were sponsored by or originated in Belgium? | SELECT name FROM table_23851574_2 WHERE nationality_sponsors = "Belgium" |
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,... | Give me the number of male patients who had an endoscopic sphincterotomy and papillotomy procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy" |
CREATE TABLE table_44923 (
"Technology" text,
"Moving Parts" text,
"Room Temperature" text,
"Flammable" text,
"Toxic Materials" text,
"In production" text,
"Rare metals" text
) | What are the moving parts of lead-acid? | SELECT "Moving Parts" FROM table_44923 WHERE "Technology" = 'lead-acid' |
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 was the age of patient 022-158213 in their last hospital encounter? | SELECT patient.age FROM patient WHERE patient.uniquepid = '022-158213' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | Average time to Answer a question. | SELECT p1.Id AS "AnsID", p1.ParentId AS "QuestionId", p1.CreationDate AS "AnsCreationdate", p2.CreationDate AS "QuestionCreationdate", CAST((JULIANDAY(CreationDate) - JULIANDAY(p2.CreationDate)) * 1440.0 AS INT) AS Time_Difference FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND p1.P... |
CREATE TABLE table_14556 (
"Opponent" text,
"OVERALL" text,
"HOME" text,
"AWAY" text,
"PLYFF" text
) | Which home team has a playoff record of (0-0) and played La Crosse Spartans? | SELECT "HOME" FROM table_14556 WHERE "PLYFF" = '(0-0)' AND "Opponent" = 'la crosse spartans' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients of white russian ethnicty are diagnosed with unspecified septicemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Unspecified septicemia" |
CREATE TABLE table_name_83 (
film_title_used_in_nomination VARCHAR,
primary_language_s_ VARCHAR
) | What is Film Title Used In Nomination, when Primary Language(s) is 'Azerbaijani, Russian'? | SELECT film_title_used_in_nomination FROM table_name_83 WHERE primary_language_s_ = "azerbaijani, russian" |
CREATE TABLE table_44104 (
"Date" text,
"Name" text,
"Nationality" text,
"Tonnage (GRT)" real,
"Fate" text
) | What is the date of attack of the Circe Shell Ship? | SELECT "Date" FROM table_44104 WHERE "Name" = 'circe shell' |
CREATE TABLE table_train_278 (
"id" int,
"gender" string,
"supine" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"bilirubin" float,
"NOUSE" floa... | estimated gfr ( by modified diet in renal disease ) < 45 ml / min / 1.73 m2 ( within 2 weeks of planned cmr ) | SELECT * FROM table_train_278 WHERE estimated_glomerular_filtration_rate_egfr < 45 |
CREATE TABLE table_2112766_1 (
episode VARCHAR,
viewers__in_millions_ VARCHAR
) | how many episode have 8.4 millions viewer. | SELECT COUNT(episode) FROM table_2112766_1 WHERE viewers__in_millions_ = "8.4" |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename var... | what conferences are related to sensor fusion | SELECT DISTINCT paper.venueid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'sensor fusion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city var... | Name the PATH classes offered in Fall term . | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PATH' AND semester.semester = 'Fall' |
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... | what were the top three frequently prescribed drugs that were prescribed to patients within the same month after they were prescribed with acetaminophen (tylenol) tab 650 mg until 3 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'acetaminophen (tylenol) tab 650 mg' AND DATETIME(me... |
CREATE TABLE table_name_55 (
location_attendance VARCHAR,
high_assists VARCHAR
) | Where did Ben Gordon (8) have the high assists? | SELECT location_attendance FROM table_name_55 WHERE high_assists = "ben gordon (8)" |
CREATE TABLE table_6713 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Home" text,
"Away" text,
"Agg." text
) | Which Away has an Opponent of slavia prague? | SELECT "Away" FROM table_6713 WHERE "Opponent" = 'slavia prague' |
CREATE TABLE table_name_84 (
capacity VARCHAR,
model_engine VARCHAR
) | Name the capacity for the engine of 2.0 duratorq | SELECT capacity FROM table_name_84 WHERE model_engine = "2.0 duratorq" |
CREATE TABLE table_5168 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | Which opponent had a round of more than 1 and an even of PFP: ring of fire? | SELECT "Opponent" FROM table_5168 WHERE "Round" > '1' AND "Event" = 'pfp: ring of fire' |
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 asian patients died in or before 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dod_year <= "2154.0" |
CREATE TABLE table_name_30 (
extra VARCHAR,
result VARCHAR,
year VARCHAR
) | Which extra resulted in 2nd before 2005? | SELECT extra FROM table_name_30 WHERE result = "2nd" AND year < 2005 |
CREATE TABLE table_78497 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people witnessed their home team score 13.15 (93)? | SELECT MAX("Crowd") FROM table_78497 WHERE "Home team score" = '13.15 (93)' |
CREATE TABLE table_name_43 (
name VARCHAR,
entered_service VARCHAR,
location VARCHAR,
type VARCHAR
) | What is the name of the location and ship type in the Gulf of Mexico that entered service in 1999? | SELECT name FROM table_name_43 WHERE location = "gulf of mexico" AND type = "ship" AND entered_service = "1999" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | how many of the patients had cardiac mapping on urgent admission? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Cardiac mapping" |
CREATE TABLE table_name_87 (
grid INTEGER,
laps VARCHAR,
time_retired VARCHAR
) | What is the total amount of grid when the laps amount was smaller than 68 and the time/retired was injection? | SELECT SUM(grid) FROM table_name_87 WHERE laps < 68 AND time_retired = "injection" |
CREATE TABLE table_8546 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Which Points for has a Losing bonus of 2, and a Club of bridgend sports rfc? | SELECT "Points for" FROM table_8546 WHERE "Losing bonus" = '2' AND "Club" = 'bridgend sports rfc' |
CREATE TABLE table_name_98 (
team VARCHAR,
position_in_table VARCHAR,
replaced_by VARCHAR
) | WHAT TEAM HAS 12TH TABLE POSITION AND REPLACED BY OVE PEDERSEN? | SELECT team FROM table_name_98 WHERE position_in_table = "12th" AND replaced_by = "ove pedersen" |
CREATE TABLE table_57004 (
"Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text
) | What is the episode # of the episode that originally aired on January 21, 2001? | SELECT "Episode #" FROM table_57004 WHERE "Original airdate" = 'january 21, 2001' |
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real,
Total_Points real
)
CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height ... | Display a pie chart for how many gymnasts are from each hometown? | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown |
CREATE TABLE table_204_321 (
id number,
"community" text,
"currency" text,
"region" text,
"target date" number,
"notes" text
) | what is the first region on the chart | SELECT "region" FROM table_204_321 WHERE id = 1 |
CREATE TABLE table_name_5 (
tries INTEGER,
goals INTEGER
) | Which Tries has a Goal smaller than 0? | SELECT MIN(tries) FROM table_name_5 WHERE goals < 0 |
CREATE TABLE table_25244412_2 (
total_electricity__gw VARCHAR,
renewable_electricity_w_o_hydro__gw·h_ VARCHAR
) | How many data was given the total electricity in GW-h if the renewable electricity w/o hydro (GW-h) is 3601? | SELECT COUNT(total_electricity__gw) AS ·h_ FROM table_25244412_2 WHERE renewable_electricity_w_o_hydro__gw·h_ = 3601 |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and I want to sort in asc by the Y. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code |
CREATE TABLE table_17183 (
"Unit" text,
"Commander" text,
"Complement" text,
"Killed" text,
"Wounded" text,
"Missing" text
) | What are the complements when the commander is Major William Lloyd? | SELECT "Complement" FROM table_17183 WHERE "Commander" = 'Major William Lloyd' |
CREATE TABLE table_name_95 (
bulgarian_name VARCHAR,
english_name VARCHAR
) | What's the bulgarian word for January? | SELECT bulgarian_name FROM table_name_95 WHERE english_name = "january" |
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 demographic (... | what is marital status and primary disease of subject name james cepeda? | SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.name = "James Cepeda" |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the amount of hire_date bin hire_date by weekday, and visualize them by a bar chart, and show by the total number in asc please. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) |
CREATE TABLE table_25284864_3 (
january_15_16 VARCHAR,
november_3 VARCHAR
) | What January 15-16 is is that corresponds to November 3, 2013? | SELECT january_15_16 FROM table_25284864_3 WHERE november_3 = "november_3, 2013" |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Find ACC_Regular_Season and All_Games_Percent , and visualize them by a bar chart, rank by the Y-axis in descending. | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | How many students live in each city, I want to show total number from high to low order. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_99 (
opponent VARCHAR,
date VARCHAR
) | Who is the opponent on September 9, 1979? | SELECT opponent FROM table_name_99 WHERE date = "september 9, 1979" |
CREATE TABLE table_17625749_1 (
lost VARCHAR,
tries_for VARCHAR
) | Name the number of lost where tries for is 109 | SELECT COUNT(lost) FROM table_17625749_1 WHERE tries_for = "109" |
CREATE TABLE table_name_35 (
crowd INTEGER,
away_team VARCHAR
) | What was the lowest Crowd total from a game in which Essendon was the Away team? | SELECT MIN(crowd) FROM table_name_35 WHERE away_team = "essendon" |
CREATE TABLE table_9254 (
"Season" real,
"Conference" text,
"Champion" text,
"Format" text,
"Series" text,
"Runner-Up" text
) | What conference has 2009 as the season, with super leg final as the format? | SELECT "Conference" FROM table_9254 WHERE "Season" = '2009' AND "Format" = 'super leg final' |
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,
... | find out the short title of both diagnoses and procedure for patient with patient id 23602. | SELECT diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23602" |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
h... | has ever been the sao2 of patient 22897 been ever less than 98.0 until 21 months ago? | SELECT COUNT(*) > 0 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 = 22897)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2' AND d_items... |
CREATE TABLE table_70290 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the home team when the record was 36 21 8? | SELECT "Home" FROM table_70290 WHERE "Record" = '36–21–8' |
CREATE TABLE table_train_264 (
"id" int,
"stroke" bool,
"hematocrit_hct" float,
"serum_psa" float,
"coronary_artery_disease_cad" bool,
"international_prostate_symptom_score_ipss" int,
"hypertension" bool,
"NOUSE" float
) | stroke or recent diagnosis of coronary artery disease | SELECT * FROM table_train_264 WHERE stroke = 1 OR coronary_artery_disease_cad = 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.