table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID... | List all the participant ids and their details using a bar chart. | SELECT Participant_Details, Participant_ID FROM Participants |
CREATE TABLE table_name_15 (
rounds VARCHAR,
chassis VARCHAR,
driver VARCHAR
) | How many rounds did geoff lees drive with chassis of n180? | SELECT rounds FROM table_name_15 WHERE chassis = "n180" AND driver = "geoff lees" |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuest... | Posts containing a certain word or phrase formatted as code. Formatting programming language names or other keywords as code is explicitly discouraged (see https://meta.stackexchange.com/q/135112/349538). However, some users do it anyway. This query will help you find such posts so that you can edit them. | SELECT Id AS "post_link" FROM Posts WHERE Body LIKE '%<code>' + '##WordFormattedAsCode:string##' + '</code>%' LIMIT 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | give me the number of patients whose primary disease is ruq pain and age is less than 27? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.age < "27" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | the list of the patient ids of patients diagnosed with bone fracture(s) - acetabulum during this year. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'bone fracture(s) - acetabulum' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_... | What is the average of credit value of courses with more than one prerequisite for each title? Return a bar chart, display Y in asc order. | SELECT title, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY AVG(credits) |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and display Y-axis in descending order. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC |
CREATE TABLE table_64991 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Matches" real,
"Average" real
) | What is cork's rank? | SELECT "Rank" FROM table_64991 WHERE "County" = 'cork' |
CREATE TABLE table_69045 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | With an Overall larger than 107, in what Round was Jim Duncan picked? | SELECT SUM("Round") FROM table_69045 WHERE "Name" = 'jim duncan' AND "Overall" > '107' |
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... | give me the number of patients whose days of hospital stay is greater than 1 and lab test fluid is other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Other Body Fluid" |
CREATE TABLE table_47682 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | WHAT IS THE GRID OF HONDA, WITH 24 LAPS AND Time/Retired of +13.997? | SELECT "Grid" FROM table_47682 WHERE "Manufacturer" = 'honda' AND "Laps" = '24' AND "Time/Retired" = '+13.997' |
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... | Most related, correlated or anticorrelated tags. Calculates the correlation coefficient between all tag pairs. 0 correlation means that the tags are independent from each other. Negative correlation means that having a tag makes unlikely to have the other tag. Positive correlation means that a question tagged with one ... | WITH Raw AS (SELECT A.TagId AS TagA, B.TagId AS TagB, COUNT(*) AS Count FROM PostTags AS A, PostTags AS B WHERE A.PostId = B.PostId AND A.TagId != B.TagId GROUP BY A.TagId, B.TagId) SELECT A.TagName AS TagNameA, A.Count AS CountA, B.TagName AS TagNameB, B.Count AS CountB, Raw.Count AS BothCount, (1.0 * Raw.Count * @Tot... |
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 unmarried patients with a primary disease of acidosis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "ACIDOSIS" |
CREATE TABLE table_754 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many were first elected when the incumbent was Morgan M. Moulder? | SELECT COUNT("First elected") FROM table_754 WHERE "Incumbent" = 'Morgan M. Moulder' |
CREATE TABLE table_name_4 (
week VARCHAR,
date VARCHAR
) | Week that has a Date of december 5, 1959 had what week? | SELECT week FROM table_name_4 WHERE date = "december 5, 1959" |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Tenacious badge: Zero score accepted answers: more than 5 and 20% of total.. | SELECT a.Id, a.Score, q.Score, q.CreationDate FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.Score <= -3 AND q.CreationDate >= '2014-07-18' AND a.OwnerUserId = 1387518 ORDER BY CreationDate DESC |
CREATE TABLE table_204_912 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" number,
"notes" text
) | who was faster , mikio oyama or arnulf sunde ? | SELECT "athlete" FROM table_204_912 WHERE "athlete" IN ('mikio oyama', 'arnulf sunde') ORDER BY "time" LIMIT 1 |
CREATE TABLE table_21369 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | If the area is 34.73, what is the census ranking? | SELECT "Census Ranking" FROM table_21369 WHERE "Area km 2" = '34.73' |
CREATE TABLE table_16488 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
) | What is the english title where the premiere is less than 30.0 and the finale is bigger than 36.0? | SELECT "English title" FROM table_16488 WHERE "Premiere" < '30.0' AND "Finale" > '36.0' |
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,
... | tell me the number of patients categorized under hematology lab test who are under 59 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab."CATEGORY" = "Hematology" |
CREATE TABLE table_22113 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | In the district of Pennsylvania 1, what is the total number of political parties? | SELECT COUNT("Party") FROM table_22113 WHERE "District" = 'Pennsylvania 1' |
CREATE TABLE table_name_85 (
term_end VARCHAR,
party VARCHAR
) | On what date or dates did the term with the Centre Party end? | SELECT term_end FROM table_name_85 WHERE party = "centre party" |
CREATE TABLE table_66425 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What tournament had Alberta Brianti as an opponent with a score of 6-4 2-6 6-2? | SELECT "Tournament" FROM table_66425 WHERE "Opponent" = 'alberta brianti' AND "Score" = '6-4 2-6 6-2' |
CREATE TABLE table_48567 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the score of player jay haas? | SELECT "Score" FROM table_48567 WHERE "Player" = 'jay haas' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients whose ethnicity is hispanic/latino - puerto rican and diagnoses long title is ostium secundum type atrial septal defect? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Ostium secundum type atrial septal defect" |
CREATE TABLE table_20042805_2 (
hadeda_ibis VARCHAR,
whitefaced_duck VARCHAR
) | What is the Hadeda Ibis when the Whitefaced Duck is Blacksmith Plover? | SELECT hadeda_ibis FROM table_20042805_2 WHERE whitefaced_duck = "Blacksmith Plover" |
CREATE TABLE table_64661 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total when silver is more than 3, and rank is 2? | SELECT MAX("Total") FROM table_64661 WHERE "Silver" > '3' AND "Rank" = '2' |
CREATE TABLE table_5116 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | Which party had an incumbent of W. Jasper Talbert? | SELECT "Party" FROM table_5116 WHERE "Incumbent" = 'w. jasper talbert' |
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
)
... | what is the age and lab test category of patient id 2560? | SELECT demographic.age, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | Number of rows in each table. | SELECT t.name, i.rowcnt FROM sys.tables AS t INNER JOIN sysindexes AS i ON i.id = t.object_id AND i.indid IN (0, 1) ORDER BY 2 DESC |
CREATE TABLE table_name_5 (
record VARCHAR,
high_rebounds VARCHAR
) | What is the Record when the high rebounds was Antonio Davis (9)? | SELECT record FROM table_name_5 WHERE high_rebounds = "antonio davis (9)" |
CREATE TABLE table_27913160_3 (
driver VARCHAR,
round VARCHAR
) | Who was the driver in round 8? | SELECT driver FROM table_27913160_3 WHERE round = 8 |
CREATE TABLE table_204_96 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | what was the date of the last game ? | SELECT "date" FROM table_204_96 ORDER BY "date" DESC LIMIT 1 |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is admission type and days of hospital stay of subject id 5027? | SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.subject_id = "5027" |
CREATE TABLE table_name_13 (
baltimore_group VARCHAR,
family VARCHAR,
replication_site VARCHAR,
virion_shape VARCHAR,
envelopment VARCHAR
) | Which Baltimore group has a viron shape of icosahedral, replicates in the cytoplasm, is non-enveloped, and is from the astroviridae family? | SELECT baltimore_group FROM table_name_13 WHERE virion_shape = "icosahedral" AND envelopment = "non-enveloped" AND replication_site = "cytoplasm" AND family = "astroviridae" |
CREATE TABLE table_name_45 (
country VARCHAR,
place VARCHAR
) | Name the country for t3 place | SELECT country FROM table_name_45 WHERE place = "t3" |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CR... | Count the number of local authorities by the local authority. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority |
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text,
suppo... | List the name of playlist which has number of tracks greater than 100. | SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100 |
CREATE TABLE table_52200 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | In game 34 Curtis Borchardt played on which team with less than 275 rebounds? | SELECT "Team" FROM table_52200 WHERE "Rebounds" < '275' AND "Games" < '34' AND "Name" = 'curtis borchardt' |
CREATE TABLE table_name_85 (
date VARCHAR,
record VARCHAR
) | Record of 12 15 happened on what date? | SELECT date FROM table_name_85 WHERE record = "12–15" |
CREATE TABLE table_21548 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many assists were made in the game against San Antonio? | SELECT COUNT("High assists") FROM table_21548 WHERE "Team" = 'San Antonio' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid numb... | what's the average cost of a hospital with dexmedetomidine 200 mcg in 50 ml ns during this year? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'dexmedetomidine 200 mcg in 50 ml ns')) AND DAT... |
CREATE TABLE table_name_88 (
team VARCHAR,
week_1 VARCHAR
) | Name the team for week 1 of 28 | SELECT team FROM table_name_88 WHERE week_1 = "28" |
CREATE TABLE table_name_18 (
score VARCHAR,
opponent VARCHAR
) | What was the score of the game against the phoenix suns? | SELECT score FROM table_name_18 WHERE opponent = "phoenix suns" |
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... | tell me the last procedure patient 433 had since 4 years ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME... |
CREATE TABLE table_40875 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What was the highest number of against when the difference was 58 and the total played was more than 22? | SELECT MAX("Against") FROM table_40875 WHERE "Difference" = '58' AND "Played" > '22' |
CREATE TABLE table_9590 (
"School" text,
"Base" text,
"Bask" text,
"Golf" text,
"Soccer" text,
"Swimming" text,
"Tennis" text,
"Indoor track" text
) | What is the indoor track status for the school that has yes for tennis and no for golf? | SELECT "Indoor track" FROM table_9590 WHERE "Tennis" = 'yes' AND "Golf" = 'no' |
CREATE TABLE table_204_498 (
id number,
"location" text,
"building" text,
"year" number,
"km" number,
"monument" number
) | what other two locations have a rail bridge ? | SELECT "location" FROM table_204_498 WHERE "building" = 'rail bridge' |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | How long has ACABS 483 been taught for ? | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ACABS' AND course.number = 483 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
CREATE TABLE table_62694 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | How many total goals conceded are there when the points are greater than 58, less than 27 wins, and less than 1 draws? | SELECT SUM("Goals conceded") FROM table_62694 WHERE "Points" > '58' AND "Wins" < '27' AND "Draws" < '1' |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | please list the flights from PHILADELPHIA to TORONTO | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'T... |
CREATE TABLE table_43882 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Player is 'Deane Beman'? | SELECT "Score" FROM table_43882 WHERE "Player" = 'deane beman' |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperfield (
... | who are all the co-authors of Srinivasan Iyer ? | SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Srinivasan Iyer' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | is patient 23620's level of arterial bp mean last measured on the first intensive care unit visit less than it was first measured on the first intensive care unit visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23620) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
CREATE TABLE table_13557843_3 (
score VARCHAR,
record VARCHAR
) | What was the score of the game when the team was 1-2? | SELECT score FROM table_13557843_3 WHERE record = "1-2" |
CREATE TABLE table_14575 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real,
"First round" real,
"Final round" text
) | Which final round had a first round of 20? | SELECT "Final round" FROM table_14575 WHERE "First round" = '20' |
CREATE TABLE table_79923 (
"Name" text,
"Country" text,
"Status" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
) | What was the source of an ENG transfer that paid a 1.5m transfer fee? | SELECT "Source" FROM table_79923 WHERE "Country" = 'eng' AND "Transfer fee" = '£1.5m' |
CREATE TABLE table_name_84 (
award_description_s_ VARCHAR,
format_s_ VARCHAR
) | What are the award description with Format album? | SELECT award_description_s_ FROM table_name_84 WHERE format_s_ = "album" |
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronze number,
total number
)
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
country text
)
CREATE TABLE club (
club_id number,
name text,
region... | What are the different regions of clubs in ascending alphabetical order? | SELECT DISTINCT region FROM club ORDER BY region |
CREATE TABLE table_9476 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | What is the skip when Tony Angiboust was a lead? | SELECT "Skip" FROM table_9476 WHERE "Lead" = 'tony angiboust' |
CREATE TABLE table_204_623 (
id number,
"opponent" text,
"goals" text,
"wins" number,
"draws" number,
"losses" number,
"+- goals" number,
"matches" number,
"qualified" number,
"eliminated" number
) | how many opponents have the same number of draws as ks flamurtari ? | SELECT COUNT("opponent") FROM table_204_623 WHERE "opponent" <> 'ks flamurtari' AND "draws" = (SELECT "draws" FROM table_204_623 WHERE "opponent" = 'ks flamurtari') |
CREATE TABLE table_78094 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Who did the Tampa Bay Buccaneers play on december 23, 1995? | SELECT "Opponent" FROM table_78094 WHERE "Date" = 'december 23, 1995' |
CREATE TABLE table_59891 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the competition when the opponent was the Randers? | SELECT "Competition" FROM table_59891 WHERE "Opponent" = 'randers' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients are admitted before the year 2198 and tested for gamma glutamyltransferase in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2198" AND lab.label = "Gamma Glutamyltransferase" |
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... | Look for the patients less than 50 years old with lab test item id 50952. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab.itemid = "50952" |
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 patients were diagnosed with urinary tract infection and didn't return to the hospital in the same month in 2105? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'urinary tract infection' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT COUN... |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE... | how many patients were prescribed esmolol in the same hospital visit after colostomy nos? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... |
CREATE TABLE table_203_288 (
id number,
"season" text,
"premiere date" text,
"the winner" text,
"runner-up" text,
"finalists" text,
"contestants in order of elimination" text,
"number of contestants" text,
"number of concerts" number
) | how many finalist were in season af3 ? | SELECT "finalists" FROM table_203_288 WHERE "season" = 'af3' |
CREATE TABLE table_8448 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | What Driver had 50+3 Points? | SELECT "Driver" FROM table_8448 WHERE "Points" = '50+3' |
CREATE TABLE table_1342218_35 (
party VARCHAR,
district VARCHAR
) | What party does the incumbent from the Ohio 7 district belong to? | SELECT party FROM table_1342218_35 WHERE district = "Ohio 7" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | how many patients born before the year 2182 had medicare insurance? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dob_year < "2182" |
CREATE TABLE table_70368 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Name the sum of total with gold more than 1 and bronze more than 0 | SELECT SUM("Total") FROM table_70368 WHERE "Gold" > '1' AND "Bronze" > '0' |
CREATE TABLE table_23913 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Accreditation" text,
"Founded" real,
"Enrollment" text
) | What is the total number of schools founded that have an enrollment of 5634? | SELECT COUNT("Founded") FROM table_23913 WHERE "Enrollment" = '5634' |
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 treatment (
treat... | how many hours is it since the last time patient 022-187132 had a fat emulsion 20% 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_35887 (
"Date" text,
"Competition" text,
"Opponents" text,
"Venue" text,
"Score" text
) | What was the opponent at the League Play Offs at home? | SELECT "Opponents" FROM table_35887 WHERE "Venue" = 'home' AND "Competition" = 'league play offs' |
CREATE TABLE table_25921 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Jons team" text,
"Scores" text
) | Name the number of jons team for 15x10 | SELECT COUNT("Jons team") FROM table_25921 WHERE "Episode" = '15x10' |
CREATE TABLE table_name_43 (
comparative VARCHAR,
link VARCHAR
) | Which Comparative has a Link of sourcecode webserver? | SELECT comparative FROM table_name_43 WHERE link = "sourcecode webserver" |
CREATE TABLE table_740 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the candidates with party being democratic and dbeingtrict being north carolina 1 | SELECT "Candidates" FROM table_740 WHERE "Party" = 'Democratic' AND "District" = 'North Carolina 1' |
CREATE TABLE table_3251 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | If the writer is Mark Fink, who is the director? | SELECT "Directed by" FROM table_3251 WHERE "Written by" = 'Mark Fink' |
CREATE TABLE table_25243 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | How many laps have a 3:34:26 race time? | SELECT COUNT("Laps") FROM table_25243 WHERE "Race Time" = '3:34:26' |
CREATE TABLE table_12565 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What is the score when the attendance is greater than 134 and Workington is the home team? | SELECT "Score" FROM table_12565 WHERE "Attendance" > '134' AND "Home team" = 'workington' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | how much does it cost for a procedure called neuromuscular blocking agent? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'neuromuscular blocking agent') |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | count the number of patients who had undergone a cooling the patient procedure two times since 2105. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'cooling the patient' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') GROUP BY patient.uniquepid) AS... |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients who have died in or before year 2164 with a s/p fall as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2164.0" |
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
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,
Na... | What are the names of technicians with the machine series that they repair? Show me how many machines for each technician's name, list Name in descending order please. | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY Name DESC |
CREATE TABLE useracct (
name VARCHAR,
u_id VARCHAR
)
CREATE TABLE review (
u_id VARCHAR,
rating VARCHAR
) | Find the name of the user who gave the highest rating. | SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1 |
CREATE TABLE table_28773 (
"Portuguese name" text,
"English name" text,
"Subdivides in" text,
"Equivalence in Varas" text,
"Metrical equivalence" text
) | Name the equivalence for varas for geometrical pace | SELECT "Equivalence in Varas" FROM table_28773 WHERE "English name" = 'Geometrical pace' |
CREATE TABLE table_21928 (
"Episode #" text,
"Season #" real,
"Title" text,
"Writer(s)" text,
"Director" text,
"Originalairdate" text
) | what was the title of the episode 21a? | SELECT "Title" FROM table_21928 WHERE "Episode #" = '21a' |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me about the distribution of All_Road and Team_ID in a bar chart, rank by the x axis from low to high. | SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road |
CREATE TABLE table_name_59 (
surface VARCHAR,
outcome VARCHAR,
opponent VARCHAR
) | What is the surface of the tournament with a runner-up outcome and dudi sela as the opponent? | SELECT surface FROM table_name_59 WHERE outcome = "runner-up" AND opponent = "dudi sela" |
CREATE TABLE table_19042 (
"Episode" text,
"Original Air Date" text,
"Viewers (millions)" text,
"Presenter" text,
"Location" text
) | What episode of the Pride of Britain Awards had an audience of 6.06 million viewers? | SELECT "Episode" FROM table_19042 WHERE "Viewers (millions)" = '6.06' |
CREATE TABLE table_21035326_1 (
opponent VARCHAR,
golden_bears_points VARCHAR
) | What opponent was playing against the Golden Bears when they scored 3 points? | SELECT opponent FROM table_21035326_1 WHERE golden_bears_points = 3 |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
... | what were the top three most frequently prescribed drugs that patients were prescribed within the same hospital visit after being prescribed ciprofloxacin in d5w 400 mg/200ml iv soln until 2104? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ciprofloxacin in... |
CREATE TABLE table_79062 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
) | What was the record for less than 78 games and a score of 114 109 (ot)? | SELECT "Record" FROM table_79062 WHERE "Game" < '78' AND "Score" = '114–109 (ot)' |
CREATE TABLE table_204_53 (
id number,
"date" text,
"result" text,
"opponent" text,
"event" text,
"location" text,
"method" text,
"round" number,
"time" text
) | how many times did grigorian have a match in belgium ? | SELECT COUNT(*) FROM table_204_53 WHERE "location" = 'belgium' |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Graph of answer quality and number - with minimum reputation threshold. | SELECT *, COUNT(*) FROM (SELECT p.OwnerUserId AS "user_link", u.Reputation, ROUND(AVG(CAST(p.Score AS FLOAT)), 2) AS "avg_score", COUNT(*) AS "#_questions" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 AND p.CommunityOwnedDate IS NULL AND p.ClosedDate IS NULL AND u.Reputation > '##Minim... |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagn... | how much is lidocaine 2% costing? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'lidocaine 2%') |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | how many times since 3 years ago does patient 22753 visit the hospital? | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 22753 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | how many days was it since patient 65582's last urin tract infection nos diagnosis during the current hospital encounter. | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'urin tract infection nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm... |
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... | what is admission location and admission time of subject id 45962? | SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "45962" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.