table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_51 (
venue VARCHAR,
away_team VARCHAR
) | Where did Richmond play as the away team? | SELECT venue FROM table_name_51 WHERE away_team = "richmond" |
CREATE TABLE table_31459 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many teams did inge 6 have the high assists with? | SELECT COUNT("Team") FROM table_31459 WHERE "High assists" = 'Inge – 6' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients whose ethnicity is black/haitian and drug name is fentanyl citrate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Fentanyl Citrate" |
CREATE TABLE table_203_761 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | how many total laps did alex figge complete ? | SELECT "laps" FROM table_203_761 WHERE "driver" = 'alex figge' |
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... | what is discharge location of subject id 6983? | SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "6983" |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and display from low to high by the y axis. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) |
CREATE TABLE table_19502 (
"Week" real,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | Type the record details if any result has L 3-6 in it? | SELECT "Record" FROM table_19502 WHERE "Result" = 'L 3-6' |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | Number of times that questions have gone through the Reopen review queue. | SELECT ReviewTasks.PostId AS "post_link", COUNT(*) AS NumberOfReviews, Posts.CreationDate FROM ReviewTasks JOIN Posts ON ReviewTasks.PostId = Posts.Id WHERE ReviewTasks.ReviewTaskTypeId = 6 GROUP BY ReviewTasks.PostId, Posts.CreationDate ORDER BY NumberOfReviews DESC |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
pro... | show all nonstop flights from BOSTON to SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... |
CREATE TABLE table_79104 (
"Year" real,
"Theme" text,
"Face Value" text,
"Weight" text,
"Diameter" text,
"Mintage" real,
"Issue Price" text
) | What is the Year of the Coin with an Issue Price of $1089.95 and Mintage less than 900? | SELECT SUM("Year") FROM table_79104 WHERE "Issue Price" = '$1089.95' AND "Mintage" < '900' |
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
)
... | Get the number of patients who had a creatine kinase mb isoenzyme lab test that are taking a base type drug. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Creatine Kinase, MB Isoenzyme" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_r... | what are the top five most common output events since 5 years ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5) |
CREATE TABLE table_23649 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall NT points" text,
"Overall WC points (Rank)" text
) | Name the overall nt points for 2nd m 127.5 | SELECT "Overall NT points" FROM table_23649 WHERE "2nd (m)" = '127.5' |
CREATE TABLE table_29703 (
"Model" text,
"PPI (pixels per inch )" real,
"ppcm (pixels per cm )" real,
"Resolution" text,
"Typical viewing distance (in/cm)" text,
"Pixels per degree (PPD)" real
) | How many different PPI does the model with ppcm of 87 have? | SELECT COUNT("PPI (pixels per inch )") FROM table_29703 WHERE "ppcm (pixels per cm )" = '87' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | when was the last time patient 009-2181 had a stool output since 218 days ago? | SELECT 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 = '009-2181')) AND intakeoutput.cellpath LIKE '%output%'... |
CREATE TABLE table_51791 (
"Election" text,
"D\u00e1il" text,
"Share of votes" text,
"Seats" real,
"Total seats" real
) | with shares of 45.3% and total seats less than 166. what is the greatest number of seat? | SELECT MAX("Seats") FROM table_51791 WHERE "Share of votes" = '45.3%' AND "Total seats" < '166' |
CREATE TABLE table_2342078_5 (
title VARCHAR,
written_by VARCHAR
) | What's the title of the episode written by Harry Winkler? | SELECT title FROM table_2342078_5 WHERE written_by = "Harry Winkler" |
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,
... | how many patients whose admission type is emergency and admission year is less than 2164? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2164" |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | What are the maximum and minimum population of the counties? | SELECT MAX(population), MIN(population) FROM county |
CREATE TABLE table_name_8 (
data_limit__gb VARCHAR,
company VARCHAR
) | What is the data limit for vodafone? | SELECT data_limit__gb FROM table_name_8 WHERE company = "vodafone" |
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 discharge location is short term hospital and procedure long title is intravenous infusion of clofarabine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Intravenous infusion of clofarabine" |
CREATE TABLE table_50146 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the most rebounds in the game against Chicago? | SELECT "High rebounds" FROM table_50146 WHERE "Team" = 'chicago' |
CREATE TABLE table_name_40 (
method VARCHAR,
time VARCHAR
) | What is Method, when Time is '3:20'? | SELECT method FROM table_name_40 WHERE time = "3:20" |
CREATE TABLE table_52276 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | What was the team that held the race title of Mallala? | SELECT "Team" FROM table_52276 WHERE "Race Title" = 'mallala' |
CREATE TABLE table_43791 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
) | Name the No. 5 which has a No. 8 of logan, and a No. 10 of ethan, and a No. 4 of jacob? | SELECT "No. 5" FROM table_43791 WHERE "No. 8" = 'logan' AND "No. 10" = 'ethan' AND "No. 4" = 'jacob' |
CREATE TABLE table_17288825_8 (
record VARCHAR,
score VARCHAR
) | Name the record for score of l 93 104 (ot) | SELECT record FROM table_17288825_8 WHERE score = "L 93–104 (OT)" |
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
)... | what number of hours has passed since patient 018-20179 was admitted to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '018-20179' AND patient.hospitaldischargetime IS NULL |
CREATE TABLE table_5968 (
"Round" real,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
) | What is NK Rijeka's away score in Round 2? | SELECT "Away" FROM table_5968 WHERE "Round" < '2' AND "Club" = 'nk rijeka' |
CREATE TABLE table_66449 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | Which platform was Red Dead Redemption for? | SELECT "Platform(s)" FROM table_66449 WHERE "Game" = 'red dead redemption' |
CREATE TABLE table_29572583_20 (
status VARCHAR,
seed VARCHAR
) | what is the status for seed 14 | SELECT status FROM table_29572583_20 WHERE seed = 14 |
CREATE TABLE table_203_809 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what is the number of ranked teams georgia played in 2006 ? | SELECT COUNT(*) FROM table_203_809 WHERE NOT "rank#" IS NULL |
CREATE TABLE table_4693 (
"Played" real,
"Lost" real,
"Drawn" real,
"Tries" real,
"Points" real,
"% Won" real
) | What is the number of tries for the player who is larger than 16? | SELECT SUM("Tries") FROM table_4693 WHERE "Played" > '16' |
CREATE TABLE table_2847477_2 (
pinyin VARCHAR,
english_name VARCHAR
) | What is the pinyin name for the english name xin county? | SELECT pinyin FROM table_2847477_2 WHERE english_name = "Xin County" |
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,
... | when was the last hospital admission time that patient 022-166510 was admitted through an acute care/floor until 4 years ago? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '022-166510' AND patient.hospitaladmitsource = 'acute care/floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patie... | the number of patients who have been admitted to hospital in 2102. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) = '2102' |
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... | Get the list of patients diagnosed with personal history of malignant neoplasm of bladder who have a prescription for base type drug. | 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 = "Hx of bladder malignancy" AND prescriptions.drug_type = "BASE" |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | Return a bar chart about the number of counties for all appellations?, and could you display in ascending by the Y? | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY COUNT(County) |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
... | What are the number of the last names for all scholarship students?, and show in ascending by the x-axis. | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY LName |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what is the total enteral tubefeed dose that patient 016-6134 had received until 03/22/2103? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6134')) AND intakeoutput.celllabel = 'entera... |
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 headquarter and the amount of headquarter , and group by attribute headquarter in a bar chart, I want to order total number in desc order. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) DESC |
CREATE TABLE table_40039 (
"Country" text,
"Local name" text,
"Host" text,
"Network" text,
"Date premiered" text
) | Which Local name has a Network of nova tv? | SELECT "Local name" FROM table_40039 WHERE "Network" = 'nova tv' |
CREATE TABLE table_name_88 (
losses INTEGER,
wins VARCHAR,
last_appearance VARCHAR
) | What is the highest Losses, when Wins is greater than 1, and when Last Appearance is 2003? | SELECT MAX(losses) FROM table_name_88 WHERE wins > 1 AND last_appearance = "2003" |
CREATE TABLE table_29540 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. No." real,
"Viewers (millions)" text
) | What is the production number for the episode called 'Random on Purpose'? | SELECT "Prod. No." FROM table_29540 WHERE "Title" = 'Random on Purpose' |
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 marital status is divorced and lab test name is lactate dehydrogenase (ld)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Lactate Dehydrogenase (LD)" |
CREATE TABLE table_8881 (
"Title" text,
"Writer" text,
"Doctor" text,
"Format" text,
"Company" text,
"release date" text
) | What is Release Date, when Title is Aladdin Time? | SELECT "release date" FROM table_8881 WHERE "Title" = 'aladdin time' |
CREATE TABLE table_name_97 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Tell me the time/retired for Laps larger than 63 and has a grid of 20 | SELECT time_retired FROM table_name_97 WHERE laps > 63 AND grid = 20 |
CREATE TABLE table_13482 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was the score that has a To par of 3, for Branden Grace? | SELECT "Score" FROM table_13482 WHERE "To par" = '−3' AND "Player" = 'branden grace' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | calculate the length of the hospital stay of patient 013-12480's first intensive care unit stay. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE finrev_fed_key_17 (
state_code number,
state text,
#_records text
)
CREATE TABLE ndecoreexcel_math_gr... | What are the top 10 states that have the highest average math score and federal revenue they got through different categories? | SELECT T2.state, SUM(c14), SUM(c25) FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY T3.average_scale_score DESC LIMIT 10 |
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... | Find Answers with Really low scores. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 2 AND LENGTH(Body) <= '##length##' AND Score <= '##Score##' ORDER BY Score |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | how many dose of tricor has been prescribed to patient 29741 in the first hospital encounter? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29741 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'tricor' |
CREATE TABLE table_51832 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | What was the notes of the 400 m event before 2004 with a position of 12th (h)? | SELECT "Notes" FROM table_51832 WHERE "Event" = '400 m' AND "Year" < '2004' AND "Position" = '12th (h)' |
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 vitalperiodi... | what is the name of the intake that patient 030-6441 last had on 08/31/last year? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-6441')) AND intakeoutput.cellpath LIKE '%intake%' AND DA... |
CREATE TABLE table_name_17 (
team__number1 VARCHAR,
res VARCHAR
) | What was the team #1 for the match that had a result of 0-3? | SELECT team__number1 FROM table_name_17 WHERE res = "0-3" |
CREATE TABLE table_28833 (
"Rnd" real,
"Circuit" text,
"Lites 1 Race One Winning Team" text,
"Lites 2 Race One Winning Team" text,
"Lites 1 Race Two Winning Team" text,
"Lites 2 Race Two Winning Team" text
) | On which circuit was the lites 1 race one winning team #66 Gunnar Racing? | SELECT "Circuit" FROM table_28833 WHERE "Lites 1 Race One Winning Team" = '#66 Gunnar Racing' |
CREATE TABLE table_65740 (
"Place" text,
"Code" real,
"Area (km 2 )" real,
"Population" real,
"Most spoken language" text
) | What's the place with an area of less than 2,198.72 and a code more than 90909? | SELECT "Place" FROM table_65740 WHERE "Area (km 2 )" < '2,198.72' AND "Code" > '90909' |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, and could you list the average of salary in desc order please? | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(SALARY) DESC |
CREATE TABLE table_name_72 (
driver VARCHAR,
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR,
points VARCHAR
) | Which Driver has a Grid smaller than 17, and Points larger than 0, and a Lapse of 87, and a Time/Retired of 1:48:11.023? | SELECT driver FROM table_name_72 WHERE grid < 17 AND points > 0 AND laps = 87 AND time_retired = "1:48:11.023" |
CREATE TABLE table_name_73 (
closed INTEGER,
city VARCHAR,
capacity VARCHAR
) | Tell me the sum of closed for city of pittsburgh and capacity larger than 59,000 | SELECT SUM(closed) FROM table_name_73 WHERE city = "pittsburgh" AND capacity > 59 OFFSET 000 |
CREATE TABLE table_204_847 (
id number,
"#" number,
"name" text,
"position" text,
"birthday" text,
"size" text,
"weight" text,
"last team" text
) | how many players were born after 1985 ? | SELECT COUNT("name") FROM table_204_847 WHERE "birthday" > 1985 |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
per... | What are the number of the completion dates of all the tests that have result 'Fail'?, display from low to high by the total number. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) |
CREATE TABLE table_name_43 (
date VARCHAR,
loss VARCHAR
) | What date was the loss of sparks (0 1)? | SELECT date FROM table_name_43 WHERE loss = "sparks (0–1)" |
CREATE TABLE table_4314 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | What School/Club Team has a Player named Juan Dixon and a Position of guard? | SELECT "School/Club Team" FROM table_4314 WHERE "Position" = 'guard' AND "Player" = 'juan dixon' |
CREATE TABLE table_name_55 (
branding VARCHAR,
owner VARCHAR,
frequency VARCHAR
) | what is the branding when the owner is jim pattison group and the frequency is fm 94.5? | SELECT branding FROM table_name_55 WHERE owner = "jim pattison group" AND frequency = "fm 94.5" |
CREATE TABLE table_12665 (
"Year(s)" real,
"Final television commentator" text,
"Radio commentator" text,
"Spokesperson" text,
"Semi-final television commentator" text,
"Semi-final second television commentator" text
) | Who is the spokesperson after 2012? | SELECT "Spokesperson" FROM table_12665 WHERE "Year(s)" > '2012' |
CREATE TABLE table_71203 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Pos." text,
"Class Pos." text
) | What was the final position of Arena Motorsports International? | SELECT "Pos." FROM table_71203 WHERE "Team" = 'arena motorsports international' |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Addr... | What are the number of the names of the workshop groups that have bookings with status code 'stop'? | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name |
CREATE TABLE table_12145 (
"Year" real,
"Title" text,
"Format/genre" text,
"Role" text,
"Staged by" text
) | What is the role in an original play, comedy in 1938? | SELECT "Role" FROM table_12145 WHERE "Format/genre" = 'original play, comedy' AND "Year" = '1938' |
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_labitems (
row_id number,
itemid number,
label te... | how much has patient 27703's change of weight last measured on the first hospital visit compared to the first value measured on the first hospital visit? | SELECT (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 = 27703 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal bool... | High Standards - Top 100 Users that rarely upvote.. Top 100 Users that rarely upvote in comparison to the
estimated amount of upvotes they received (doesn't account
for e.g. bounties but should give a sufficient estimation).
Useful settings (MinRep, MinUpvotes): (1000, 100), (10000, 0). | SELECT Posts.Id, Body, TagId, TagName FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE TagName IN ('javascript', 'jquery', 'java', 'c#') ORDER BY Posts.Id LIMIT 1000 |
CREATE TABLE table_23286223_5 (
date VARCHAR,
high_assists VARCHAR
) | When was the game in which Deron Williams (13) did the high assists played? | SELECT date FROM table_23286223_5 WHERE high_assists = "Deron Williams (13)" |
CREATE TABLE table_72034 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score of the game against the Royals when the record was 24 52? | SELECT "Score" FROM table_72034 WHERE "Opponent" = 'royals' AND "Record" = '24–52' |
CREATE TABLE table_name_79 (
rank INTEGER,
year VARCHAR,
accolade VARCHAR
) | What was the lowest rank after 2009 with an accolade of 125 best albums of the past 25 years? | SELECT MIN(rank) FROM table_name_79 WHERE year > 2009 AND accolade = "125 best albums of the past 25 years" |
CREATE TABLE table_37095 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the fewest losses associated with more than 13 points and fewer than 8 games? | SELECT MIN("Lost") FROM table_37095 WHERE "Points" > '13' AND "Games" < '8' |
CREATE TABLE table_39969 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | On what date was the opponent Ayr United, the result 1 0, and the attendance more than 668? | SELECT "Date" FROM table_39969 WHERE "Result" = '1–0' AND "Attendance" > '668' AND "Opponent" = 'ayr united' |
CREATE TABLE table_61146 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the total number of Wins, when Losses is '6', and when Draws is greater than '0'? | SELECT COUNT("Wins") FROM table_61146 WHERE "Losses" = '6' AND "Draws" > '0' |
CREATE TABLE table_203_405 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | how many times were the dallas cowboys listed as an opponent ? | SELECT COUNT(*) FROM table_203_405 WHERE "opponent" = 'dallas cowboys' |
CREATE TABLE table_52411 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the number played for the Barcelona B club, with wins under 11? | SELECT SUM("Played") FROM table_52411 WHERE "Club" = 'barcelona b' AND "Wins" < '11' |
CREATE TABLE table_name_28 (
trans_1 VARCHAR,
total_time VARCHAR
) | How long did the trans 1 take when 2:00:40.20 is the total time? | SELECT trans_1 FROM table_name_28 WHERE total_time = "2:00:40.20" |
CREATE TABLE table_44143 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"2012 club" text
) | What is the 2012 club of the cf pos. player? | SELECT "2012 club" FROM table_44143 WHERE "Pos." = 'cf' |
CREATE TABLE table_name_66 (
week INTEGER,
date VARCHAR
) | What is the highest Week, when Date is 'November 8, 1970'? | SELECT MAX(week) FROM table_name_66 WHERE date = "november 8, 1970" |
CREATE TABLE table_78017 (
"Rank" real,
"Player" text,
"Club" text,
"Country" text,
"Titles" real,
"Seasons" text
) | What player is ranked 2 and played in the seasons of 1982 83, 1983 84, 1984 85? | SELECT "Player" FROM table_78017 WHERE "Rank" = '2' AND "Seasons" = '1982–83, 1983–84, 1984–85' |
CREATE TABLE table_name_69 (
award VARCHAR,
category VARCHAR
) | Which award has the category of the best direction of a musical? | SELECT award FROM table_name_69 WHERE category = "best direction of a musical" |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,... | list all the flights that depart from MKE | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'MKE' AND flight.from_airport = airport.airport_code |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | How many musicals has each nominee been nominated for Plot them as bar chart, show in asc by the total number. | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) |
CREATE TABLE procedures (
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
)
... | what is admission time of subject id 2560? | SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "2560" |
CREATE TABLE nomination (
artwork_id number,
festival_id number,
result text
)
CREATE TABLE festival_detail (
festival_id number,
festival_name text,
chair_name text,
location text,
year number,
num_of_audience number
)
CREATE TABLE artwork (
artwork_id number,
type text,
... | List the name of artworks that are not nominated. | SELECT name FROM artwork WHERE NOT artwork_id IN (SELECT artwork_id FROM nomination) |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Among patients admitted before the year 2123, how many of them had a blood gas test by lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2123" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE table_name_6 (
tournament VARCHAR
) | What is the 2012 value with a 1r in 2011 in the Australian Open? | SELECT 2012 FROM table_name_6 WHERE 2011 = "1r" AND tournament = "australian open" |
CREATE TABLE table_name_32 (
home_team VARCHAR,
result VARCHAR
) | Who was the home team with a result of 105-99? | SELECT home_team FROM table_name_32 WHERE result = "105-99" |
CREATE TABLE table_597 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | WHat is the number for the player whose height is 2.01? | SELECT COUNT("Player") FROM table_597 WHERE "Height" = '2.01' |
CREATE TABLE table_10803 (
"Episode" real,
"Title" text,
"Airdate" text,
"Rating" real,
"Share" real,
"18-49" real,
"Viewers" real,
"Rank" text
) | Of all shows who have a rating larger than 7.8, aired on October 26, 2006, and has a share of over 14, what is the sum of the viewers? | SELECT SUM("Viewers") FROM table_10803 WHERE "Rating" > '7.8' AND "Airdate" = 'october 26, 2006' AND "Share" > '14' |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | List UI5 related questions for a user. | SELECT Title, Posts.CreationDate, AcceptedAnswerId, Tags, Posts.Id AS "post_link" FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE PostTypeId = 1 AND DisplayName = '##Username:string##' AND TagName = '##Tagnam... |
CREATE TABLE table_name_47 (
wins INTEGER,
year INTEGER
) | What is the sum of wins after 1999? | SELECT SUM(wins) FROM table_name_47 WHERE year > 1999 |
CREATE TABLE table_30795 (
"Player" text,
"Matches" real,
"Innings" real,
"Wickets" real,
"Average" text,
"BBI" text,
"BBM" text,
"5wi" real,
"10wi" real
) | how many innings have an average of 19.60? | SELECT "Innings" FROM table_30795 WHERE "Average" = '19.60' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | how many patients were given analgesics - continuous parenteral analgesics until 2103? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'analgesics - continuous parenteral analgesics' AND STRFTIME('%y', treatment.treatmenttime) <= '2103') |
CREATE TABLE table_30938 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Date" text
) | How many home teams are there when the away team score was 4.2 (26) and away team was footscray? | SELECT COUNT("Home team score") FROM table_30938 WHERE "Away team score" = '4.2 (26)' AND "Away team" = 'Footscray' |
CREATE TABLE table_47729 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | Which Date has an Attendance larger than 1,858? | SELECT "Date" FROM table_47729 WHERE "Attendance" > '1,858' |
CREATE TABLE table_203_192 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | david oliver has come in 3rd place in how many competitions ? | SELECT COUNT("competition") FROM table_203_192 WHERE "position" = 3 |
CREATE TABLE table_71219 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | With Round 3 and Pick # over 10, what is the higher Overall number? | SELECT MAX("Overall") FROM table_71219 WHERE "Round" = '3' AND "Pick #" > '10' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.