table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_96 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
) | How many grids have more than 24 laps with a time/retired of +1:12.208? | SELECT SUM(grid) FROM table_name_96 WHERE time_retired = "+1:12.208" AND laps > 24 |
CREATE TABLE table_55822 (
"Class" text,
"Operator" text,
"Number" real,
"Year Built" text,
"Cars per Set" real,
"Unit Numbers." text
) | What year was the class 253 larger than 18 built? | SELECT "Year Built" FROM table_55822 WHERE "Class" = 'class 253' AND "Number" > '18' |
CREATE TABLE table_26993 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | Name the team for 22 points | SELECT "Team" FROM table_26993 WHERE "Points" = '22' |
CREATE TABLE submission (
Author VARCHAR,
Scores VARCHAR
) | List the authors of submissions in ascending order of scores. | SELECT Author FROM submission ORDER BY Scores |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | show me the flights from BALTIMORE to OAKLAND | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKL... |
CREATE TABLE table_59433 (
"Mark" text,
"Wind*" text,
"Athlete" text,
"Nationality" text,
"Venue" text,
"Date" text
) | What is the mark from April 2, 1994 with a wind number of 2.0? | SELECT "Mark" FROM table_59433 WHERE "Wind*" = '2.0' AND "Date" = 'april 2, 1994' |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | TensorFlow: number of answerers over time. | SELECT a.OwnerUserId, MIN(a.CreationDate), ROW_NUMBER() OVER (ORDER BY MIN(a.CreationDate)) AS AnswerCount FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.Tags LIKE '%<tensorflow>%' GROUP BY a.OwnerUserId ORDER BY MIN(a.CreationDate) |
CREATE TABLE table_57791 (
"Name" text,
"Power" text,
"Torque" text,
"Size" text,
"Engine code" text,
"0\u2013100km/h,s" real,
"Top speed" text,
"Years" text
) | What is the power of the engine with an engine code m44b19? | SELECT "Power" FROM table_57791 WHERE "Engine code" = 'm44b19' |
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... | how many patients aged below 50 years had the lab test category as blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | All comments on this post. | SELECT * FROM Comments WHERE PostId = 7445597 ORDER BY CreationDate |
CREATE TABLE table_22297140_3 (
outgoing_manager VARCHAR,
replaced_by VARCHAR
) | Which outgoing manager was replaced by Jafar Fatahi? | SELECT outgoing_manager FROM table_22297140_3 WHERE replaced_by = "Jafar Fatahi" |
CREATE TABLE table_name_59 (
others__number VARCHAR,
bush__percentage VARCHAR
) | What was the other number with 63.98% bush? | SELECT others__number FROM table_name_59 WHERE bush__percentage = "63.98%" |
CREATE TABLE table_name_69 (
acceleration_0_100km_h__0_62mph_ VARCHAR,
transmission VARCHAR
) | What is the acceleration 0 100km/h (0 62mph) when the transmission is 5-speed manual? | SELECT acceleration_0_100km_h__0_62mph_ FROM table_name_69 WHERE transmission = "5-speed manual" |
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 lab (
la... | when was the last time that patient 002-4486 on 08/05/this year had a maximum sao2. | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND NOT vitalperiodic.sao2 IS NULL AND ... |
CREATE TABLE table_41155 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which Position has a Played larger than 9, and a Points smaller than 11, and a Drawn smaller than 0? | SELECT MIN("Position") FROM table_41155 WHERE "Played" > '9' AND "Points" < '11' AND "Drawn" < '0' |
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 the total number of patients admitted to emergency who have received additive therapy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug_type = "ADDITIVE" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what is diagnoses short title and diagnoses long title of subject id 18351? | SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18351" |
CREATE TABLE table_name_84 (
time VARCHAR,
lane VARCHAR,
nationality VARCHAR
) | Spain had what time with lanes smaller than 4? | SELECT time FROM table_name_84 WHERE lane < 4 AND nationality = "spain" |
CREATE TABLE table_name_52 (
manufacturer VARCHAR,
laps VARCHAR,
time_retired VARCHAR
) | Which manufacturer has 23 laps and a time of +45.195? | SELECT manufacturer FROM table_name_52 WHERE laps = 23 AND time_retired = "+45.195" |
CREATE TABLE table_31477 (
"Round" real,
"Circuit" text,
"Date" text,
"Length" text,
"Pole Position" text,
"GT3 Winner" text,
"GT4 Winner" text
) | When charles bateman michael lyons is the gt3 winner and donington park is the circuit who is the gt4 winner? | SELECT "GT4 Winner" FROM table_31477 WHERE "Circuit" = 'Donington Park' AND "GT3 Winner" = 'Charles Bateman Michael Lyons' |
CREATE TABLE table_name_23 (
overall INTEGER,
college VARCHAR,
round VARCHAR
) | What is the average overall pick number for the USF player who was picked after round 5? | SELECT AVG(overall) FROM table_name_23 WHERE college = "usf" AND round > 5 |
CREATE TABLE table_60396 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Seve Ballesteros's score? | SELECT "Score" FROM table_60396 WHERE "Player" = 'seve ballesteros' |
CREATE TABLE table_12226390_2 (
directed_by VARCHAR,
production_code VARCHAR
) | Who directed the episode with production code 28? | SELECT directed_by FROM table_12226390_2 WHERE production_code = 28 |
CREATE TABLE table_33346 (
"Translator Call Letters" text,
"B Mountain Channel" text,
"Laurel Mountain Channel" text,
"PSIP" text,
"Station Call Letters" text,
"Network Affiliation ID" text,
"Original Channel" text,
"Signal Quality" text
) | What signal quality does the KCAL-DT channel have? | SELECT "Signal Quality" FROM table_33346 WHERE "Station Call Letters" = 'kcal-dt' |
CREATE TABLE table_51560 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
) | What date had a 4ad label and a CD (reissue) format? | SELECT "Date" FROM table_51560 WHERE "Label" = '4ad' AND "Format" = 'cd (reissue)' |
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
) | How many different captain ranks are there? | SELECT COUNT(DISTINCT rank) FROM captain |
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
) | Return a histogram on what are the names and prices of all products in the store?, show bars in desc order please. | SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name DESC |
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,
... | during the last hospital encounter, had patient 006-40255 had any allergies? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-40255' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... |
CREATE TABLE table_name_60 (
Id VARCHAR
) | What is the average for 2009 when 2001 is more than 0, 1996 is less than 1 and 2004 is more than 2 | SELECT AVG(2009) FROM table_name_60 WHERE 2001 > 0 AND 1996 < 1 AND 2004 > 2 |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | when did patient 010-16572 last have a maximum value of systemicsystolic during yesterday? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16572')) AND NOT vitalperiodic.systemicsystolic... |
CREATE TABLE table_dev_39 (
"id" int,
"gender" string,
"random_serum_glucose" int,
"glycated_hemoglobin" bool,
"heart_disease" bool,
"stroke" bool,
"diabetes_mellitus" bool,
"hgba1c" float,
"diabetic" string,
"fasting_blood_glucose_fbg" float,
"fasting_plasma_glucose" int,
... | history of type i or type ii diabetes, or fasting plasma glucose > 126 mg / dl | SELECT * FROM table_dev_39 WHERE diabetic = 'i' OR diabetic = 'ii' OR fasting_plasma_glucose > 126 |
CREATE TABLE Movie (
director VARCHAR,
title VARCHAR
) | For directors who had more than one movie, return the titles and produced years of all movies directed by them. | SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title |
CREATE TABLE table_61333 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was jerry bohlander's time? | SELECT "Time" FROM table_61333 WHERE "Opponent" = 'jerry bohlander' |
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,
... | count the number of patients whose gender is m and primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" |
CREATE TABLE table_11545282_6 (
years_for_jazz VARCHAR,
school_club_team VARCHAR
) | For how many players from UTEP can one calculate how many years they've played for Jazz? | SELECT COUNT(years_for_jazz) FROM table_11545282_6 WHERE school_club_team = "UTEP" |
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,
... | until 3 years ago, how many patients with atrial fibrillation were diagnosed within 2 months after being diagnosed with encephalopathy - metabolic? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrillation' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOI... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | count the number of patients whose marital status is married and gender is m? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.gender = "M" |
CREATE TABLE table_25116 (
"Player" text,
"Nat" text,
"Pos" text,
"L Apps" real,
"L G" real,
"C Apps" real,
"C G" real,
"Total Apps" real,
"Total G" real
) | Name the least total apps for jaime | SELECT MIN("Total Apps") FROM table_25116 WHERE "Player" = 'Jaime' |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number... | Users whose first several questions were upvoted. | WITH EarlyPosts AS (SELECT OwnerUserId, Id, Score, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY CreationDate) AS Row FROM Posts WHERE Posts.PostTypeId = 2) SELECT OwnerUserId AS "user_link", SUM(Score) AS EarlyScore FROM EarlyPosts WHERE Row <= 10 GROUP BY OwnerUserId ORDER BY EarlyScore DESC |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For all employees who have the letters D or S in their first name, show me the trend about employee_id over hire_date with a line chart, and list in desc by the x axis please. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC |
CREATE TABLE table_23385853_20 (
power_stage_wins VARCHAR,
wins VARCHAR
) | What is the power stage wins total number if the wins is 10? | SELECT COUNT(power_stage_wins) FROM table_23385853_20 WHERE wins = 10 |
CREATE TABLE table_name_19 (
location VARCHAR,
method VARCHAR,
opponent VARCHAR
) | What is the location of the match where the method was submission (armbar) and Mayra Conde was the opponent? | SELECT location FROM table_name_19 WHERE method = "submission (armbar)" AND opponent = "mayra conde" |
CREATE TABLE table_32125 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the smallest number of wins for the Totals Tournament with a Top-25 value greater than 3? | SELECT MIN("Wins") FROM table_32125 WHERE "Tournament" = 'totals' AND "Top-25" > '3' |
CREATE TABLE table_29565541_2 (
pa VARCHAR,
w VARCHAR
) | When 6 is the w what is the pa? | SELECT pa FROM table_29565541_2 WHERE w = 6 |
CREATE TABLE table_35152 (
"Season" text,
"Record" text,
"Pct." real,
"Games" real,
"Attendance" real,
"Average" real,
"Sellouts" real
) | How many attendance numbers had more than 15 games, and sellouts of more than 8 in the 2011-12 season? | SELECT COUNT("Attendance") FROM table_35152 WHERE "Games" > '15' AND "Sellouts" > '8' AND "Season" = '2011-12' |
CREATE TABLE table_name_10 (
saves INTEGER,
save__percentage VARCHAR,
goals_against VARCHAR
) | How many saves did the player with a 92.3% save rate and 217 goals have? | SELECT SUM(saves) FROM table_name_10 WHERE save__percentage = "92.3%" AND goals_against > 217 |
CREATE TABLE table_27637 (
"Series #" real,
"Title" text,
"Director" text,
"Writer" text,
"Air Date" text,
"Production Code" real
) | What was the production code of the episode written by Brendan Cowell? | SELECT "Production Code" FROM table_27637 WHERE "Writer" = 'Brendan Cowell' |
CREATE TABLE table_name_44 (
record VARCHAR,
date VARCHAR
) | What was the record after the January 6 game? | SELECT record FROM table_name_44 WHERE date = "january 6" |
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,
... | IS LING 997 a course offered during the next semester ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LING' AND course.number = 997 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
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... | How many office admission patients have a rdw lab test done? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.label = "RDW" |
CREATE TABLE table_name_79 (
captain VARCHAR,
shirt_sponsor VARCHAR
) | One2one is the shirt sponsor for the captain of what team? | SELECT captain FROM table_name_79 WHERE shirt_sponsor = "one2one" |
CREATE TABLE table_name_72 (
race_title VARCHAR,
circuit VARCHAR
) | What was the title of the race at Oran Park Raceway? | SELECT race_title FROM table_name_72 WHERE circuit = "oran park raceway" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions... | when was patient 73423 for the first time prescribed a drug via po/ng route until 63 months ago? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73423) AND prescriptions.route = 'po/ng' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-63 month') ORDER BY prescriptions.startdate LIMIT 1 |
CREATE TABLE table_2093 (
"Season" text,
"Final Venue" text,
"Champion" text,
"Result" text,
"Finalist" text,
"MVP" text
) | Who was the finalist in the season 2007-08? | SELECT "Finalist" FROM table_2093 WHERE "Season" = '2007-08' |
CREATE TABLE table_204_379 (
id number,
"year" text,
"title" text,
"hangul" text,
"network" text,
"further info" text
) | what was the show previous to music bank in 2009 | SELECT "title" FROM table_204_379 WHERE id = (SELECT id FROM table_204_379 WHERE "title" = 'music bank') - 1 |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABL... | Are 381 and 328 over by 5:00 each day ? | SELECT COUNT(*) = 0 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.number = 381 OR course.number = 328) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ... |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHA... | Create a pie chart showing how many card type code across card type code. | SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code |
CREATE TABLE table_203_52 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | who earned the top amount of points ? | SELECT "driver" FROM table_203_52 ORDER BY "points" DESC LIMIT 1 |
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 time that patient 006-161415 had a maximum heartrate on the first icu visit. | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415') AND NOT patient.unitdischargetime IS N... |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
Revision... | Recently deleted questions (with tags). | SELECT url = 'site://q/' + CAST(Id AS TEXT), DeletionDate, Score, Tags FROM Posts WHERE (PostTypeId = 1) AND (NOT DeletionDate IS NULL) ORDER BY DeletionDate DESC LIMIT 100 |
CREATE TABLE table_name_14 (
year_built__converted VARCHAR,
_ VARCHAR,
no_built__converted VARCHAR
) | Tell me the year built for number built of 10 | SELECT year_built__converted * _ FROM table_name_14 WHERE no_built__converted * _ = "10" |
CREATE TABLE table_name_36 (
height VARCHAR,
players VARCHAR
) | How tall is Ye Fei? | SELECT height FROM table_name_36 WHERE players = "ye fei" |
CREATE TABLE table_name_91 (
surface VARCHAR,
date VARCHAR
) | What was the surface for the May 10, 2009 tournament? | SELECT surface FROM table_name_91 WHERE date = "may 10, 2009" |
CREATE TABLE table_name_31 (
wins INTEGER,
byes INTEGER
) | What is the average of wins when the byes are less than 0? | SELECT AVG(wins) FROM table_name_31 WHERE byes < 0 |
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 CloseReasonTypes (
Id number,
Name text,
Description... | Find tags with no excerpts ('definitions'). | SELECT Count, ('site://tags/' + TagName + '|' + TagName) AS TagName, ExcerptPostId AS "post_link", WikiPostId AS "post_link" FROM Tags AS t LEFT JOIN Posts AS p ON p.Id = t.ExcerptPostId WHERE NOT (ExcerptPostId IS NULL) AND LENGTH(Body) > 0 ORDER BY Count DESC |
CREATE TABLE table_name_91 (
score VARCHAR,
home_team VARCHAR
) | What is the score when york city was the home team? | SELECT score FROM table_name_91 WHERE home_team = "york city" |
CREATE TABLE table_203_729 (
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 a population above 50 ? | SELECT COUNT("township") FROM table_203_729 WHERE "population" > 50 |
CREATE TABLE table_2921 (
"Song 1 title" text,
"Artist 1" text,
"Song 2 title" text,
"Artist 2" text,
"Mix artist" text,
"Guitar part?" text,
"Mix pack" text,
"Release date" text
) | If artist 1 is Wolfgang Gartner, what is the release date? | SELECT "Release date" FROM table_2921 WHERE "Artist 1" = 'Wolfgang Gartner' |
CREATE TABLE table_68998 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Name the highest roll for coed and authority of state integrated with sacred heart school | SELECT MAX("Roll") FROM table_68998 WHERE "Gender" = 'coed' AND "Authority" = 'state integrated' AND "Name" = 'sacred heart school' |
CREATE TABLE table_56838 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | What construction has a CERCLIS ID of ard092916188? | SELECT "Construction completed" FROM table_56838 WHERE "CERCLIS ID" = 'ard092916188' |
CREATE TABLE table_name_7 (
college_junior_club_team__league_ VARCHAR,
player VARCHAR,
round VARCHAR,
position VARCHAR
) | What is the college/junior/club team (league) of lw position player mark miller, from a round greater than 4? | SELECT college_junior_club_team__league_ FROM table_name_7 WHERE round > 4 AND position = "lw" AND player = "mark miller" |
CREATE TABLE table_6865 (
"Number on map" real,
"Name" text,
"Colour" text,
"Construction commenced" real,
"Population" real
) | What is the lowest population for the neighborhood with the color blue that commenced its construction before 1987? | SELECT MIN("Population") FROM table_6865 WHERE "Colour" = 'blue' AND "Construction commenced" < '1987' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many female patients have been diagnosed with unspecified constipation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Constipation NOS" |
CREATE TABLE table_44574 (
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"City" text
) | WHAT IS THE LEAD WITH THIRD AS TARA GEORGE? | SELECT "Lead" FROM table_44574 WHERE "Third" = 'tara george' |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
catego... | Is there a DUTCH 512 class on Friday ? | SELECT DISTINCT course_offering.friday 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 = 'DUTCH' AND course.number = 512 AND semester.semester = 'WN' AND semester.year = 2016 |
CREATE TABLE table_2293402_2 (
location VARCHAR,
founded VARCHAR
) | Name the location that was founded 1798 | SELECT location FROM table_2293402_2 WHERE founded = 1798 |
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 cost (
costid num... | until 1 year ago, patient 032-14800 was diagnosed for the first time with what? | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-14800')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CU... |
CREATE TABLE table_204_392 (
id number,
"#" number,
"stadium" text,
"capacity" number,
"city" text,
"country" text,
"domed or retractable roof" text
) | which stadium has the highest capacity ? | SELECT "stadium" FROM table_204_392 ORDER BY "capacity" DESC LIMIT 1 |
CREATE TABLE table_67908 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What is the 2013 value with a qf in 2011? | SELECT "2013" FROM table_67908 WHERE "2011" = 'qf' |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | Show the type of school and the number of buses for each type by a pie chart. | SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is the number of patients whose days of hospital stay is greater than 4 and diagnoses icd9 code is 45821? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "4" AND diagnoses.icd9_code = "45821" |
CREATE TABLE table_name_35 (
awards VARCHAR,
year VARCHAR,
competition VARCHAR
) | What award was in the year after 2009 with a competition of Digi Wwwow Awards? | SELECT awards FROM table_name_35 WHERE year > 2009 AND competition = "digi wwwow awards" |
CREATE TABLE table_27110 (
"Name" text,
"Nationality" text,
"Position" text,
"Appearances" real,
"Starts" real,
"Minutes" real,
"Goals" real,
"Assists" real
) | What was the lowest goals ever achieved? | SELECT MIN("Goals") FROM table_27110 |
CREATE TABLE table_204_158 (
id number,
"official name" text,
"designation" text,
"area km2" number,
"population" number,
"parish" text
) | which city has the largest population ? | SELECT "official name" FROM table_204_158 ORDER BY "population" DESC LIMIT 1 |
CREATE TABLE table_name_87 (
_number_100 INTEGER,
season VARCHAR,
against VARCHAR
) | Which # 100 has a Season of 1991, and an Against of surrey? | SELECT MAX(_number_100) FROM table_name_87 WHERE season = "1991" AND against = "surrey" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | tell me the organism that was detected in the last sputum, tracheal specimen test of patient 031-9128 on the last hospital encounter? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... |
CREATE TABLE table_18274425_1 (
directed_by VARCHAR,
written_by VARCHAR
) | Who were the director/s of episodes written by Mike Daniels? | SELECT directed_by FROM table_18274425_1 WHERE written_by = "Mike Daniels" |
CREATE TABLE table_name_62 (
losing_bonus VARCHAR,
points_against VARCHAR
) | What Losing bonus has a Points against of 588? | SELECT losing_bonus FROM table_name_62 WHERE points_against = "588" |
CREATE TABLE table_29848 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the score for miami | SELECT "Score" FROM table_29848 WHERE "Team" = 'Miami' |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (... | Draw a bar chart for how many sections does each course have?, show in asc by the y axis. | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) |
CREATE TABLE table_19072602_2 (
match_no VARCHAR,
team_europe VARCHAR
) | How many match numbers have team europe listed as osku palermaa? | SELECT COUNT(match_no) FROM table_19072602_2 WHERE team_europe = "Osku Palermaa" |
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE region (
region_id number,
region_name text,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE member (
member_i... | Count the number of Annual Meeting events that took place in the region of the United Kingdom. | SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.event_name = "Annaual Meeting" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | is the heart rate of patient 18159 was normal this month. | 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 = 18159)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d... |
CREATE TABLE table_22834834_12 (
year INTEGER
) | What is the latest year that data is available for? | SELECT MAX(year) FROM table_22834834_12 |
CREATE TABLE table_16976547_2 (
finish VARCHAR,
eliminated VARCHAR
) | Name the finish for patani | SELECT finish FROM table_16976547_2 WHERE eliminated = "Patani" |
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... | Total tag score vs no. of answers in tag for a given user. Returns a distribution, for a given user and over all the tags that user has answered, of the users' total score on that tag (horizontal axis) versus the total number of answers they've written (vertical axis). | SELECT answers.Score AS Score, COUNT(answers.Id) AS TotalAnswers FROM Posts AS questions INNER JOIN Posts AS answers ON answers.ParentId = Questions.Id WHERE answers.OwnerUserId = '##userId##' AND questions.CommunityOwnedDate IS NULL AND answers.CreationDate BETWEEN @StartDate AND @EndDate GROUP BY answers.Score ORDER ... |
CREATE TABLE table_71883 (
"Date" text,
"Visiting team" text,
"Final score" text,
"Host team" text,
"Stadium" text
) | What is the Stadium held on november 29? | SELECT "Stadium" FROM table_71883 WHERE "Date" = 'november 29' |
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 allergy (
allergy... | how many patients underwent mri - head within 2 months after they had been diagnosed with sepsis - sepsis with multi-organ dysfunction, in this year? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis - sepsis with multi-organ dysfunction' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATET... |
CREATE TABLE table_27723228_11 (
location_attendance VARCHAR,
team VARCHAR
) | What was the location and attendance of the game against Dallas? | SELECT location_attendance FROM table_27723228_11 WHERE team = "Dallas" |
CREATE TABLE table_157826_1 (
county VARCHAR,
city_town VARCHAR
) | In which county is the city/town of Halden located? | SELECT county FROM table_157826_1 WHERE city_town = "Halden" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.