table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_92 (
points VARCHAR,
highest_position VARCHAR,
position VARCHAR
) | What is the number of points associated with the highest position under 9 and a current position of 22? | SELECT points FROM table_name_92 WHERE highest_position < 9 AND position = 22 |
CREATE TABLE project_outcomes (
project_id number,
outcome_code text,
outcome_details text
)
CREATE TABLE projects (
project_id number,
organisation_id number,
project_details text
)
CREATE TABLE document_types (
document_type_code text,
document_description text
)
CREATE TABLE tasks ... | How many tasks are there in total? | SELECT COUNT(*) FROM tasks |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | How many users in given tag have bigger reputation than. | SELECT COUNT(DISTINCT u.Id) FROM Users AS u, Posts AS p, PostTags AS pt, Tags AS t WHERE p.OwnerUserId = u.Id AND pt.PostId = p.Id AND pt.TagId = t.Id AND t.TagName = @Tag AND u.Reputation > @Reputation |
CREATE TABLE table_name_75 (
tournament VARCHAR,
winner VARCHAR
) | What tournament did Nadal win and had a nadal of 16? | SELECT tournament FROM table_name_75 WHERE winner = "nadal" AND "nadal" = 16 |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | BIT 311 contains how many sections ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BIT' AND course.number = 311 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
CREATE TABLE Student (
fname VARCHAR,
age VARCHAR,
StuID VARCHAR,
SportName VARCHAR
)
CREATE TABLE Sportsinfo (
fname VARCHAR,
age VARCHAR,
StuID VARCHAR,
SportName VARCHAR
) | Find the first name and age of the students who are playing both Football and Lacrosse. | SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = "Lacrosse") |
CREATE TABLE table_36551 (
"Year" real,
"Title" text,
"Format" text,
"Label" text,
"Catalogno" text,
"Remark" text
) | What year was remark #104 us? | SELECT "Year" FROM table_36551 WHERE "Remark" = '#104 us' |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Is there a class about Physiology Masters Research Capstone ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Physiology Masters Research Capstone%' OR name LIKE '%Physiology Masters Research Capstone%') AND department = 'EECS' |
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,
... | report the number of patients who had ureteral catheterization and have been hospitalized for more than 11 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "11" AND procedures.long_title = "Ureteral catheterization" |
CREATE TABLE table_78855 (
"Year" real,
"Award Ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
) | What year was Mary Elizabeth Mastrantonio nominated? | SELECT "Year" FROM table_78855 WHERE "Nominee" = 'mary elizabeth mastrantonio' |
CREATE TABLE table_68932 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
) | Name the opponent with round of 1 and time of n/a | SELECT "Opponent" FROM table_68932 WHERE "Round" = '1' AND "Time" = 'n/a' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what were the top five most common procedures that followed during the same month for patients that received a insert endotracheal tube in 2102? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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 = admi... |
CREATE TABLE table_11796 (
"Team" text,
"Seasons" text,
"Regular season" real,
"Tournament" real,
"Total" real
) | Name the average total for tournament less than 0 | SELECT AVG("Total") FROM table_11796 WHERE "Tournament" < '0' |
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
)
... | how many patients discharged to home are diagnosed with anxiety state, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME" AND diagnoses.long_title = "Anxiety state, unspecified" |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | whats the sex of patient 53176? | SELECT patients.gender FROM patients WHERE patients.subject_id = 53176 |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many days have passed since patient 006-133605 received his or her first enteral tube intake: nasoduodenal nostril, r 10 intake on the current intensive care unit visit? | SELECT 1 * (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 course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | What are the courses that are needed to major but not in the EDCURINS department ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'EDCURINS' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | how many patients in this year had a bone marrow microbiology test taken? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'bone marrow' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
CREATE TABLE table_name_26 (
rank INTEGER
) | What is the average 1st place with a Rank that is larger than 10? | SELECT AVG(1 AS st_place) FROM table_name_26 WHERE rank > 10 |
CREATE TABLE table_202_75 (
id number,
"award" text,
"category" text,
"recipients and nominees" text,
"result" text
) | how many awards was warren beatty nominated for ? | SELECT COUNT("award") FROM table_202_75 WHERE "recipients and nominees" = 'warren beatty' |
CREATE TABLE table_name_2 (
judaism VARCHAR,
christianity VARCHAR
) | What is the percentage of Judaism associated with Christianity at 2.51%? | SELECT judaism FROM table_name_2 WHERE christianity = "2.51%" |
CREATE TABLE table_47715 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text,
"Location" text
) | Which round has a time of 3:01? | SELECT "Round" FROM table_47715 WHERE "Time" = '3:01' |
CREATE TABLE table_204_476 (
id number,
"name" text,
"date built" number,
"builder" text,
"works no." number,
"wheels" text,
"cylinders" text,
"notes" text,
"withdrawn" number
) | what name is listed after spider ? | SELECT "name" FROM table_204_476 WHERE id = (SELECT id FROM table_204_476 WHERE "name" = 'spider') + 1 |
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 PostHistory (
Id number,
PostHistoryT... | Posts user has upvoted between 3 and 6 months ago.. | SELECT P.Id AS "post_link", Tags FROM Posts AS P INNER JOIN Votes AS V ON P.Id = V.PostId WHERE VoteTypeId = 2 AND V.UserId = '##userid:int##' AND V.CreationDate BETWEEN DATEADD(m, -6, GETDATE()) AND DATEADD(m, -3, GETDATE()) |
CREATE TABLE table_79584 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the sum of losses for Against values over 1510? | SELECT SUM("Losses") FROM table_79584 WHERE "Against" > '1510' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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... | how many hours have passed since patient 12726 was admitted to hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 12726 AND admissions.dischtime IS NULL |
CREATE TABLE table_name_16 (
home_team VARCHAR,
venue VARCHAR
) | Which team plays home in western oval venue? | SELECT home_team FROM table_name_16 WHERE venue = "western oval" |
CREATE TABLE table_6312 (
"Model" text,
"Codename" text,
"Capacities (GB)" text,
"NAND type" text,
"Interface" text,
"Form factor" text,
"Controller" text,
"Seq. read/write MB/s" text,
"Rnd 4KB read/write IOPS (K)" text,
"Introduced" text
) | Which value for Form factor has Sandforce with Capacity 80/120/180/240/360/480 introduced in July 2013? | SELECT "Form factor" FROM table_6312 WHERE "Controller" = 'sandforce' AND "Capacities (GB)" = '80/120/180/240/360/480' AND "Introduced" = 'july 2013' |
CREATE TABLE table_204_586 (
id number,
"game" number,
"date" text,
"team" text,
"score" text,
"high points" text,
"high rebounds" text,
"high assists" text,
"location\nattendance" text,
"record" text
) | who had the highest number of assists in the october 19th game ? | SELECT "high assists" FROM table_204_586 WHERE "date" = 'october 19' |
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,
... | let me know the marital status and the health insurance by which patient with patient id 3284 is covered. | SELECT demographic.marital_status, demographic.insurance FROM demographic WHERE demographic.subject_id = "3284" |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,... | Find all answers by user to questions with specific tag. | SELECT a.ParentId AS "post_link", q.Tags, a.Score FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserID##' AND q.Tags LIKE '%<##TagName##>%' ORDER BY a.Score DESC |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | Bar chart of how many openning year from each openning year, and could you show in descending by the bars? | SELECT Openning_year, COUNT(Openning_year) FROM cinema GROUP BY Openning_year ORDER BY Openning_year DESC |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE teaches... | What is the relationship between average and greatest capacity for rooms in each building? Show me a scatter chart. | SELECT MAX(capacity), AVG(capacity) FROM classroom GROUP BY building |
CREATE TABLE table_name_5 (
rider VARCHAR,
grid VARCHAR
) | WHAT IS THE RIDER WITH A 21 GRID? | SELECT rider FROM table_name_5 WHERE grid = "21" |
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested in... | Return a bar chart showing the number of schools in each county, order X in ascending order. | SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY County |
CREATE TABLE table_1473672_7 (
pick__number VARCHAR,
player VARCHAR
) | How many players had been drafted in front of Yves archambault | SELECT pick__number FROM table_1473672_7 WHERE player = "Yves Archambault" |
CREATE TABLE table_51880 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"R 54" text,
"R 53" text,
"R 52" text,
"R 51" text
) | Name the D 42 which has a D 46 of r 26 | SELECT "D 42" FROM table_51880 WHERE "D 46" = 'r 26' |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Are any of the courses I 've taken among the hardest courses in the YIDDISH department ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'YIDDISH' AND program_course.workload = (SELECT M... |
CREATE TABLE school (
school_id number,
school text,
location text,
enrollment number,
founded number,
denomination text,
boys_or_girls text,
day_or_boarding text,
year_entered_competition number,
school_colors text
)
CREATE TABLE school_details (
school_id number,
nickn... | Which schools do not have any player? Give me the school locations. | SELECT location FROM school WHERE NOT school_id IN (SELECT school_id FROM player) |
CREATE TABLE table_20499 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | Name the least position | SELECT MIN("Position") FROM table_20499 |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Plot mean meter 100 by grouped by meter 200 as a bar graph, and order in ascending by the meter_200. | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE ... | give me information on flights from ATLANTA to WASHINGTON on wednesday after 1600 and thursday before 900 | 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, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... |
CREATE TABLE table_2450 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the regular season for 2005 | SELECT "Regular Season" FROM table_2450 WHERE "Year" = '2005' |
CREATE TABLE table_name_2 (
game VARCHAR,
date VARCHAR
) | Which game was on September 12? | SELECT game FROM table_name_2 WHERE date = "september 12" |
CREATE TABLE table_name_62 (
year__ceremony_ VARCHAR,
result VARCHAR,
film_title_used_in_nomination VARCHAR
) | What year has a not nominated result and a nomination title of 'the color of fame'? | SELECT year__ceremony_ FROM table_name_62 WHERE result = "not nominated" AND film_title_used_in_nomination = "the color of fame" |
CREATE TABLE table_79612 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | When the total is larger than 1,and the bronze is less than 3, and silver larger than 2, and a gold larger than 2, what is the nation? | SELECT "Nation" FROM table_79612 WHERE "Total" > '1' AND "Bronze" < '3' AND "Silver" > '2' AND "Gold" > '2' |
CREATE TABLE table_203_439 (
id number,
"pos." number,
"rider" text,
"semi-final points" number,
"final points" number,
"final heats" text,
"total points" number
) | the average number of points | SELECT AVG("total points") FROM table_203_439 |
CREATE TABLE table_66385 (
"Year" real,
"Gross Domestic Product" real,
"US Dollar Exchange" text,
"Inflation Index (2000=100)" real,
"Per Capita Income (as % of USA)" real
) | Which Inflation Index (2000=100) has a Per Capita Income (as % of USA) of 10.65, and a Year smaller than 1990? | SELECT MAX("Inflation Index (2000=100)") FROM table_66385 WHERE "Per Capita Income (as % of USA)" = '10.65' AND "Year" < '1990' |
CREATE TABLE table_name_12 (
record VARCHAR,
score VARCHAR,
visitor VARCHAR
) | What is the Record with a Score with 80 87, and a Visitor with bucks? | SELECT record FROM table_name_12 WHERE score = "80–87" AND visitor = "bucks" |
CREATE TABLE table_256862_1 (
winning_yacht VARCHAR,
entries VARCHAR
) | Name the wininng yacht for 14 entries | SELECT winning_yacht FROM table_256862_1 WHERE entries = "14" |
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, return a bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, list in asc by the X. | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter |
CREATE TABLE table_33573 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the home team when hawthorn is the away side? | SELECT "Home team" FROM table_33573 WHERE "Away team" = 'hawthorn' |
CREATE TABLE table_name_72 (
fumb_td INTEGER,
int_td VARCHAR,
fumb_f VARCHAR
) | Which Fumb TD has an Int TD of 1, and a Fumb F. smaller than 1? | SELECT MIN(fumb_td) FROM table_name_72 WHERE int_td = 1 AND fumb_f < 1 |
CREATE TABLE table_204_538 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text
) | what was the fastest car ? | SELECT "car" FROM table_204_538 ORDER BY "pos." LIMIT 1 |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREA... | Who are Daphne Koller 's coauthors | 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 = 'Daphne Koller' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid |
CREATE TABLE table_name_74 (
away_team VARCHAR
) | What is the away team's score when footscray is the away team? | SELECT away_team AS score FROM table_name_74 WHERE away_team = "footscray" |
CREATE TABLE table_1302886_1 (
kerry_number VARCHAR,
county VARCHAR
) | In cook county Kerry# is? | SELECT kerry_number FROM table_1302886_1 WHERE county = "Cook" |
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 prescriptions... | find the maximum age of male patients whose discharge location is snf. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "SNF" |
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 demographic ... | what is minimum age of patients whose ethnicity is black/cape verdean and days of hospital stay is 9? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay = "9" |
CREATE TABLE table_40516 (
"Date" real,
"Doubles, I Class" real,
"Doubles, II Class" real,
"Greater Doubles" real,
"Doubles" real,
"Semidoubles" real,
"Total" real
) | What is the lowest Date, when Doubles, II Class is 18, and when Total is less than 164? | SELECT MIN("Date") FROM table_40516 WHERE "Doubles, II Class" = '18' AND "Total" < '164' |
CREATE TABLE table_19260_1 (
total VARCHAR,
_percentage_core_moldova VARCHAR
) | Name the total for % core moldova for 4.36% | SELECT total FROM table_19260_1 WHERE _percentage_core_moldova = "4.36_percentage" |
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number ... | What is the name of the deparment with the highest enrollment? | SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_33585 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"In office" text
) | In which state is the Petrie electorate? | SELECT "State" FROM table_33585 WHERE "Electorate" = 'petrie' |
CREATE TABLE table_name_41 (
games VARCHAR,
tied VARCHAR,
goals_against VARCHAR
) | How many games had a tied less 15 with goals against being fewer than 186? | SELECT COUNT(games) FROM table_name_41 WHERE tied < 15 AND goals_against < 186 |
CREATE TABLE table_204_585 (
id number,
"year" text,
"player" text,
"high school" text,
"college" text,
"nba/aba draft" text
) | how many went to cincinnati ? | SELECT COUNT(*) FROM table_204_585 WHERE "college" = 'cincinnati' |
CREATE TABLE table_959 (
"Season" text,
"Regionalliga S\u00fcd" text,
"Regionalliga West/S\u00fcdwest" text,
"Regionalliga Nord" text,
"Regionalliga Nord-Ost" text
) | what's the season with regionalliga west/s dwest being arminia bielefeld | SELECT "Season" FROM table_959 WHERE "Regionalliga West/S\u00fcdwest" = 'Arminia Bielefeld' |
CREATE TABLE table_name_66 (
height__cm_ INTEGER,
birthdate VARCHAR,
weight__kg_ VARCHAR,
position VARCHAR
) | What is the average Height when the weight is less than 91 and the position is d, and a Birthdate of july 4, 1975? | SELECT AVG(height__cm_) FROM table_name_66 WHERE weight__kg_ < 91 AND position = "d" AND birthdate = "july 4, 1975" |
CREATE TABLE table_54347 (
"Dismissals" text,
"Player" text,
"Versus" text,
"Venue" text,
"Date" text
) | What is the Dismissals with a Player with source: cricinfo.com? | SELECT "Dismissals" FROM table_54347 WHERE "Player" = 'source: cricinfo.com' |
CREATE TABLE table_name_84 (
floors INTEGER,
name VARCHAR
) | Which Floors is the highest one that has a Name of one indiana square? | SELECT MAX(floors) FROM table_name_84 WHERE name = "one indiana square" |
CREATE TABLE table_name_48 (
team_wins INTEGER,
nation VARCHAR,
individual_wins VARCHAR
) | Which Team Win is from sweden and has a Individual win smaller than 1 | SELECT MAX(team_wins) FROM table_name_48 WHERE nation = "sweden" AND individual_wins < 1 |
CREATE TABLE table_203_724 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many nations earned no bronze medals ? | SELECT COUNT("nation") FROM table_203_724 WHERE "bronze" = 0 |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | Draw a scatter chart about the correlation between Height and Weight . | SELECT Height, Weight FROM people |
CREATE TABLE table_30273 (
"Series no." real,
"Season no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | how many people wrote the episode directed by rob schrab? | SELECT COUNT("Written by") FROM table_30273 WHERE "Directed by" = 'Rob Schrab' |
CREATE TABLE table_17509 (
"Overall Pick #" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position does the Cincinnati Bengals' player have? | SELECT "Position" FROM table_17509 WHERE "AFL Team" = 'Cincinnati Bengals' |
CREATE TABLE table_21327 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | Who was the oppenent what the score was L 68-60? | SELECT "Opponent" FROM table_21327 WHERE "Score" = 'L 68-60' |
CREATE TABLE table_3593 (
"Team" text,
"Manager" text,
"Chairman" text,
"Team captain" text,
"Kit maker" text,
"Sponsor" text
) | Who is the captain of Dave Jones' team? | SELECT "Team captain" FROM table_3593 WHERE "Manager" = 'Dave Jones' |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 o... | what is the name of a procedure that patient 24547 has been given for two times in 09/2104? | 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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 245... |
CREATE TABLE table_name_98 (
top_5 INTEGER,
events VARCHAR,
top_25 VARCHAR
) | Tell me the sum of top 5 with events less than 12 and top 25 less than 0 | SELECT SUM(top_5) FROM table_name_98 WHERE events < 12 AND top_25 < 0 |
CREATE TABLE table_74833 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Name the total number of round for wide receiver for kent state | SELECT COUNT("Round") FROM table_74833 WHERE "Position" = 'wide receiver' AND "College" = 'kent state' |
CREATE TABLE table_203_843 (
id number,
"record" text,
"date and time" text,
"competition" text,
"home or away" text,
"opponent" text,
"score" text
) | what was the first record broken ? | SELECT "record" FROM table_203_843 WHERE id = 1 |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_i... | is there any results of the microbiology test carried out for patient 96404 in 10/last year? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96404) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microbiologyevents.chartti... |
CREATE TABLE table_29458735_5 (
county VARCHAR,
division VARCHAR,
regiment VARCHAR
) | what is he name of the county where the 2nd division and the 41st regiment was | SELECT county FROM table_29458735_5 WHERE division = "2nd division" AND regiment = "41st regiment" |
CREATE TABLE table_36267 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Asian rider classification" text,
"Team classification" text,
"Asian team classification" text
) | WHich Mountains classification has an Asian team classification of seoul cycling team, and a Winner of alexandre usov? | SELECT "Mountains classification" FROM table_36267 WHERE "Asian team classification" = 'seoul cycling team' AND "Winner" = 'alexandre usov' |
CREATE TABLE table_name_43 (
year_built VARCHAR,
location_of_the_church VARCHAR
) | When was the church in Arnafjord built? | SELECT year_built FROM table_name_43 WHERE location_of_the_church = "arnafjord" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | How many patients were born before the year 2114 and survived? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2114" |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the four most commonly prescribed drugs since 1 year ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4 |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0... | For those employees who was hired before 2002-06-21, show me about the change of department_id over hire_date in a line chart. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' |
CREATE TABLE table_10342194_3 (
total_amount_of_trees INTEGER,
district VARCHAR
) | What is the total amount of trees when district is leninsky? | SELECT MAX(total_amount_of_trees) FROM table_10342194_3 WHERE district = "Leninsky" |
CREATE TABLE table_52629 (
"Week" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Time" text,
"Attendance" text
) | Name the opponent that has attendance of 76,965 | SELECT "Opponent" FROM table_52629 WHERE "Attendance" = '76,965' |
CREATE TABLE table_name_72 (
points INTEGER,
entrant VARCHAR,
year VARCHAR,
engine VARCHAR
) | What is Brown Motors best point total using the Offenhauser L4 engine since 1950? | SELECT MAX(points) FROM table_name_72 WHERE year > 1950 AND engine = "offenhauser l4" AND entrant = "brown motors" |
CREATE TABLE table_name_50 (
surface VARCHAR,
date VARCHAR
) | What was the surface for the game that was played on 12-Apr-2005? | SELECT surface FROM table_name_50 WHERE date = "12-apr-2005" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | in this year, what are the top four most frequent specimen tests ordered for patients within 2 months after diagnosis of hypocalcemia? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypocalcemia' AND DATETIME(diagnosis.diagnos... |
CREATE TABLE happy_hour_member (
hh_id number,
member_id number,
total_amount number
)
CREATE TABLE member (
member_id number,
name text,
membership_card text,
age number,
time_of_purchase number,
level_of_membership number,
address text
)
CREATE TABLE happy_hour (
hh_id nu... | Give me the names of members whose address is in Harford or Waterbury. | SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury' |
CREATE TABLE table_29736 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what is the date of the game 23? | SELECT "Date" FROM table_29736 WHERE "Game" = '23' |
CREATE TABLE table_204_833 (
id number,
"game" number,
"date" text,
"team" text,
"score" text,
"high points" text,
"high rebounds" text,
"high assists" text,
"location\nattendance" text,
"record" text
) | how many points did the nuggets win by on april 9 ? | SELECT "score" - "score" FROM table_204_833 WHERE "date" = 'april 9' |
CREATE TABLE table_name_46 (
seats_2010 INTEGER,
in_de_creased_by VARCHAR,
seats_2005 VARCHAR,
governorate VARCHAR
) | Name the lowest Seats 2010 which has Seats 2005 smaller than 9, and a Governorate of al muthanna governorate, and an In/de-creased by larger than 2? | SELECT MIN(seats_2010) FROM table_name_46 WHERE seats_2005 < 9 AND governorate = "al muthanna governorate" AND in_de_creased_by > 2 |
CREATE TABLE table_11094950_1 (
conference VARCHAR,
team VARCHAR
) | What conference was the churchill chargers team in? | SELECT conference FROM table_11094950_1 WHERE team = "Churchill Chargers" |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | What is the average salary for each job title Show bar chart, and show y-axis in desc order please. | SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY) DESC |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
star... | In the Winter period , are there special topic classes available ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... |
CREATE TABLE table_39596 (
"Name" text,
"Dist. from Origin" text,
"Dist. from Terminus" text,
"Speed Limit" text,
"Location (all in Nagano )" text
) | Which location includes Sakakita BS? | SELECT "Location (all in Nagano )" FROM table_39596 WHERE "Name" = 'sakakita bs' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.