table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_76866 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is the location of the game with a 6-11-8 record? | SELECT "Location" FROM table_76866 WHERE "Record" = '6-11-8' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | was there any organism found during the last month in patient 031-15666's first urine, catheter specimen test? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIM... |
CREATE TABLE table_1979619_3 (
term_ends VARCHAR,
residence VARCHAR
) | Name the term ends for bethlehem | SELECT COUNT(term_ends) FROM table_1979619_3 WHERE residence = "Bethlehem" |
CREATE TABLE table_name_35 (
episodes INTEGER,
actor VARCHAR
) | What is the lowest number of episodes for anabel barnston? | SELECT MIN(episodes) FROM table_name_35 WHERE actor = "anabel barnston" |
CREATE TABLE table_17685 (
"Track Name" text,
"Location" text,
"Length" text,
"Seating" real,
"Year Opened" real,
"Year Acquired [A ]" real
) | Where is the track that opened in 1995? | SELECT "Location" FROM table_17685 WHERE "Year Opened" = '1995' |
CREATE TABLE table_6629 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
) | What country has a loan as the type? | SELECT "Country" FROM table_6629 WHERE "Type" = 'loan' |
CREATE TABLE table_6723 (
"Year" real,
"Male" text,
"Female" text,
"Band" text,
"Album" text,
"Pop Act" text,
"Lifetime Achievement Award" text
) | Which act's album has a name of All That You Can't Leave Behind? | SELECT "Pop Act" FROM table_6723 WHERE "Album" = 'all that you can''t leave behind' |
CREATE TABLE table_name_38 (
result VARCHAR,
week VARCHAR
) | What was the result of week 13? | SELECT result FROM table_name_38 WHERE week = 13 |
CREATE TABLE table_11214212_1 (
naturalisation_by_marriage VARCHAR,
registration_of_a_minor_child VARCHAR
) | what's the naturalisation by marriage with regbeingtration of a minor child being 114 | SELECT naturalisation_by_marriage FROM table_11214212_1 WHERE registration_of_a_minor_child = 114 |
CREATE TABLE table_482 (
"Season #" real,
"Series #" real,
"Title" text,
"Canadian airdate" text,
"U.S. airdate" text,
"Production code" real
) | what are all the Canadian air dates where the u.s. air date is may 1, 2009 | SELECT "Canadian airdate" FROM table_482 WHERE "U.S. airdate" = 'May 1, 2009' |
CREATE TABLE table_2562572_22 (
dominant_religion__2002_ VARCHAR,
cyrillic_name_other_names VARCHAR
) | Name the dominant religion for | SELECT dominant_religion__2002_ FROM table_2562572_22 WHERE cyrillic_name_other_names = "Станишић" |
CREATE TABLE table_name_92 (
county VARCHAR,
r_bacon VARCHAR
) | Which county has 438 (4%) listed under R. Bacon? | SELECT county FROM table_name_92 WHERE r_bacon = "438 (4%)" |
CREATE TABLE table_name_41 (
john_edwards VARCHAR,
john_kerry VARCHAR
) | What is John Edwards, when John Kerry is '70%'? | SELECT john_edwards FROM table_name_41 WHERE john_kerry = "70%" |
CREATE TABLE table_name_54 (
score VARCHAR,
opponent VARCHAR
) | What was the score in the match against Sanaz Marand? | SELECT score FROM table_name_54 WHERE opponent = "sanaz marand" |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Suggested edits voting compared to final result. | SELECT p.Id AS Id, p.Id AS "post_link", se.Id AS "suggested_edit_link" FROM SuggestedEdits AS se INNER JOIN SuggestedEditVotes AS sev ON sev.SuggestedEditId = se.Id INNER JOIN Posts AS p ON p.Id = se.PostId WHERE sev.UserId = '##UserId##' AND NOT se.RejectionDate IS NULL AND sev.VoteTypeId = 2 |
CREATE TABLE table_34338 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | How many picks did the College of USC wind up getting? | SELECT COUNT("Pick #") FROM table_34338 WHERE "College" = 'usc' |
CREATE TABLE table_name_35 (
money___$__ VARCHAR,
score VARCHAR
) | What is Money ( $ ), when Score is '75-71-72-70=288'? | SELECT money___$__ FROM table_name_35 WHERE score = 75 - 71 - 72 - 70 = 288 |
CREATE TABLE table_35972 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Who had a points average with 0 extra points and 0 field goals? | SELECT AVG("Points") FROM table_35972 WHERE "Extra points" = '0' AND "Field goals" > '0' |
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 prescription... | what is minimum age of patients whose admission location is phys referral/normal deli and primary disease is bladder cancer/sda? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "BLADDER CANCER/SDA" |
CREATE TABLE table_69378 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
) | Which team had the attendance of 16,468 and lost? | SELECT "Loss" FROM table_69378 WHERE "Attendance" = '16,468' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Find posts in last 60 days with 'coreclr' in title, body or tags. | SELECT Posts.Id AS "post_link", Title, Posts.CreationDate, PostTypeId, AnswerCount, Tags, ViewCount, Score, OwnerUserId AS "user_link", DisplayName, LastActivityDate, LastEditDate, ClosedDate, Body FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.CreationDate >= CURRENT_TIMESTAMP() - 60 AND (Title LIKE '%... |
CREATE TABLE table_203_661 (
id number,
"year" number,
"single" text,
"peak chart positions\nus mod" number,
"peak chart positions\nuk" number,
"album" text
) | how long was it between losing streak almbum and gnv fla in years . | SELECT ABS((SELECT "year" FROM table_203_661 WHERE "album" = 'losing streak') - (SELECT "year" FROM table_203_661 WHERE "album" = 'gnv fla')) |
CREATE TABLE table_34916 (
"Country" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | Which Skip has a Third of sara carlsson? | SELECT "Skip" FROM table_34916 WHERE "Third" = 'sara carlsson' |
CREATE TABLE table_name_58 (
player VARCHAR,
club_province VARCHAR,
date_of_birth__age_ VARCHAR
) | Which player on the Bulls has a 6 May 1978 birthday? | SELECT player FROM table_name_58 WHERE club_province = "bulls" AND date_of_birth__age_ = "6 may 1978" |
CREATE TABLE table_3049 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" text,
"Points won" real,
"New points" real,
"Status" text
) | List the competitor ranking with 900 defense points. | SELECT COUNT("Seed") FROM table_3049 WHERE "Points defending" = '900' |
CREATE TABLE table_204_884 (
id number,
"medal" text,
"name" text,
"sport" text,
"event" text,
"date" text
) | how many gold medals did this country win during these olympics ? | SELECT COUNT(*) FROM table_204_884 WHERE "medal" = 'gold' |
CREATE TABLE table_3796 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
) | What is the branding for callsign dypv? | SELECT "Branding" FROM table_3796 WHERE "Callsign" = 'DYPV' |
CREATE TABLE table_name_34 (
centre VARCHAR,
rank VARCHAR
) | Which Centre has a Rank of 42? | SELECT centre FROM table_name_34 WHERE rank = 42 |
CREATE TABLE table_name_64 (
position VARCHAR,
player VARCHAR
) | Which Position has a Player of bernard thompson? | SELECT position FROM table_name_64 WHERE player = "bernard thompson" |
CREATE TABLE table_67409 (
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text,
"Attendance" text
) | What is the date that 4,286 attended? | SELECT "Date" FROM table_67409 WHERE "Attendance" = '4,286' |
CREATE TABLE table_name_22 (
points INTEGER,
played VARCHAR,
goal_difference VARCHAR,
losses VARCHAR,
goals_against VARCHAR
) | What is the fewest points for positions with under 12 losses, goals against under 50, goal difference over 11, and under 30 played? | SELECT MIN(points) FROM table_name_22 WHERE losses < 12 AND goals_against < 50 AND goal_difference > 11 AND played < 30 |
CREATE TABLE table_73140 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the incumbent for lost renomination republican hold | SELECT "Incumbent" FROM table_73140 WHERE "Result" = 'Lost renomination Republican hold' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | when was the last time on this month/26 that patient 10855's heart rate was measured greater than 94.0? | SELECT chartevents.charttime 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 = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... |
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 those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and commission_pct , and visualize them by a bar chart, sort bar from high to low order please. | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC |
CREATE TABLE table_57132 (
"Dep." text,
"Chief town" text,
"Arrondissement" text,
"Population (1999)" text,
"Area (Square km)" real,
"Pop density" real,
"Cantons" real,
"Communes" real
) | How many communes associated with over 10 cantons and an area (Square km) of 1,589? | SELECT AVG("Communes") FROM table_57132 WHERE "Cantons" > '10' AND "Area (Square km)" = '1,589' |
CREATE TABLE table_61066 (
"State" text,
"City" text,
"Population" real,
"Violent Crime" text,
"Murder and Non-Negligent Manslaughter" real,
"Forcible Rape" text,
"Robbery" real,
"Aggravated Assault" real,
"Property Crime" text,
"Burglary" real,
"Larceny-Theft" text,
"Mot... | When population is greater than 832,901 and murder and non-negligent manslaughter is 11.6, what is the smallest burglary? | SELECT MIN("Burglary") FROM table_61066 WHERE "Population" > '832,901' AND "Murder and Non-Negligent Manslaughter" = '11.6' |
CREATE TABLE table_name_47 (
attendance VARCHAR,
opponent VARCHAR
) | What is the attendance when the opponent was the Houston Oilers? | SELECT attendance FROM table_name_47 WHERE opponent = "houston oilers" |
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... | provide the number of patients whose diagnoses short title is subtrochanteric fx-close and drug route is left eye? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subtrochanteric fx-close" AND prescriptions.route = "LEFT EYE" |
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... | provide the number of patients whose death status is 0 and primary disease is aortic insufficiency/re-do sternotomy; aortic valve replacement. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " |
CREATE TABLE table_name_13 (
attendance VARCHAR,
score VARCHAR
) | When the Score was 4-10, what was the Attendance? | SELECT attendance FROM table_name_13 WHERE score = "4-10" |
CREATE TABLE table_33885 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | What is the score for game 5? | SELECT "Score" FROM table_33885 WHERE "Game" = '5' |
CREATE TABLE table_71159 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Year" real
) | Name the opponent for 1996 at the mt smart stadium venue | SELECT "Opponent" FROM table_71159 WHERE "Venue" = 'mt smart stadium' AND "Year" = '1996' |
CREATE TABLE table_52044 (
"Series" text,
"Years" text,
"Magazine" text,
"Albums" text,
"Editor" text
) | Which series with a total of 27 albums did Dargaud edit? | SELECT "Series" FROM table_52044 WHERE "Editor" = 'dargaud' AND "Albums" = '27' |
CREATE TABLE table_name_99 (
year VARCHAR,
publication VARCHAR
) | Which year had a publication of Pazz & Jop? | SELECT year FROM table_name_99 WHERE publication = "pazz & jop" |
CREATE TABLE player (
POSITION VARCHAR,
Points INTEGER
) | What are the positions with both players having more than 20 points and less than 10 points. | SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10 |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int... | Are there any 400 -level courses in the Fall or Winter term that I can take ? | 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, semester AS SEMESTERalias0 WHERE ((SEM... |
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
) | Give me a bar chart for sum price of each name, and order y-axis in desc order. | SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) DESC |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Give me a bar chart for mean tonnage of each type, show by the Y in asc. | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) |
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 old is the patient josette orr? | SELECT demographic.age FROM demographic WHERE demographic.name = "Josette Orr" |
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 discharge location of subject name kelly gallardo? | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Kelly Gallardo" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | how patient 8991 was admitted to hospital in the previous year for the last time? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8991 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE degrees (
Id VARCHAR
)
CREATE TABLE campuses (
Id VARCHAR
) | How many degrees were conferred in 'San Jose State University' in 2000? | SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000 |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
) | Draw a bar chart of investor versus the total number, and could you list bars from high to low order? | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC |
CREATE TABLE table_67793 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Match report" text
) | What was the Match Report for the Euro2008q at the Athens Olympic Stadium on November 17, 2007? | SELECT "Match report" FROM table_67793 WHERE "Competition" = 'euro2008q' AND "Venue" = 'athens olympic stadium' AND "Date" = 'november 17, 2007' |
CREATE TABLE table_58122 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | What is the first prize amount of the person who has a score of 207 (-9) and a purse amount of more than 800,000? | SELECT COUNT("1st Prize( $ )") FROM table_58122 WHERE "Score" = '207 (-9)' AND "Purse( $ )" > '800,000' |
CREATE TABLE table_34894 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall WC points (Rank)" text
) | Which 2nd (m) has a 1st (m) of 120.5 and Points smaller than 249.9? | SELECT AVG("2nd (m)") FROM table_34894 WHERE "1st (m)" = '120.5' AND "Points" < '249.9' |
CREATE TABLE table_52444 (
"Year" real,
"Network" text,
"Lap-by-lap" text,
"Color commentator(s)" text,
"Pit reporters" text,
"Host" text,
"Ratings" text,
"Viewers" text
) | Who was the host that garnered ratings of 9.6/26? | SELECT "Host" FROM table_52444 WHERE "Ratings" = '9.6/26' |
CREATE TABLE table_9338 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
) | What was the score for the Perth Wildcats as away team? | SELECT "Score" FROM table_9338 WHERE "Away team" = 'perth wildcats' |
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,
... | which language does patient jonathan wiggins speak? | SELECT demographic.language FROM demographic WHERE demographic.name = "Jonathan Wiggins" |
CREATE TABLE table_name_15 (
week INTEGER,
opponent VARCHAR
) | What is the earliest week with an opponent of cincinnati bengals? | SELECT MIN(week) FROM table_name_15 WHERE opponent = "cincinnati bengals" |
CREATE TABLE table_49542 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is the score of the game against the baltimore bullets on March 14? | SELECT "Score" FROM table_49542 WHERE "Opponent" = 'baltimore bullets' AND "Date" = 'march 14' |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | what is the daily maximum value of patient 59473's base excess since 6 years ago? | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59473) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(),... |
CREATE TABLE table_2284 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | Which episode aired on august19,2012? | SELECT "Title" FROM table_2284 WHERE "Original air date" = 'August19,2012' |
CREATE TABLE table_name_85 (
set_2 VARCHAR,
total VARCHAR
) | What set 2 has a total of 97 74? | SELECT set_2 FROM table_name_85 WHERE total = "97–74" |
CREATE TABLE table_name_30 (
length VARCHAR,
character_name VARCHAR
) | What is the length of the film with Burleigh Sullivan as the character? | SELECT length FROM table_name_30 WHERE character_name = "burleigh sullivan" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | how many hours have elapsed since the first time that patient 030-52327 had a continuous infusion meds intake on the current intensive care unit visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... |
CREATE TABLE table_name_15 (
place VARCHAR,
weapon VARCHAR,
date VARCHAR
) | What is Place, when Weapon is '35mm fire', and when Date is '27 May 1982'? | SELECT place FROM table_name_15 WHERE weapon = "35mm fire" AND date = "27 may 1982" |
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 patient (
uniquep... | had patient 006-35134 in this year been admitted to an er? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '006-35134' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Subject... | Give me the comparison about author_id over the middle_name by a bar chart. | SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | WOMENSTD 323 has how many lecture sections next semester ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WOMENSTD' AND course.number = 323 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_c... | what is fare code Y mean | SELECT DISTINCT booking_class FROM class_of_service WHERE booking_class = 'Y' |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
Dele... | Get post with popular tags. | SELECT Count, TagName FROM Tags WHERE Count > 50000 ORDER BY Count |
CREATE TABLE table_35735 (
"Word" text,
"Pronunciation a" text,
"Meaning a" text,
"Pronunciation b" text,
"Meaning b" text
) | Name the word with pronunciation b of *s ks | SELECT "Word" FROM table_35735 WHERE "Pronunciation b" = '*sɨks' |
CREATE TABLE table_204_466 (
id number,
"rank" number,
"bib" number,
"country" text,
"time" text,
"penalties (p+s)" text,
"deficit" text
) | what is france and germany 's deficit combined ? | SELECT SUM("deficit") FROM table_204_466 WHERE "country" IN ('france', 'germany') |
CREATE TABLE table_17244483_1 (
time_retired VARCHAR,
car_no VARCHAR
) | Car number 15 earned what time? | SELECT time_retired FROM table_17244483_1 WHERE car_no = 15 |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id ... | when did patient 90165 enter the hospital first time until 4 years ago via the emergency room admit? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 90165 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE customers (
payment_method_code VARCHAR
) | For each payment method, return how many customers use it. | SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code |
CREATE TABLE table_1452 (
"Official #" real,
"TF1 #" real,
"French title" text,
"English title" text,
"Air date (France)" text,
"Original Beechwood Bunny Tale / Source material" text
) | Name the french title for english title of 'inventor bunnies | SELECT "French title" FROM table_1452 WHERE "English title" = 'Inventor Bunnies' |
CREATE TABLE table_48395 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | What is Result, when Venue is G tzis , Austria? | SELECT "Result" FROM table_48395 WHERE "Venue" = 'götzis , austria' |
CREATE TABLE table_50300 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total number of Bronze, when Gold is greater than 0, when Rank is 4, and when Total is greater than 4? | SELECT COUNT("Bronze") FROM table_50300 WHERE "Gold" > '0' AND "Rank" = '4' AND "Total" > '4' |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGE... | Give me a bar chart that bins the payment date into the Year interval and then shows the amount of each payment categorized by the payment method code, and then sort the bars in ascending order of date. | SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments GROUP BY Payment_Method_Code ORDER BY Date_Payment_Made |
CREATE TABLE table_71880 (
"Representative" text,
"Title" text,
"Presentation of Credentials" text,
"Termination of Mission" text,
"Appointed by" text
) | Who is the representative with a presentation of credentials date on February 23, 1854? | SELECT "Representative" FROM table_71880 WHERE "Presentation of Credentials" = 'february 23, 1854' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | did patient 18866 have a respiratory rate that was greater than 12.0 in 12/2105? | 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 = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'... |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | indicate the monthly minimum heart rate of patient 6196 since 164 months ago. | SELECT MIN(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 = 6196)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart... |
CREATE TABLE table_204_659 (
id number,
"seat" text,
"state" text,
"majority" number,
"member" text,
"party" text
) | what was the total majority that the dobell seat had ? | SELECT "majority" FROM table_204_659 WHERE "seat" = 'dobell' |
CREATE TABLE table_name_21 (
country VARCHAR,
city VARCHAR
) | What country is Yerevan located in? | SELECT country FROM table_name_21 WHERE city = "yerevan" |
CREATE TABLE table_69481 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | Which class's call sign is wokg? | SELECT "Class" FROM table_69481 WHERE "Call sign" = 'wokg' |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
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 swimme... | Bar chart x axis time y axis id, and order by the x axis in asc. | SELECT Time, ID FROM swimmer ORDER BY Time |
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 who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and manager_id , list by the Y from high to low. | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC |
CREATE TABLE table_61298 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What average gold has China (chn) as the nation with a bronze greater than 1? | SELECT AVG("Gold") FROM table_61298 WHERE "Nation" = 'china (chn)' AND "Bronze" > '1' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id num... | calculate the total or urine production for patient 6705 on the last icu visit. | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6705) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it... |
CREATE TABLE table_name_92 (
_jerk VARCHAR,
clean_ INTEGER,
total__kg_ VARCHAR,
snatch VARCHAR
) | what is the highest clean & jerk when total (kg) is 200.0 and snatch is more than 87.5? | SELECT MAX(clean_) & _jerk FROM table_name_92 WHERE total__kg_ = "200.0" AND snatch > 87.5 |
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 diagnoses long title is cyst and pseudocyst of pancreas and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cyst and pseudocyst of pancreas" AND prescriptions.drug_type = "MAIN" |
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 whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of oddi and lab test category is chemistry? | 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 = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" AND lab."CATEGORY" = "Chemistry" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | what drugs are being added to patient 021-80293 today as compared to those yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-80293') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... |
CREATE TABLE table_7305 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
) | What is the highest games Played where the Place is 10 and Points are less than 17? | SELECT MAX("Played") FROM table_7305 WHERE "Place" = '10' AND "Points" < '17' |
CREATE TABLE table_name_89 (
team__number2 VARCHAR,
team__number1 VARCHAR
) | Who played against Hapoel tel aviv when they were team #1? | SELECT team__number2 FROM table_name_89 WHERE team__number1 = "hapoel tel aviv" |
CREATE TABLE table_2182170_1 (
car_s_ VARCHAR,
listed_owner_s_ VARCHAR
) | How many cars does Gregg Mixon own? | SELECT COUNT(car_s_) FROM table_2182170_1 WHERE listed_owner_s_ = "Gregg Mixon" |
CREATE TABLE table_21436 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
) | What is the car number driven by Darren Manning? | SELECT "Car No." FROM table_21436 WHERE "Driver" = 'Darren Manning' |
CREATE TABLE table_204_670 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number
) | what is the difference in attendance for week 5 and 9 | SELECT ABS((SELECT "attendance" FROM table_204_670 WHERE "week" = 5) - (SELECT "attendance" FROM table_204_670 WHERE "week" = 9)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.