table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_54088 (
"House Name" text,
"Composition" text,
"Named after" text,
"Founded" real,
"Colours" text
) | What colours have a House Name of ogun? | SELECT "Colours" FROM table_54088 WHERE "House Name" = 'ogun' |
CREATE TABLE table_24395 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
) | Who was the successor for the new seat? | SELECT "Successor" FROM table_24395 WHERE "Vacator" = 'New seat' |
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... | among patients who had open and other replacement of aortic valve with tissue graft, how many of them belonged to white ethnic origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft" |
CREATE TABLE table_51150 (
"Tribunal" text,
"Number of autos da f\u00e9 with known sentences" text,
"Executions in persona" text,
"Executions in effigie" text,
"Penanced" text,
"Total" text
) | How many were penanced for a total of 7666? | SELECT "Penanced" FROM table_51150 WHERE "Total" = '7666' |
CREATE TABLE table_name_15 (
player VARCHAR,
school VARCHAR
) | What is the player that is from seattle prep? | SELECT player FROM table_name_15 WHERE school = "seattle prep" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | how many patients until 4 years ago received oxygen therapy (> 60%) - 70-80% two times? | 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 = 'oxygen therapy (> 60%) - 70-80%' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 yea... |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | provide the number of private insurance patients who had incision of abdomen artery. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Abdomen artery incision" |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Pos... | List of posts with pending delete votes. | SELECT p.Id, COUNT(*) AS DelVote, p.Score AS Score, p.Id AS "post_link", CASE WHEN p.PostTypeId = 1 THEN 'Q' WHEN p.PostTypeId = 2 THEN 'A' ELSE '?' END AS Type, p.DeletionDate FROM Posts AS p JOIN Votes AS V ON v.PostId = p.Id WHERE VoteTypeId = 11 AND NOT p.DeletionDate IS NULL GROUP BY p.Id, p.PostTypeId, p.Score, p... |
CREATE TABLE table_53264 (
"NATO member" text,
"Aircraft carriers" text,
"Battleships" text,
"Cruisers" text,
"Escorts" text,
"Submarines" text,
"Torpedo boat squadrons" text,
"s Motor ship / s Naval trawler" text,
"Grand Total" real
) | How many escorts does the nation with 6 cruisers have? | SELECT "Escorts" FROM table_53264 WHERE "Cruisers" = '6' |
CREATE TABLE table_203_34 (
id number,
"season" text,
"appearance" number,
"interchange" number,
"tries" number,
"goals" number,
"f/g" number,
"points" number
) | what is the average of all 14 interchanges ? | SELECT AVG("interchange") FROM table_203_34 |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number... | when did patient 21163 have the maximum heart rate the last time on the last icu visit? | SELECT chartevents.charttime 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 = 21163) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid... |
CREATE TABLE table_name_43 (
country VARCHAR,
rank VARCHAR
) | What country was rank 4? | SELECT country FROM table_name_43 WHERE rank = "4" |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
... | What is the average age for each dorm and what are the names of each dorm Plot them as bar chart, could you rank by the dorm_name in descending? | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name DESC |
CREATE TABLE table_18893428_1 (
driver VARCHAR,
constructor VARCHAR
) | What is the total number of drivers who have cars constructed by Mercedes-Benz? | SELECT COUNT(driver) FROM table_18893428_1 WHERE constructor = "Mercedes-Benz" |
CREATE TABLE table_20056 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
) | Name the lease for when points is 19 | SELECT MIN("For") FROM table_20056 WHERE "Points" = '19' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,... | Doubts about mobile testing tools. | SELECT p.Id, p.Title, p.Tags, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.CreationDate >= '2010-01-01 23:59:00.000' AND t.TagName IN ('android-testing') |
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 prescriptions (
subject_id text,
hadm_id... | find the gender and lab test category for the patient with patient id 2560. | SELECT demographic.gender, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE table_51918 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team has a Home team score of 17.13 (115)? | SELECT "Away team" FROM table_51918 WHERE "Home team score" = '17.13 (115)' |
CREATE TABLE table_203_655 (
id number,
"goal" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what was the most goals scored in one game ? | SELECT MAX("score" + "score") FROM table_203_655 |
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 whose drug code is nado20 and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NADO20" AND lab.fluid = "Pleural" |
CREATE TABLE table_name_69 (
country VARCHAR,
transfer_window VARCHAR,
moving_from VARCHAR
) | What is the country of the player moving from belgrano with a summer transfer window? | SELECT country FROM table_name_69 WHERE transfer_window = "summer" AND moving_from = "belgrano" |
CREATE TABLE table_75393 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Score has a March larger than 15, and Points larger than 96, and a Game smaller than 76, and an Opponent of @ washington capitals? | SELECT "Score" FROM table_75393 WHERE "March" > '15' AND "Points" > '96' AND "Game" < '76' AND "Opponent" = '@ washington capitals' |
CREATE TABLE table_name_22 (
year INTEGER,
score_final VARCHAR,
rank_final VARCHAR,
competition_description VARCHAR
) | How many years have a Rank-Final smaller than 7, and a Competition Description of olympic games, and a Score-Final smaller than 186.525? | SELECT SUM(year) FROM table_name_22 WHERE rank_final < 7 AND competition_description = "olympic games" AND score_final < 186.525 |
CREATE TABLE body_builder (
Snatch INTEGER
) | What is the average snatch score of body builders? | SELECT AVG(Snatch) FROM body_builder |
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,
... | count the number of patients whose primary disease is chest pain and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND lab.fluid = "Joint Fluid" |
CREATE TABLE table_33238 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | Which city in the mideast region is the hot of Temple University? | SELECT "City" FROM table_33238 WHERE "Region" = 'mideast' AND "Host" = 'temple university' |
CREATE TABLE table_69074 (
"Episode No." real,
"Airdate" text,
"Total Viewers" real,
"Share" text,
"BBC One Weekly Ranking" real
) | What were the air-dates of the episodes before episode 4 that had a BBC One weekly ranking of 6? | SELECT "Airdate" FROM table_69074 WHERE "Episode No." < '4' AND "BBC One Weekly Ranking" = '6' |
CREATE TABLE store (
Id VARCHAR
) | How many stores are there? | SELECT COUNT(*) FROM store |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | Most frequent users of a word in comments. | SELECT UserId AS "user_link", COUNT(Id) AS "comments" FROM Comments WHERE LOWER(Text) LIKE LOWER('%##word##%') GROUP BY UserId ORDER BY COUNT(Id) DESC |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 in... | please give me round trip fares from BALTIMORE to PHILADELPHIA | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... |
CREATE TABLE table_28178756_1 (
miles__km_ VARCHAR,
year VARCHAR
) | List the numer of miles for 2010. | SELECT miles__km_ FROM table_28178756_1 WHERE year = 2010 |
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,
... | find the duration of hospital stay and admission location of mary davis. | SELECT demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.name = "Mary Davis" |
CREATE TABLE table_name_93 (
position VARCHAR,
wins VARCHAR,
season VARCHAR
) | What was his position in 2009 with 1 win? | SELECT position FROM table_name_93 WHERE wins = "1" AND season = "2009" |
CREATE TABLE table_76182 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What place has E as the to par, with Mark Wiebe as the player? | SELECT "Place" FROM table_76182 WHERE "To par" = 'e' AND "Player" = 'mark wiebe' |
CREATE TABLE table_name_75 (
laps INTEGER,
driver VARCHAR
) | What's the average laps driven by david coulthard? | SELECT AVG(laps) FROM table_name_75 WHERE driver = "david coulthard" |
CREATE TABLE table_name_66 (
home_team VARCHAR,
away_team VARCHAR
) | Who is the home team when hawthorn is the away side? | SELECT home_team FROM table_name_66 WHERE away_team = "hawthorn" |
CREATE TABLE table_name_47 (
winner VARCHAR,
win__number INTEGER
) | Who had more than 3 wins? | SELECT winner FROM table_name_47 WHERE win__number > 3 |
CREATE TABLE table_56815 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | Who is the opponent on May 7? | SELECT "Opponent" FROM table_56815 WHERE "Date" = 'may 7' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is minimum age of patients whose age is greater than or equal to 83 and days of hospital stay is 43? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "83" AND demographic.days_stay = "43" |
CREATE TABLE table_name_34 (
time VARCHAR,
rider VARCHAR
) | What time has phil mcgurk as the rider? | SELECT time FROM table_name_34 WHERE rider = "phil mcgurk" |
CREATE TABLE table_name_87 (
team VARCHAR,
time_retired VARCHAR,
grid VARCHAR
) | Name the Team which has a Time/Retired of contact, and a Grid smaller than 17? | SELECT team FROM table_name_87 WHERE time_retired = "contact" AND grid < 17 |
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, return a scatter chart about the correlation between commission_pct and manager_id . | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmoun... | All unanswered questions with exactly two specified tags. | SELECT Id AS "post_link", CreationDate, Score, Tags FROM Posts WHERE Tags IN ('<' + '##tag1:string##' + '><' + '##tag2:string##' + '>', '<' + '##tag2:string##' + '><' + '##tag1:string##' + '>') AND AnswerCount = 0 ORDER BY CreationDate DESC |
CREATE TABLE table_62660 (
"Rank" real,
"Railway Station" text,
"Annual entry/exit (millions) 2011\u201312" real,
"Annual interchanges (millions) 2011\u201312" real,
"Total Passengers (millions) 2011\u201312" real,
"Location" text,
"Number of Platforms" real
) | What rank has an annual interchange less than 1.99 million, an annual entry/exit less than 13.835 million, and more than 13.772 million total passengers? | SELECT "Rank" FROM table_62660 WHERE "Annual interchanges (millions) 2011\u201312" < '1.99' AND "Annual entry/exit (millions) 2011\u201312" < '13.835' AND "Total Passengers (millions) 2011\u201312" > '13.772' |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | How many eliminations did each team have Visualize by bar chart, I want to rank by the X-axis in descending please. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team DESC |
CREATE TABLE table_name_29 (
score VARCHAR,
golden_point_s__scorer VARCHAR
) | What is the Score of Golden Point(s) scorer Adam Reynolds? | SELECT score FROM table_name_29 WHERE golden_point_s__scorer = "adam reynolds" |
CREATE TABLE table_28628309_6 (
average VARCHAR,
totals VARCHAR
) | How many items appear in the average column when the totals were 105-161? | SELECT COUNT(average) FROM table_28628309_6 WHERE totals = "105-161" |
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 demographic ... | how many patients died? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" |
CREATE TABLE table_name_35 (
finish VARCHAR,
record VARCHAR
) | Which finish has a Record of 74-68? | SELECT finish FROM table_name_35 WHERE record = "74-68" |
CREATE TABLE table_204_854 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"notes" text
) | what location hosted more , osaka or tokyo ? | SELECT "location" FROM table_204_854 WHERE "location" IN ('osaka', 'tokyo') GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | when did patient 031-9128 first get sputum, tracheal specimen microbiology test until 12/2104? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'sputum, tracheal specimen... |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
S... | Visualize a bar chart for what is the average age for each dorm and what are the names of each dorm?, and could you show Y-axis from high to low order please? | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age) DESC |
CREATE TABLE table_39116 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the smallest number of drawn games when there are fewer than 4 points and more than 4 lost games? | SELECT MIN("Drawn") FROM table_39116 WHERE "Points" < '4' AND "Lost" > '4' |
CREATE TABLE table_11094 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | What is the date the new york giants were the visiting team and the Final Score was 37-34? | SELECT "Date" FROM table_11094 WHERE "Visiting Team" = 'new york giants' AND "Final Score" = '37-34' |
CREATE TABLE journal_committee (
Editor_ID VARCHAR
)
CREATE TABLE editor (
Name VARCHAR,
Editor_ID VARCHAR
) | Show the names of editors that are on at least two journal committees. | SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2 |
CREATE TABLE table_35904 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | On what Date was Patty Sheehan Runner(s)-up? | SELECT "Date" FROM table_35904 WHERE "Runner(s)-up" = 'patty sheehan' |
CREATE TABLE table_61785 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the minimum grid when there was more than 22 laps? | SELECT MIN("Grid") FROM table_61785 WHERE "Laps" > '22' |
CREATE TABLE table_name_14 (
gold INTEGER,
total INTEGER
) | What is the sum of Gold, when Total is less than 1? | SELECT SUM(gold) FROM table_name_14 WHERE total < 1 |
CREATE TABLE table_622 (
"Leg" text,
"Stage" text,
"Time (EEST)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
) | What is the number of leg for ss17 | SELECT COUNT("Leg") FROM table_622 WHERE "Stage" = 'SS17' |
CREATE TABLE table_19948664_1 (
index__year_ VARCHAR,
author___editor___source VARCHAR,
ranking_la__2_ VARCHAR
) | What index was created by the United Nations (UNDP) and reached 2nd place in the LA Ranking? | SELECT index__year_ FROM table_19948664_1 WHERE author___editor___source = "United Nations (UNDP)" AND ranking_la__2_ = "2nd" |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | Draw a bar chart that counts the number of venues of each workshop. | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what is two year survival rate of patients diagnosed with compl kidney transplant? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... |
CREATE TABLE table_name_66 (
date VARCHAR,
versus VARCHAR,
wicket VARCHAR
) | What is the date of the game against South Africa and 2nd wickets? | SELECT date FROM table_name_66 WHERE versus = "south africa" AND wicket = "2nd" |
CREATE TABLE table_55464 (
"Class" text,
"Wheels" text,
"Date" text,
"Builder" text,
"No. Built" real
) | Which Builder has a Class of Terrier? | SELECT "Builder" FROM table_55464 WHERE "Class" = 'terrier' |
CREATE TABLE table_204_865 (
id number,
"date" text,
"tournament" text,
"winner" text,
"purse ($)" number,
"notes" text
) | who was the previous tournament winner before andres romero at the september 29 salta open ? | SELECT "winner" FROM table_204_865 WHERE "date" < (SELECT "date" FROM table_204_865 WHERE "winner" = 'andres romero') ORDER BY "date" DESC LIMIT 1 |
CREATE TABLE table_74960 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Score has an Opponent of melanie south? | SELECT "Score" FROM table_74960 WHERE "Opponent" = 'melanie south' |
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,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | What 's easier out of these two : EECS 101 or EECS 510 ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 101 OR course.number = 510) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of price , and group by attribute name, could you display in asc by the bars? | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
CREATE TABLE table_name_84 (
album VARCHAR,
label VARCHAR
) | Which Album has a Label of tumbleweed 1014? | SELECT album FROM table_name_84 WHERE label = "tumbleweed 1014" |
CREATE TABLE table_name_51 (
name VARCHAR,
round VARCHAR,
position VARCHAR
) | Which name had more than 5 rounds and was a defensive end? | SELECT name FROM table_name_51 WHERE round > 5 AND position = "defensive end" |
CREATE TABLE table_name_58 (
away_team VARCHAR,
venue VARCHAR
) | What did the away team score at corio oval? | SELECT away_team AS score FROM table_name_58 WHERE venue = "corio oval" |
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,... | calculate the number of patients who received a microbiology blood, venipuncture test in 2104. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND STRFTIME('%y', microlab.culturetakentime) = '2104') |
CREATE TABLE table_27700530_15 (
series VARCHAR,
game VARCHAR
) | What was the series record at after game 3? | SELECT series FROM table_27700530_15 WHERE game = 3 |
CREATE TABLE table_17532 (
"Number" real,
"Name" text,
"Titles" text,
"Date" text,
"Opponent" text,
"Result" text,
"Defenses" real
) | How many opponents fought on 1982-12-03? | SELECT COUNT("Opponent") FROM table_17532 WHERE "Date" = '1982-12-03' |
CREATE TABLE table_38458 (
"Model" text,
"Min. capacity (mAh)" text,
"Typ. capacity (mAh)" text,
"Capacity after first day" text,
"After 1 year" text,
"After 2 years" text,
"After 3 years" text,
"After 5 years" text
) | Which After 1 year has an After 3 years of 80%? | SELECT "After 1 year" FROM table_38458 WHERE "After 3 years" = '80%' |
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,
... | how many patients born before the year 2074 had an elective admission type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2074" |
CREATE TABLE table_17861265_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who was the episode writer when the viewers reached 3.03 million in the US? | SELECT written_by FROM table_17861265_1 WHERE us_viewers__million_ = "3.03" |
CREATE TABLE table_65576 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | What is the IHSAA class of the school with less than 400 students and a mascot of the Tigers? | SELECT "IHSAA Class" FROM table_65576 WHERE "Size" < '400' AND "Mascot" = 'tigers' |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | Are there 2 or 3 lectures in 543 per week ? | 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 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 of the patients receiving tacrolimus remained admitted in the hospital for more than 10 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "10" AND prescriptions.drug = "Tacrolimus" |
CREATE TABLE table_44519 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What is Nationality, when College/Junior/Club Team (League) is 'Guelph Storm ( OHL )'? | SELECT "Nationality" FROM table_44519 WHERE "College/Junior/Club Team (League)" = 'guelph storm ( ohl )' |
CREATE TABLE table_name_4 (
player VARCHAR,
club_province VARCHAR,
caps VARCHAR,
position VARCHAR
) | Which Ulster player has fewer than 49 caps and plays the wing position? | SELECT player FROM table_name_4 WHERE caps < 49 AND position = "wing" AND club_province = "ulster" |
CREATE TABLE table_77252 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | what is the margin of victory when the runner-up is amy alcott and the winning score is 9 (72-68-67=207)? | SELECT "Margin of victory" FROM table_77252 WHERE "Runner(s)-up" = 'amy alcott' AND "Winning score" = '–9 (72-68-67=207)' |
CREATE TABLE table_17325937_8 (
high_assists VARCHAR,
team VARCHAR
) | How many assists were made in the game against San Antonio? | SELECT COUNT(high_assists) FROM table_17325937_8 WHERE team = "San Antonio" |
CREATE TABLE table_204_634 (
id number,
"tour" number,
"official title" text,
"venue" text,
"city" text,
"date\nstart" text,
"date\nfinish" text,
"prize money\nusd" number,
"report" text
) | how many tours took place during january ? | SELECT COUNT("official title") FROM table_204_634 WHERE "date\nstart" = 1 |
CREATE TABLE table_name_27 (
away_team VARCHAR,
tie_no VARCHAR
) | Which away team that had a tie of 7? | SELECT away_team FROM table_name_27 WHERE tie_no = "7" |
CREATE TABLE table_37723 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Points" text,
"Position" text
) | What is the fewest number of wins when he has 3 poles in 2010? | SELECT MIN("Wins") FROM table_37723 WHERE "Poles" = '3' AND "Season" = '2010' |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | Show me the proportion on how many eliminations did each team have? | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team |
CREATE TABLE table_name_15 (
no_7 VARCHAR,
no_4 VARCHAR,
no_10 VARCHAR
) | What is No. 7, when No. 4 is Madison, and when No. 10 is Amelia? | SELECT no_7 FROM table_name_15 WHERE no_4 = "madison" AND no_10 = "amelia" |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid ... | papers in semantic parsing for each year | SELECT DISTINCT COUNT(paper.paperid), paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.year ORDER BY paper.year DESC |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | give me the number of patients whose death status is 0 and lab test name is ck-mb index? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "CK-MB Index" |
CREATE TABLE table_50880 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the highest Grid with a time of +1:19.905, and less than 20 laps? | SELECT MAX("Grid") FROM table_50880 WHERE "Time" = '+1:19.905' AND "Laps" < '20' |
CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
) | how many different poll companies are represented ? | SELECT COUNT(DISTINCT "poll company") FROM table_204_639 |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Users with the most edits of other users' posts in 2017. | SELECT a.UserId AS "user_link", COUNT(a.PostId) AS "Count", a.UserId AS "UserId" FROM PostHistory AS a INNER JOIN Posts AS b ON a.PostId = b.Id WHERE a.PostHistoryTypeId = 5 AND b.CreationDate < '2018-01-01' AND a.CreationDate >= '2017-01-01' GROUP BY a.UserId ORDER BY COUNT(a.PostId) DESC |
CREATE TABLE table_name_2 (
_m__best_ VARCHAR,
_fairest VARCHAR,
president VARCHAR,
_m__coach VARCHAR
) | Who was the (M) Best & Fairest when ray kaduck was president and richard keane was coach? | SELECT _m__best_ & _fairest FROM table_name_2 WHERE president = "ray kaduck" AND _m__coach = "richard keane" |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | Tag badges per question for each year. | SELECT YearBadges.Y, NumBadges, NumQuestions, CAST(NumQuestions AS FLOAT) / CAST(NumBadges AS FLOAT) AS Ratio FROM (SELECT COUNT(Id) AS NumBadges, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND B.Class = '##BadgeClass##' GROUP BY YEAR(Date)) AS YearBadges INNER JOIN (SELECT COUNT(P... |
CREATE TABLE table_66164 (
"Rank:" real,
"Premier:" text,
"Party:" text,
"Assumed Office:" text,
"Left Office:" text,
"TOTAL Time in Office:" text
) | what is the premier when the assumed office is 14 april 1894? | SELECT "Premier:" FROM table_66164 WHERE "Assumed Office:" = '14 april 1894' |
CREATE TABLE table_44113 (
"Year" real,
"Regional GVA" real,
"Agriculture" real,
"Industry" real,
"Services" real
) | What is the average Services, when Year is greater than 2003, when Industry is greater than 1,465, and when Regional GVA is greater than 9,432? | SELECT AVG("Services") FROM table_44113 WHERE "Year" > '2003' AND "Industry" > '1,465' AND "Regional GVA" > '9,432' |
CREATE TABLE ref_service_types (
service_type_code text,
parent_service_type_code text,
service_type_description text
)
CREATE TABLE performers (
performer_id number,
address_id number,
customer_name text,
customer_phone text,
customer_email_address text,
other_details text
)
CREAT... | What are the different product names? What is the average product price for each of them? | SELECT product_name, AVG(product_price) FROM products GROUP BY product_name |
CREATE TABLE table_22815568_6 (
status VARCHAR,
poverty_rate VARCHAR
) | What is the status if the poverty rate is 11.4%? | SELECT status FROM table_22815568_6 WHERE poverty_rate = "11.4%" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.