table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_204_761 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | only one team has won more than 10 bronze medals in the biathlon at the winter paralympics . which team is it ? | SELECT "nation" FROM table_204_761 WHERE "bronze" > 10 |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_B... | How many apartment bookings in each day? Show me a line chart grouping by booking end date. | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | what are the four most frequently ordered specimen test for patients who were diagnosed with fx facial bone nec-close previously within the same month, since 3 years ago? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id numbe... | when was the first time that patient 85895 had minimum chloride during a month before. | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRE... |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
... | How many students are in each department? Show me a bar chart. | SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name |
CREATE TABLE table_67822 (
"Stage" text,
"Route" text,
"Distance" text,
"Date" text,
"Winner" text
) | Name the date for mark cavendish | SELECT "Date" FROM table_67822 WHERE "Winner" = 'mark cavendish' |
CREATE TABLE table_1190 (
"Title (pages)" text,
"Spirou" real,
"Writer / Artist" text,
"1st publication, Belgium" text,
"Integrale" text
) | Name the least spirou | SELECT MIN("Spirou") FROM table_1190 |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what are the top four most common diagnoses that followed during the same month for patients who were treated with packed cell transfusion in 2103? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... |
CREATE TABLE table_name_55 (
overall INTEGER,
position VARCHAR,
pick VARCHAR
) | If the pick is under 28 and the position is k, what's the highest Overall pick? | SELECT MAX(overall) FROM table_name_55 WHERE position = "k" AND pick < 28 |
CREATE TABLE table_203_455 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) | how many players are from canada ? | SELECT COUNT("player") FROM table_203_455 WHERE "nationality" = 'canada' |
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... | how many hours has elapsed since the first time that patient 006-105495 took a volume (ml) dobutamine intake on the current intensive care unit visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... |
CREATE TABLE table_name_51 (
points VARCHAR,
tries VARCHAR,
appearance VARCHAR
) | How many times is tries 0 and appearance less than 0? | SELECT COUNT(points) FROM table_name_51 WHERE tries = 0 AND appearance < 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 average age of patients whose admission location is emergency room admit and days of hospital stay is 13? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay = "13" |
CREATE TABLE table_10015132_2 (
player VARCHAR,
school_club_team VARCHAR
) | How many players were with the school or club team La Salle? | SELECT COUNT(player) FROM table_10015132_2 WHERE school_club_team = "La Salle" |
CREATE TABLE table_name_79 (
linkedin VARCHAR,
site VARCHAR,
myspace VARCHAR
) | How many linkedin have Facebook as the site, with a myspace less than 64? | SELECT COUNT(linkedin) FROM table_name_79 WHERE site = "facebook" AND myspace < 64 |
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... | how many male patients are less than 55 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "55" |
CREATE TABLE table_35982 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | Which Top-5 is the lowest one that has Cuts made of 10, and Events larger than 10? | SELECT MIN("Top-5") FROM table_35982 WHERE "Cuts made" = '10' AND "Events" > '10' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | question score vs top answer score. | SELECT rbin, COUNT(*) FROM (SELECT ROUND(CAST(q.Score AS FLOAT) / a.maxScore, 1) AS rbin FROM (SELECT ParentId, MAX(Score) AS maxScore FROM Posts WHERE PostTypeId = 2 GROUP BY ParentId) AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.maxScore >= '##minTopAnswerScore?5##' AND q.Score >= '##minQuestionScore?0##') AS r ... |
CREATE TABLE table_68280 (
"Representative" text,
"Title" text,
"Presentation of credentials" text,
"Termination of mission" text,
"Appointed by" text
) | Name the termination of mission for appointed by of franklin pierce | SELECT "Termination of mission" FROM table_68280 WHERE "Appointed by" = 'franklin pierce' |
CREATE TABLE table_name_27 (
willingshain VARCHAR,
reimboldsh VARCHAR
) | What Willinghshain has Reimboldsh of 101? | SELECT willingshain FROM table_name_27 WHERE reimboldsh = "101" |
CREATE TABLE table_27902171_4 (
date VARCHAR,
team VARCHAR
) | What day did they play the phoenix suns? | SELECT date FROM table_27902171_4 WHERE team = "Phoenix Suns" |
CREATE TABLE table_54877 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | Which team has an away score of 9.10 (64)? | SELECT "Home team" FROM table_54877 WHERE "Away team score" = '9.10 (64)' |
CREATE TABLE table_name_40 (
draw INTEGER,
champs INTEGER
) | Which Draw is the lowest one that has Champs smaller than 0? | SELECT MIN(draw) FROM table_name_40 WHERE champs < 0 |
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 lab (
subject_id text,
hadm_id text,
... | what is procedure short title and lab test category of subject id 2110? | SELECT procedures.short_title, lab."CATEGORY" FROM procedures INNER JOIN lab ON procedures.hadm_id = lab.hadm_id WHERE procedures.subject_id = "2110" |
CREATE TABLE table_49888 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | Who's the Winning team with a Pole position of robby gordon, and a Date of june 11? | SELECT "Winning team" FROM table_49888 WHERE "Pole position" = 'robby gordon' AND "Date" = 'june 11' |
CREATE TABLE drivers (
driverid VARCHAR,
surname VARCHAR
)
CREATE TABLE races (
raceid VARCHAR
)
CREATE TABLE results (
driverid VARCHAR,
raceid VARCHAR
) | Find the id and surname of the driver who participated the most number of races? | SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_9416 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
) | How many rounds have a position of C? | SELECT COUNT("Round") FROM table_9416 WHERE "Position" = 'c' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | what are the five most frequently performed surgeries for patients 30s during this year? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
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
)
... | give me the number of patients whose admission type is newborn and diagnoses long title is other specified disorders of skin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Other specified disorders of skin" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number... | what was the difference between the total amount of output and input of patient 782 on 03/04/2103? | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 782)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2103-03-04') - (SELECT... |
CREATE TABLE table_19880 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What is the series episode where Segment B is popcorn ? | SELECT "Series Ep." FROM table_19880 WHERE "Segment B" = 'Popcorn' |
CREATE TABLE table_name_14 (
profits__billion_ INTEGER,
sales__billion_$_ VARCHAR,
rank VARCHAR
) | Name the lowest Profits (billion $) which has a Sales (billion $) of 425.7, and a Rank larger than 4? | SELECT MIN(profits__billion_) AS $_ FROM table_name_14 WHERE sales__billion_$_ = 425.7 AND rank > 4 |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Visualize a bar chart about the distribution of Sex and the average of Height , and group by attribute Sex, I want to order mean height from high to low order. | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) DESC |
CREATE TABLE table_24399615_3 (
viewers VARCHAR,
airdate VARCHAR
) | How many entries are shown for viewers when the airdate was 26 november 2009? | SELECT COUNT(viewers) FROM table_24399615_3 WHERE airdate = "26 November 2009" |
CREATE TABLE table_1969577_3 (
enrollment INTEGER
) | What's the minimal enrollment of any of the schools? | SELECT MIN(enrollment) FROM table_1969577_3 |
CREATE TABLE table_name_34 (
opened INTEGER,
city VARCHAR
) | What is the latest opened year of the team in Glasgow, Scotland? | SELECT MAX(opened) FROM table_name_34 WHERE city = "glasgow, scotland" |
CREATE TABLE table_name_43 (
score VARCHAR,
record VARCHAR
) | What is the Score of the Game with a Record of 13 12? | SELECT score FROM table_name_43 WHERE record = "13–12" |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | Pie chart. what are the average ages for male and female students? | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex |
CREATE TABLE table_21421 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Who replaced outgoing manager Jos ngel Ziganda? | SELECT "Replaced by" FROM table_21421 WHERE "Outgoing manager" = 'José Ángel Ziganda' |
CREATE TABLE table_name_95 (
grid INTEGER,
constructor VARCHAR,
driver VARCHAR
) | I want the highest Grid for Toyota and jarno trulli | SELECT MAX(grid) FROM table_name_95 WHERE constructor = "toyota" AND driver = "jarno trulli" |
CREATE TABLE table_9112 (
"Title" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Arranger(s)" text,
"Length" text
) | What is the Length, when the Title is 'The Way To Your Heart'? | SELECT "Length" FROM table_9112 WHERE "Title" = 'the way to your heart' |
CREATE TABLE table_name_58 (
date VARCHAR,
result VARCHAR
) | Which Date has Result of 86-87? | SELECT date FROM table_name_58 WHERE result = "86-87" |
CREATE TABLE table_56890 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Name the date for circuit of interlagos | SELECT "Date" FROM table_56890 WHERE "Circuit" = 'interlagos' |
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 minimum age of patients whose death status is 0 and discharge location is disc-tran cancer/chldrn h? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" |
CREATE TABLE table_65735 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Which Week has an Attendance larger than 65,070? | SELECT MAX("Week") FROM table_65735 WHERE "Attendance" > '65,070' |
CREATE TABLE table_8583 (
"DVD title" text,
"Season" text,
"Aspect ratio" text,
"Episode count" real,
"Time length" text,
"Release date" text
) | What title was release November 17, 2009 in a 16:9 aspect ratio? | SELECT "DVD title" FROM table_8583 WHERE "Aspect ratio" = '16:9' AND "Release date" = 'november 17, 2009' |
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | What are the names, ages, and countries of artists, sorted by the year they joined? | SELECT name, age, country FROM artist ORDER BY year_join |
CREATE TABLE table_71884 (
"Date" text,
"Visiting team" text,
"Final score" text,
"Host team" text,
"Stadium" text
) | Who is the Visiting team on december 20? | SELECT "Visiting team" FROM table_71884 WHERE "Date" = 'december 20' |
CREATE TABLE table_name_64 (
date VARCHAR,
opponent_in_final VARCHAR
) | What is Date, when Opponent in Final is 'Guy Forget'? | SELECT date FROM table_name_64 WHERE opponent_in_final = "guy forget" |
CREATE TABLE table_4059 (
"Contestant" text,
"Age" real,
"Height" text,
"Starting BMI" text,
"Finale BMI" text,
"Reunion BMI" text,
"Start Weight" text,
"Finale Weight" text,
"Reunion Weight" text,
"lbs lost finale" text,
"lbs lost reunion" real
) | What was pinky's bmi at the reunion? | SELECT "Reunion BMI" FROM table_4059 WHERE "Contestant" = 'Pinky' |
CREATE TABLE table_name_99 (
location VARCHAR,
round VARCHAR,
opponent VARCHAR
) | Where's the location for the opponent James Zikic and 3 rounds? | SELECT location FROM table_name_99 WHERE round = 3 AND opponent = "james zikic" |
CREATE TABLE table_27898 (
"Settlement" text,
"Cyrillic Name" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What was the population of in 2011? | SELECT COUNT("Population (2011)") FROM table_27898 WHERE "Cyrillic Name" = 'Сурдук' |
CREATE TABLE table_2542 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | Which position has 9 podiums? | SELECT "Position" FROM table_2542 WHERE "Podiums" = '9' |
CREATE TABLE table_204_41 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | who is ranked at the top | SELECT "name" FROM table_204_41 WHERE id = 1 |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | How many students in 575 ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 575 |
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... | how many patients whose admission type is emergency and diagnoses long title is other disorders of the pituitary and other syndromes of diencephalohypophyseal origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin" |
CREATE TABLE table_20551 (
"Vehicle" text,
"EPA rated All-electric range" text,
"EPA rated combined fuel economy" text,
"Alaska ( Juneau )" text,
"California (San Francisco)" text,
"Mid-Atlantic South (Washington, D.C.)" text,
"U.S. national average electric mix" text,
"Southeast (Atlant... | What was the emission rating in Mid-Atlantic South for the vehicle that was rated 90 g/mi (56 g/km) in Alaska and 110 g/mi (68 g/km) in California? | SELECT "Mid-Atlantic South (Washington, D.C.)" FROM table_20551 WHERE "Alaska ( Juneau )" = '90 g/mi (56 g/km)' AND "California (San Francisco)" = '110 g/mi (68 g/km)' |
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 days of hospital stay is greater than 0 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.days_stay > "0" AND procedures.long_title = "Intravenous infusion of clofarabine" |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | What are the last names for all scholarship students, and count them by a bar chart, rank by the x-axis in asc. | 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 table_168482_1 (
_percentage_of_popular_vote VARCHAR,
election VARCHAR
) | How many percentages are listed for the election in 1983? | SELECT COUNT(_percentage_of_popular_vote) FROM table_168482_1 WHERE election = 1983 |
CREATE TABLE table_name_91 (
retired VARCHAR,
notes VARCHAR
) | What year was the aircraft retired when it was replaced by 737-300s? | SELECT retired FROM table_name_91 WHERE notes = "replaced by 737-300s" |
CREATE TABLE table_name_15 (
player VARCHAR,
to_par VARCHAR
) | What is the Player that has a To standard of 4? | SELECT player FROM table_name_15 WHERE to_par = "–4" |
CREATE TABLE table_name_5 (
drawn VARCHAR,
points_1 VARCHAR,
lost VARCHAR
) | How much Drawn has Points 1 of 51, and a Lost larger than 5? | SELECT COUNT(drawn) FROM table_name_5 WHERE points_1 = 51 AND lost > 5 |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE S... | Script to identify serial upvoters. | SELECT Users.Id, Users.Reputation, Badges.Date, Posts.Id AS PostId, Posts.CreationDate AS PostDate, Votes.VoteTypeId AS VoteId FROM Users LEFT JOIN Badges ON Users.Id = Badges.UserId LEFT JOIN Posts ON Users.Id = Posts.OwnerUserId LEFT JOIN Votes ON Posts.Id = Votes.PostId WHERE Badges.Name = 'Mortarboard' AND Votes.Vo... |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE key... | who published the most papers in syntactic parsing ? | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY C... |
CREATE TABLE table_name_40 (
date VARCHAR,
week VARCHAR
) | On what date did week 6 occur? | SELECT date FROM table_name_40 WHERE week = 6 |
CREATE TABLE table_78505 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | When the driver richard attwood has a constructor of brm, what is the number of laps? | SELECT "Laps" FROM table_78505 WHERE "Constructor" = 'brm' AND "Driver" = 'richard attwood' |
CREATE TABLE temperature (
City_ID int,
Jan real,
Feb real,
Mar real,
Apr real,
Jun real,
Jul real,
Aug real,
Sep real,
Oct real,
Nov real,
Dec real
)
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
... | List venues of all matches in the order of their dates starting from the most recent one, and count them by a pie chart | SELECT Venue, COUNT(Venue) FROM match GROUP BY Venue ORDER BY Date 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | provide the number of patients whose admission type is emergency and lab test name is mesothelial cells? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Mesothelial Cells" |
CREATE TABLE services (
service_type_code VARCHAR,
organization_id VARCHAR
)
CREATE TABLE organizations (
organization_id VARCHAR,
organization_details VARCHAR
) | What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'? | SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party' |
CREATE TABLE table_60692 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real
) | What was Frank Moore's score? | SELECT "Score" FROM table_60692 WHERE "Player" = 'frank moore' |
CREATE TABLE table_name_61 (
date VARCHAR,
tournament VARCHAR
) | What is the Date of the Ameritech Senior Open? | SELECT date FROM table_name_61 WHERE tournament = "ameritech senior open" |
CREATE TABLE pilot (
Name VARCHAR
) | List all pilot names in ascending alphabetical order. | SELECT Name FROM pilot ORDER BY Name |
CREATE TABLE table_18367 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Which incumbent was first elected in 1964? | SELECT "Incumbent" FROM table_18367 WHERE "First elected" = '1964' |
CREATE TABLE table_2668243_22 (
party VARCHAR,
district VARCHAR
) | how many 'Party' are in district south carolina 2? | SELECT COUNT(party) FROM table_2668243_22 WHERE district = "South Carolina 2" |
CREATE TABLE table_name_68 (
diff INTEGER,
drawn VARCHAR,
played VARCHAR
) | What is the highest diff with drawn of 6 and play larger than 18? | SELECT MAX(diff) FROM table_name_68 WHERE drawn = 6 AND played > 18 |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | list the ids of all those patients diagnosed with ac alcoholic hepatitis during the previous year. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac alcoholic hepatitis') AND DATETIME(diagnoses_icd.charttime, 'start of y... |
CREATE TABLE table_47652 (
"Year" real,
"Publication" text,
"Country" text,
"Accolade" text,
"Rank" real
) | What's the average year for the accolade 100 greatest singles of all time? | SELECT AVG("Year") FROM table_47652 WHERE "Accolade" = '100 greatest singles of all time' |
CREATE TABLE table_45632 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | What was the record on september 2? | SELECT "Record" FROM table_45632 WHERE "Date" = 'september 2' |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id num... | JS users in Brussels or around. | SELECT * FROM Users WHERE UPPER(Location) = UPPER('##location##') AND Reputation > 100 |
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 number of patients whose ethnicity is asian and primary disease is ventricular tachycardia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" |
CREATE TABLE table_name_62 (
population VARCHAR,
code VARCHAR,
county VARCHAR,
municipality VARCHAR
) | What is the population of Danderyd municipality in Stockholm County with a code lower than 162? | SELECT COUNT(population) FROM table_name_62 WHERE county = "stockholm county" AND municipality = "danderyd municipality" AND code < 162 |
CREATE TABLE table_18626383_2 (
height__cm_ VARCHAR,
contestant VARCHAR
) | When valora roucek is the contestant how many heights in centimeters are there? | SELECT COUNT(height__cm_) FROM table_18626383_2 WHERE contestant = "Valora Roucek" |
CREATE TABLE table_12919 (
"Club" text,
"Games" real,
"Wins" real,
"Losses" real,
"Draws" real
) | What is the lowest Games, when Wins is less than 1, and when Draws is greater than 1? | SELECT MIN("Games") FROM table_12919 WHERE "Wins" < '1' AND "Draws" > '1' |
CREATE TABLE table_name_75 (
bronze INTEGER,
country VARCHAR,
total VARCHAR
) | Which Bronze has a Country of malaysia, and a Total smaller than 2644? | SELECT SUM(bronze) FROM table_name_75 WHERE country = "malaysia" AND total < 2644 |
CREATE TABLE table_2203760_4 (
budget VARCHAR,
film VARCHAR
) | What was the budget for 'Thirteen Ghosts'? | SELECT budget FROM table_2203760_4 WHERE film = "Thirteen Ghosts" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | how many times has patient 022-31513 come to the hospital until 2 years ago? | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '022-31513' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-2 year') |
CREATE TABLE table_203_376 (
id number,
"no." number,
"name" text,
"term of office" text,
"president(s) served under" text
) | how many directors served more than 3 years ? | SELECT COUNT("name") FROM table_203_376 WHERE "term of office" - "term of office" > 3 |
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,
LinkTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name tex... | Questions with empty revision history. | SELECT * FROM Posts AS x WHERE (SELECT COUNT(*) FROM PostHistory WHERE PostId = x.Id) = 0 |
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, return a bar chart about the distribution of name and code , and group by attribute name, and display by the X in desc. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC |
CREATE TABLE table_name_68 (
outcome VARCHAR,
tournament VARCHAR,
opponent_in_the_final VARCHAR
) | What was the outcome of the Tournament of lugano , switzerland wta virginia slims, against bonnie gadusek? | SELECT outcome FROM table_name_68 WHERE tournament = "lugano , switzerland wta virginia slims" AND opponent_in_the_final = "bonnie gadusek" |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name te... | Total 'Welcome to...' by year. How many times did site users say `Welcome to...` | SELECT YEAR(CreationDate), COUNT(Id) AS WelcomeCount FROM Comments WHERE Text LIKE '%Welcome to%' GROUP BY YEAR(CreationDate) |
CREATE TABLE table_42589 (
"Average population (x 1,000)" text,
"Live births" text,
"Deaths" text,
"Natural change" text,
"Migration" text,
"Crude birth rate (per 1,000)" real,
"Crude death rate (per 1,000)" real,
"Natural change (per 1,000)" real,
"Migration (per 1,000)" real
) | What kind of Live births has a Migration of -14 873? | SELECT "Live births" FROM table_42589 WHERE "Migration" = '-14 873' |
CREATE TABLE table_58947 (
"Binary" real,
"Octal" real,
"Decimal" real,
"Hexadecimal" real,
"Glyph" real
) | What is the lowest octal with a 30 hexadecimal and less than 0 glyphs? | SELECT MIN("Octal") FROM table_58947 WHERE "Hexadecimal" = '30' AND "Glyph" < '0' |
CREATE TABLE table_name_11 (
record VARCHAR,
date VARCHAR
) | What was the record at the game held on December 24, 2005? | SELECT record FROM table_name_11 WHERE date = "december 24, 2005" |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
cha... | had patient 5252 ever undergone a open lung biopsy in 2105? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open lung biopsy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252) AND STRFTIME('%y', proce... |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeo... | what number of patients have been discharged from the hospital in 2101? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2101' |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | please list am flights leaving SAN FRANCISCO BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
CREATE TABLE table_name_92 (
team_classification VARCHAR,
stage VARCHAR
) | Name the team classification for stage of 20 | SELECT team_classification FROM table_name_92 WHERE stage = "20" |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | is there ground transportation from LGA into NEW YORK | SELECT DISTINCT transport_type FROM ground_service WHERE (airport_code IN (SELECT AIRPORTalias0.airport_code FROM airport AS AIRPORTalias0 WHERE AIRPORTalias0.airport_code = 'LGA') AND city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEW YORK')) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.