table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_46 (
laps INTEGER,
year VARCHAR
) | How many Laps were there in 2010? | SELECT SUM(laps) FROM table_name_46 WHERE year = 2010 |
CREATE TABLE table_name_54 (
husband_dates VARCHAR,
date_married VARCHAR
) | Who was the husband date that was married in 1858? | SELECT husband_dates FROM table_name_54 WHERE date_married = "1858" |
CREATE TABLE table_65892 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | Which FA Cup Goals have League Cup Apps larger than 0, and a Name of trevor cherry? | SELECT MAX("FA Cup Goals") FROM table_65892 WHERE "League Cup Apps" > '0' AND "Name" = 'trevor cherry' |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,... | Get Posts and Upvotes for Last X days. This query takes in a given integer X and returns all posts from the last X days as well as the votes on each of those posts. | SELECT COUNT(DISTINCT Posts.Id) FROM Posts WHERE Posts.CreationDate >= CURRENT_TIMESTAMP() - @numDays |
CREATE TABLE table_48102 (
"Class" text,
"Team" text,
"Driver" text,
"Chassis \u2013 Engine" text,
"Laps" real
) | What is the class of team liqui moly equipe, which has less than 71 laps? | SELECT "Class" FROM table_48102 WHERE "Laps" < '71' AND "Team" = 'liqui moly equipe' |
CREATE TABLE table_23060 (
"Team" text,
"Division Titles" real,
"Playoff Berths" real,
"AFL Titles" real,
"AFC Championships" real,
"Super Bowl Championships" real
) | If the playoff berth is 17, what is the AFC championship number? | SELECT "AFC Championships" FROM table_23060 WHERE "Playoff Berths" = '17' |
CREATE TABLE table_11254821_2 (
finishing_position VARCHAR,
points_awarded__platinum_ VARCHAR
) | What was the range of finishing position for 15 awarded platinum points? | SELECT finishing_position FROM table_11254821_2 WHERE points_awarded__platinum_ = 15 |
CREATE TABLE table_70615 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the attendance number for December 2, 1979? | SELECT SUM("Attendance") FROM table_70615 WHERE "Date" = 'december 2, 1979' |
CREATE TABLE table_name_54 (
shuttle_run__sec_ VARCHAR,
points VARCHAR
) | How many seconds is a shuttle run that give 2 points? | SELECT shuttle_run__sec_ FROM table_name_54 WHERE points = 2 |
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... | Questions Using Popular Tags In January 2019. Questions Using Popular Tags In January 2019
Tags with rate of use over 4 times on this site. | SELECT Id AS "post_link", Id, CreationDate, AnswerCount, CommentCount, rate.TagId FROM Posts, PostTags, (SELECT COUNT(PostId) AS Rate, TagId FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2019-03-01' AND Posts.CreationDate > '2019-01-01' GROUP BY TagId, TagName... |
CREATE TABLE table_name_13 (
place VARCHAR,
score VARCHAR
) | In what place is the player with a score of 72-66-75=213? | SELECT place FROM table_name_13 WHERE score = 72 - 66 - 75 = 213 |
CREATE TABLE table_38827 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the location attendance of the game with a 27-22 record? | SELECT "Location Attendance" FROM table_38827 WHERE "Record" = '27-22' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | how many patients are admitted under urgency and followed the procedure colonoscopy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Colonoscopy" |
CREATE TABLE table_name_32 (
assists INTEGER,
club VARCHAR,
points VARCHAR
) | What is the amount of assists for richmond kickers and points larger than 24 | SELECT SUM(assists) FROM table_name_32 WHERE club = "richmond kickers" AND points > 24 |
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... | what was the four most often given procedures for patients 40s? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 |
CREATE TABLE table_name_27 (
republican VARCHAR,
green VARCHAR
) | Who was the Republican when the green was Harold Burbank? | SELECT republican FROM table_name_27 WHERE green = "harold burbank" |
CREATE TABLE table_name_55 (
score VARCHAR,
date VARCHAR
) | What is the score March 27? | SELECT score FROM table_name_55 WHERE date = "march 27" |
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... | Top 10 Meta users from Nigeria. | SELECT * FROM Users WHERE Location LIKE '%Nigeria' ORDER BY Reputation DESC LIMIT 10 |
CREATE TABLE table_name_50 (
points_for VARCHAR,
club VARCHAR
) | How many pints does the Cambrian Welfare RFC have? | SELECT points_for FROM table_name_50 WHERE club = "cambrian welfare rfc" |
CREATE TABLE table_6115 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Queen" text,
"Ceased to be Queen" text,
"Death" text,
"Spouse" text
) | How is the marriage of who became queen on 30 October 1816 husband's accession? | SELECT "Marriage" FROM table_6115 WHERE "Became Queen" = '30 october 1816 husband''s accession' |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code text,
phone t... | How many customers live in Prague city? | SELECT COUNT(*) FROM customers WHERE city = "Prague" |
CREATE TABLE table_23730973_5 (
rating VARCHAR,
viewers__millions_ VARCHAR
) | What was the rating/share for 18-49 for the episode that had 5.90 million viewers? | SELECT rating / SHARE(18 - 49) FROM table_23730973_5 WHERE viewers__millions_ = "5.90" |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Return a bar chart on what are the different ship flags, and how many ships have each?, list by the Y-axis in descending. | SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY COUNT(*) DESC |
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,
... | provide the admission time and marital status of subject id 6983. | SELECT demographic.marital_status, demographic.admittime FROM demographic WHERE demographic.subject_id = "6983" |
CREATE TABLE table_44036 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which format has january 21, 2002 as the date? | SELECT "Format" FROM table_44036 WHERE "Date" = 'january 21, 2002' |
CREATE TABLE table_34127 (
"Name" text,
"Number of sequences Number of sequences: ." text,
"Alignment Alignment: predicts an alignment , ." text,
"Structure Structure: predicts structure , ." text,
"Link" text
) | What is the link of rnaz that predicts an alignment of input? | SELECT "Link" FROM table_34127 WHERE "Alignment Alignment: predicts an alignment , ." = 'input' AND "Name" = 'rnaz' |
CREATE TABLE table_59962 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8" text,
"Week 9" text,
"Week 10 FINAL" text
) | What kind of Week 4 has a Week 9 of all housemates? | SELECT "Week 4" FROM table_59962 WHERE "Week 9" = 'all housemates' |
CREATE TABLE table_7726 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
) | What was the transfer fee for the player moving in the winter window and ending in a year after 2010? | SELECT "Transfer fee" FROM table_7726 WHERE "Ends" > '2010' AND "Transfer window" = 'winter' |
CREATE TABLE table_67776 (
"Year" real,
"Role" text,
"Author" text,
"Radio Station/Production Company" text,
"Release/Air Date" text
) | Role of narrator, and a Radio Station/Production Company of bbc audiobooks, and a Release/Air Date of 13 november 2008 is what sum of the year? | SELECT SUM("Year") FROM table_67776 WHERE "Role" = 'narrator' AND "Radio Station/Production Company" = 'bbc audiobooks' AND "Release/Air Date" = '13 november 2008' |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show team id vs acc_percent as scatter plot use a different color for each All_Games | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games |
CREATE TABLE table_204_20 (
id number,
"represent" text,
"contestant" text,
"age" number,
"height" text,
"hometown" text
) | what is the number of delegates younger than 20 ? | SELECT COUNT("contestant") FROM table_204_20 WHERE "age" < 20 |
CREATE TABLE table_65384 (
"Team" text,
"2002 Position" real,
"2003 Position" real,
"Total Position" real,
"Qualification" text
) | Which Team has a Qualification of entry to the 2004 chinese super league, and a 2002 Position smaller than 6, and a 2003 Position smaller than 9, and a Total Position larger than 3.5? | SELECT "Team" FROM table_65384 WHERE "Qualification" = 'entry to the 2004 chinese super league' AND "2002 Position" < '6' AND "2003 Position" < '9' AND "Total Position" > '3.5' |
CREATE TABLE table_train_111 (
"id" int,
"mini_mental_state_examination_mmse" int,
"liver_disease" bool,
"geriatric_depression_scale_gds" int,
"rosen_modified_hachinski_ischemic_score" int,
"plasma_creatinine" float,
"NOUSE" float
) | current plasma creatinine >= 0.5 mg / dl | SELECT * FROM table_train_111 WHERE plasma_creatinine >= 0.5 |
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... | count the number of patients whose diagnoses short title is acute uri nos and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Acute uri NOS" AND lab.fluid = "Ascites" |
CREATE TABLE table_name_13 (
winner VARCHAR,
runner_up VARCHAR,
season VARCHAR
) | Which Winner has a Runner-up of larne, and a Season of 2003 04? | SELECT winner FROM table_name_13 WHERE runner_up = "larne" AND season = "2003–04" |
CREATE TABLE table_262 (
"University Name" text,
"Acronym" text,
"Date founded" real,
"Website" text,
"Official registration notes" text
) | What year was USF founded? | SELECT "Date founded" FROM table_262 WHERE "Acronym" = 'USF' |
CREATE TABLE table_204_183 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which country/countries has the same number of total metals as thailand ? | SELECT "nation" FROM table_204_183 WHERE "nation" <> 'thailand' AND "total" = (SELECT "total" FROM table_204_183 WHERE "nation" = 'thailand') |
CREATE TABLE Minor_in (
StuID INTEGER,
DNO INTEGER
)
CREATE TABLE Enrolled_in (
StuID INTEGER,
CID VARCHAR(7),
Grade VARCHAR(2)
)
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGE... | Visualize a scatter chart about the correlation between Credits and DNO . | SELECT Credits, DNO FROM Course ORDER BY Credits |
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,
... | During the week does 588 usually have 2 or 3 lectures ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 1000 reputation whores in C++ tag. | SELECT Users.Id AS Id, Users.DisplayName AS "user_link", SUM(Answers.Score) * 10 AS Reputation FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER JOIN PostTags ON PostTags.PostId = Answers.ParentId INNER JOIN Tags ON T... |
CREATE TABLE table_204_633 (
id number,
"launch date" text,
"operator" text,
"name" text,
"sample origin" text,
"samples returned" text,
"recovery date" text,
"mission result" text
) | what was the name of the mission previous to cosmos 300 ? | SELECT "name" FROM table_204_633 WHERE id = (SELECT id FROM table_204_633 WHERE "name" = 'cosmos 300') - 1 |
CREATE TABLE table_43494 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many grids had a Time/Retired of +4 laps? | SELECT COUNT("Grid") FROM table_43494 WHERE "Time/Retired" = '+4 laps' |
CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"length" text
) | how many featured guests are there in total ? | SELECT COUNT("featured guest(s)") FROM table_204_184 |
CREATE TABLE table_name_60 (
place VARCHAR,
country VARCHAR
) | In what place did the golfer representing Zimbabwe finish? | SELECT place FROM table_name_60 WHERE country = "zimbabwe" |
CREATE TABLE table_21501518_1 (
song_choice VARCHAR,
order__number VARCHAR
) | How many total songs has the order #1 | SELECT COUNT(song_choice) FROM table_21501518_1 WHERE order__number = "1" |
CREATE TABLE table_19441 (
"Season" text,
"Coach" text,
"Overall" text,
"Conference" text,
"Standing" text,
"Postseason" text
) | In what season was the overall record 29-7? | SELECT "Season" FROM table_19441 WHERE "Overall" = '29-7' |
CREATE TABLE table_68616 (
"Year" text,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
) | What is the English title for Ansikte Mot Ansikte? | SELECT "English title" FROM table_68616 WHERE "Original title" = 'ansikte mot ansikte' |
CREATE TABLE table_15328 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) | Which gc37-01 v10 engine has the fewest points? | SELECT MIN("Points") FROM table_15328 WHERE "Engine" = 'gc37-01 v10' |
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 whose admission location is phys referral/normal deli and discharge location is home? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "HOME" |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | How many players played each position Plot them as bar chart, and rank in asc by the y-axis. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) |
CREATE TABLE table_name_5 (
venue VARCHAR,
against VARCHAR
) | Which venue has 16 against? | SELECT venue FROM table_name_5 WHERE against = 16 |
CREATE TABLE table_30854 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What is the pick # when the new jersey devils is the nhl team? | SELECT "Pick #" FROM table_30854 WHERE "NHL team" = 'New Jersey Devils' |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what is the mchc difference/difference of patient 032-17571 second measured on the last hospital visit compared to the first value measured on the last hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of patients whose diagnoses long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use 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 = "Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use" AND ... |
CREATE TABLE table_name_33 (
score VARCHAR,
attendance VARCHAR
) | What is Score, when Attendance is 2,444? | SELECT score FROM table_name_33 WHERE attendance = "2,444" |
CREATE TABLE table_name_43 (
period VARCHAR,
built VARCHAR,
model VARCHAR
) | Between which years were there 241 fokker 70 model cabins built? | SELECT period FROM table_name_43 WHERE built < 241 AND model = "fokker 70" |
CREATE TABLE table_21037 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Dick Durbin" text,
"Republican: Steve Sauerberg" text,
"Lead Margin" real
) | Name the republican steve sauerberg for august 12, 2008 | SELECT "Republican: Steve Sauerberg" FROM table_21037 WHERE "Dates administered" = 'August 12, 2008' |
CREATE TABLE table_204_608 (
id number,
"name" text,
"elected party" text,
"constituency" text,
"elected date" text,
"military service" text
) | how long did bernard pilon serve in the canadian army ? | SELECT "military service" - "military service" FROM table_204_608 WHERE "name" = 'bernard pilon' |
CREATE TABLE table_name_64 (
money___ INTEGER,
place VARCHAR,
score VARCHAR
) | What is the Money of the T4 Place Player with a Score of 71-66-74-67=278? | SELECT AVG(money___) AS $__ FROM table_name_64 WHERE place = "t4" AND score = 71 - 66 - 74 - 67 = 278 |
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 (
... | How many female patients have a prescription for aspirin ec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Aspirin EC" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | what is the number of hours elapsed since the last time patient 033-22108 had a d5w 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_51441 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the date of the game when Atlanta was the home team? | SELECT "Date" FROM table_51441 WHERE "Home" = 'atlanta' |
CREATE TABLE table_name_33 (
trainer VARCHAR,
year VARCHAR
) | Who is the Trainer with the Year of 2013? | SELECT trainer FROM table_name_33 WHERE year = "2013" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | what is the dose of sodium bicarbonate that is first prescribed to patient 10811 since 05/2103? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811) AND prescriptions.drug = 'sodium bicarbonate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-05' ORDER BY prescriptions.startdate LIMIT 1 |
CREATE TABLE table_39413 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | In what Round was Pick 138? | SELECT SUM("Round") FROM table_39413 WHERE "Pick" = '138' |
CREATE TABLE table_60790 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What years did the player with a t71 finish win? | SELECT "Year(s) won" FROM table_60790 WHERE "Finish" = 't71' |
CREATE TABLE table_30897 (
"Month Sequence" real,
"Numbered Month" text,
"Month Name" text,
"Regular Year" text,
"Defective Year" real,
"Excessive Year" real
) | What is the defective year for the regular year of 29 days and month sequence of 2? | SELECT MAX("Defective Year") FROM table_30897 WHERE "Regular Year" = '29 days' AND "Month Sequence" = '2' |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE technician (
technician_id real,
Nam... | What is the name of the technician whose team is not 'NYY', and count them by a bar chart | SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart, and sort in desc by the y-axis. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC |
CREATE TABLE table_2095 (
"Season" text,
"Final Venue" text,
"Champion" text,
"Result" text,
"Finalist" text,
"MVP" text
) | Who was the finalist when the MVP was Romain Sato? | SELECT "Finalist" FROM table_2095 WHERE "MVP" = 'Romain Sato' |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | Which clubs have one or more members whose advisor is '1121'? | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121 |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | what is the drug that patient 19352 was prescribed for within 2 days after the diagnosis of hx traumatic fracture until 22 months ago? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 19352 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx tra... |
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transac... | Visualize the general trend of sum share count over the date of transaction, sort in descending by the X-axis. | SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC |
CREATE TABLE table_28177800_5 (
late_middle_english VARCHAR,
late_old_english__anglian_ VARCHAR
) | What is the Late Middle English equivalent of the Anglian g, g? | SELECT late_middle_english FROM table_28177800_5 WHERE late_old_english__anglian_ = "æg, ǣg" |
CREATE TABLE table_24058 (
"Episode No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Viewers (millions)" text,
"Original airdate" text
) | What was the episode number for 'Going Bodmin'? | SELECT MAX("Episode No.") FROM table_24058 WHERE "Title" = 'Going Bodmin' |
CREATE TABLE table_39585 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many touchdowns were scored by William Cole? | SELECT "Touchdowns" FROM table_39585 WHERE "Player" = 'william cole' |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and sort in descending by the bars. | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC |
CREATE TABLE table_65927 (
"Team" text,
"Car Spec." text,
"Drivers" text,
"Class" text,
"Rounds" text
) | What rounds did RML Racing Silverline and James Nash compete? | SELECT "Rounds" FROM table_65927 WHERE "Team" = 'rml racing silverline' AND "Drivers" = 'james nash' |
CREATE TABLE table_11226 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Name the score for pacers visitor on 14 april 2008 | SELECT "Score" FROM table_11226 WHERE "Visitor" = 'pacers' AND "Date" = '14 april 2008' |
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 (... | Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, display X-axis in asc order. | SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" ORDER BY EMP_DOB |
CREATE TABLE table_37478 (
"Date" text,
"City" text,
"Result" text,
"Score" text,
"Competition" text
) | Which City has a Result of w, and a Competition of international friendly (unofficial match), and a Score of 1-0? | SELECT "City" FROM table_37478 WHERE "Result" = 'w' AND "Competition" = 'international friendly (unofficial match)' AND "Score" = '1-0' |
CREATE TABLE table_34222 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"Career SR" text,
"Career Win-Loss" text
) | What is the 1995 value with of the 1993 ATP Masters Series? | SELECT "1995" FROM table_34222 WHERE "1993" = 'atp masters series' |
CREATE TABLE table_6626 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What was the Pick Number when the position was wide receiver, the college was Southern Miss with an overall less than 186? | SELECT AVG("Pick #") FROM table_6626 WHERE "Position" = 'wide receiver' AND "College" = 'southern miss' AND "Overall" < '186' |
CREATE TABLE table_32112 (
"Name" text,
"Martyred" real,
"Place" text,
"Beatified" real,
"Canonised" real
) | When was the first beatification in Korea that was canonised before 1984? | SELECT MIN("Beatified") FROM table_32112 WHERE "Place" = 'korea' AND "Canonised" < '1984' |
CREATE TABLE table_55341 (
"Finish Position" text,
"Lengths Behind" text,
"Post Position" real,
"Horse name" text,
"Trainer" text,
"Jockey" text,
"Owner" text,
"Post Time Odds" text
) | What horse does todd pletcher ride with odds of 14.20-1? | SELECT "Horse name" FROM table_55341 WHERE "Jockey" = 'todd pletcher' AND "Post Time Odds" = '14.20-1' |
CREATE TABLE table_74425 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) | how many episodes in the serie were title 'the key | SELECT COUNT("No. in series") FROM table_74425 WHERE "Title" = 'The Key' |
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... | get the number of patients with diagnoses icd9 code 99662 who had ascitic fluid lab test done. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "99662" AND lab.fluid = "Ascites" |
CREATE TABLE table_name_11 (
school VARCHAR,
location VARCHAR
) | What school is in Ligonier? | SELECT school FROM table_name_11 WHERE location = "ligonier" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id , and rank total number in descending order please. | 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_17075 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | How many schools did Derrick Green attend? | SELECT COUNT("School") FROM table_17075 WHERE "Player" = 'Derrick Green' |
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 admission type and procedure long title of subject id 2560? | SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE table_name_74 (
rank VARCHAR,
country VARCHAR
) | What rank is Germany? | SELECT rank FROM table_name_74 WHERE country = "germany" |
CREATE TABLE table_77872 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the Away team is south melbourne, what's the Home team score? | SELECT "Home team score" FROM table_77872 WHERE "Away team" = 'south melbourne' |
CREATE TABLE table_name_18 (
location VARCHAR,
name VARCHAR,
type VARCHAR,
opened VARCHAR
) | Where did the cable-stayed Badong Bridge open in 2005? | SELECT location FROM table_name_18 WHERE type = "cable-stayed" AND opened = 2005 AND name = "badong bridge" |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCH... | Draw a bar chart of dept code versus the total number, order y axis in descending order. | SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC |
CREATE TABLE table_60354 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the second leg for Team 1 Servette? | SELECT "2nd leg" FROM table_60354 WHERE "Team 1" = 'servette' |
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,
... | how many days has passed since patient 005-4471 received his first diagnosis of post spinal surgery - cervical on their current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' ... |
CREATE TABLE table_name_85 (
class_aAA VARCHAR,
school_year VARCHAR
) | Whcih was the Class AAA in school year 2006-07? | SELECT class_aAA FROM table_name_85 WHERE school_year = "2006-07" |
CREATE TABLE table_name_16 (
russian VARCHAR,
avoirdupois_value VARCHAR
) | What Russian has an Avoirdupois value of 0.686 gr? | SELECT russian FROM table_name_16 WHERE avoirdupois_value = "0.686 gr" |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tri... | List the positions of players whose average number of points scored by that position is larger than 20, compare the number of positions, and order total number in descending order. | SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.