table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_59 (
rank INTEGER,
result VARCHAR,
group VARCHAR,
athlete VARCHAR
) | What is the average rank for Group A athlete Yanina Karolchyk, and a result higher than 18? | SELECT AVG(rank) FROM table_name_59 WHERE group = "a" AND athlete = "yanina karolchyk" AND result > 18 |
CREATE TABLE table_name_45 (
finish INTEGER,
start VARCHAR,
year VARCHAR,
manufacturer VARCHAR
) | What is the smallest finish time for a race where start was less than 3, buick was the manufacturer, and the race was held after 1978? | SELECT MIN(finish) FROM table_name_45 WHERE year > 1978 AND manufacturer = "buick" AND start < 3 |
CREATE TABLE table_66952 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | What division did the Nashville Metros play in during the year that they did not qualify for the Playoffs, where in the USL PDL League, and had the Regular Season 7th, Southeast? | SELECT "Division" FROM table_66952 WHERE "Playoffs" = 'did not qualify' AND "League" = 'usl pdl' AND "Regular Season" = '7th, southeast' |
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 days of hospital stay is greater than 20 and drug name is neo*iv*fat emulsion? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.drug = "NEO*IV*Fat Emulsion" |
CREATE TABLE table_238124_1 (
bleeding_time VARCHAR,
condition VARCHAR
) | What is the bleeding time for glanzmann's thrombasthenia? | SELECT bleeding_time FROM table_238124_1 WHERE condition = "Glanzmann's thrombasthenia" |
CREATE TABLE table_26464 (
"Confederation" text,
"Teams started" text,
"Teams that have secured qualification" text,
"Teams that can still qualify" text,
"Teams that have been eliminated" text,
"Remaining places in finals" text,
"Total places in finals" text,
"Qualifying start date" text... | What is the qualifying end date when the qualifying start date is qualifying start date? | SELECT "Qualifying end date" FROM table_26464 WHERE "Qualifying start date" = 'Qualifying start date' |
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 sepsis and they didn't return to the hospital in a year before within 2 months? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ... |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | For CS majors , name the classes that are available this Winter . | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem... |
CREATE TABLE table_name_34 (
score VARCHAR,
total_points VARCHAR
) | What was the score where the total points was 50? | SELECT score FROM table_name_34 WHERE total_points = 50 |
CREATE TABLE table_name_50 (
elevator VARCHAR,
elevated VARCHAR
) | What is the Elevator of the Elected Elevated on September 21, 1179? | SELECT elevator FROM table_name_50 WHERE elevated = "september 21, 1179" |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | 1) Top 15 Posts, Ranked. Show post id, FavoriteCount (use column label votes), CommentCount (label:answers), ViewCount (label: views), and title | SELECT TOP(15) AS Id, FavoriteCount AS Votes, CommentCount AS Answers, ViewCount AS Views, Title FROM Posts WHERE NOT Title IS NULL ORDER BY Score DESC |
CREATE TABLE table_69496 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | Attendance larger than 55,189 is which average game? | SELECT AVG("Game") FROM table_69496 WHERE "Attendance" > '55,189' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | during the current hospital visit how many times did patient 016-9636 get a ptt test? | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'ptt' |
CREATE TABLE table_32200 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the total overall in round 1, in which Charles White was a player? | SELECT SUM("Overall") FROM table_32200 WHERE "Player" = 'charles white' AND "Round" < '1' |
CREATE TABLE table_62659 (
"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's the lowest number of total passengers (millions) for an annual entry/exit of 36.609? | SELECT MIN("Total Passengers (millions) 2011\u201312") FROM table_62659 WHERE "Annual entry/exit (millions) 2011\u201312" = '36.609' |
CREATE TABLE table_204_416 (
id number,
"chip" text,
"flash size" text,
"eeprom" number,
"sram" number,
"frequency\n[mhz]" number,
"package" text
) | what is the flash size difference in the at90s8515 chip and the at90s4414 ? | SELECT ABS((SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s8515') - (SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s4414')) |
CREATE TABLE table_57402 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Name the score for december 5 | SELECT "Score" FROM table_57402 WHERE "Date" = 'december 5' |
CREATE TABLE table_name_29 (
crowd INTEGER,
away_team VARCHAR
) | What is the average crowd to watch Hawthorn as the away team? | SELECT AVG(crowd) FROM table_name_29 WHERE away_team = "hawthorn" |
CREATE TABLE table_name_69 (
Id VARCHAR
) | 2007 of 8 4 is involved in what 2002? | SELECT 2002 FROM table_name_69 WHERE 2007 = "8–4" |
CREATE TABLE table_17360840_9 (
attendance INTEGER,
opponent VARCHAR,
record VARCHAR
) | What was the attendance when the opposing team was the Ottawa Senators and the record was 24-35-17? | SELECT MAX(attendance) FROM table_17360840_9 WHERE opponent = "Ottawa Senators" AND record = "24-35-17" |
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 intakeoutput (
i... | when was the first time patient 013-38992 was having less than 93.0 sao2 on the current icu visit? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992') AND patient.unitdischargetime IS NULL) ... |
CREATE TABLE table_42341 (
"Year" text,
"Matches" text,
"Wins" text,
"Losses" text,
"No Result" text,
"Success Rate" text
) | what was the win for the 6 matches? | SELECT "Wins" FROM table_42341 WHERE "Matches" = '6' |
CREATE TABLE table_169766_13 (
show VARCHAR,
new_returning_same_network VARCHAR
) | Which show was sent to syndication for its new/returning/same network. | SELECT show FROM table_169766_13 WHERE new_returning_same_network = "Syndication" |
CREATE TABLE table_203_277 (
id number,
"entered" number,
"wrestler" text,
"place" text,
"eliminated by" text,
"time" text
) | how many wrestlers had a time of 6:47 ? | SELECT COUNT("wrestler") FROM table_203_277 WHERE "time" = '06:47' |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | What is the number of countries in the artist table?, I want to order from high to low by the x-axis. | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC |
CREATE TABLE table_40292 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" real,
"Result" text
) | On which week was the beatles the original artist and the order # smaller than 10? | SELECT "Week #" FROM table_40292 WHERE "Original artist" = 'the beatles' AND "Order #" < '10' |
CREATE TABLE table_52202 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | Which game did was Bud Eley a player in? | SELECT "Games" FROM table_52202 WHERE "Name" = 'bud eley' |
CREATE TABLE table_54432 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Which tournament has a 2011 of 1r? | SELECT "Tournament" FROM table_54432 WHERE "2011" = '1r' |
CREATE TABLE table_23409 (
"No. overall" text,
"No. in series" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
) | Name the number of families for uk30 | SELECT COUNT("Family/families") FROM table_23409 WHERE "No. overall" = 'UK30' |
CREATE TABLE table_name_33 (
place VARCHAR,
performance VARCHAR
) | What place had 14:11.15 as the performance? | SELECT place FROM table_name_33 WHERE performance = "14:11.15" |
CREATE TABLE table_name_18 (
purpose VARCHAR,
band VARCHAR,
frequency VARCHAR
) | Band of am, and a Frequency of 0 846 has what purpose? | SELECT purpose FROM table_name_18 WHERE band = "am" AND frequency = "0 846" |
CREATE TABLE table_23670057_5 (
current_club VARCHAR,
height__m_ VARCHAR
) | Which clubs have players with height 2.14m? | SELECT current_club FROM table_23670057_5 WHERE height__m_ = "2.14" |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity numbe... | What is the name of the dorm with both a TV Lounge and Study Room listed as amenities? | SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3... |
CREATE TABLE table_name_3 (
clubs VARCHAR,
number_of_fixtures VARCHAR
) | What is the Clubs when there are 4 for the number of fixtures? | SELECT clubs FROM table_name_3 WHERE number_of_fixtures = 4 |
CREATE TABLE people (
name VARCHAR,
height INTEGER
) | find the name of people whose height is lower than the average. | SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people) |
CREATE TABLE table_28211103_1 (
winner VARCHAR,
st_kilda_score VARCHAR
) | Who is the winner when the st kilda score is 13.10.88? | SELECT winner FROM table_28211103_1 WHERE st_kilda_score = "13.10.88" |
CREATE TABLE table_1157867_2 (
name VARCHAR,
notes VARCHAR,
builder VARCHAR
) | Which locomotives 12' x 17' are both ex-industrial and built by Manning Wardle? | SELECT name FROM table_1157867_2 WHERE notes = "Ex-industrial" AND builder = "Manning Wardle" |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE employee (
emp_num number,
em... | How many classes are professor whose last name is Graztevski has? | SELECT COUNT(*) FROM employee AS T1 JOIN class AS T2 ON T1.emp_num = T2.prof_num WHERE T1.emp_lname = 'Graztevski' |
CREATE TABLE table_2730 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had highest points in game 5? | SELECT "High points" FROM table_2730 WHERE "Game" = '5' |
CREATE TABLE table_name_26 (
record VARCHAR,
location_attendance VARCHAR
) | What was the season record when the location attendance was Air Canada Centre 19,800? | SELECT record FROM table_name_26 WHERE location_attendance = "air canada centre 19,800" |
CREATE TABLE table_name_73 (
specific_orbital_energy VARCHAR,
orbital_period VARCHAR
) | Orbital period of 89 to 128 min has what specific orbital energy? | SELECT specific_orbital_energy FROM table_name_73 WHERE orbital_period = "89 to 128 min" |
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 whose diagnoses short title is dmii oth uncntrld and drug route is pr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "DMII oth uncntrld" AND prescriptions.route = "PR" |
CREATE TABLE table_62126 (
"Player" text,
"Height" real,
"Position" text,
"Year born (Age)" text,
"Current Club" text
) | Which Current Club has a Player of bassem balaa? | SELECT "Current Club" FROM table_62126 WHERE "Player" = 'bassem balaa' |
CREATE TABLE table_name_2 (
popular_votes INTEGER,
year VARCHAR,
office VARCHAR,
percentage VARCHAR
) | How many votes for the candidate after 1992, 1.59% of the vote, and the office of us representative 4? | SELECT AVG(popular_votes) FROM table_name_2 WHERE office = "us representative 4" AND percentage = "1.59%" AND year > 1992 |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | count the number of patients who have already received the esophagoscopy nec two or more times in 2102. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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_title = 'esophagoscopy nec') A... |
CREATE TABLE table_67944 (
"Date" text,
"Round" text,
"Opponents" text,
"Result F\u2013A" text,
"Attendance" real
) | Name the attendance for 4 january 2004 | SELECT "Attendance" FROM table_67944 WHERE "Date" = '4 january 2004' |
CREATE TABLE table_17627 (
"Municipality" text,
"Population" real,
"Police officers" real,
"Residents per officer" real,
"Total costs (2005)" text,
"Cost per capita" text,
"Case burden" real,
"Crime rate per 1,000 people" real,
"Police force" text
) | What is the cost per capita in the Courtenay municipality? | SELECT "Cost per capita" FROM table_17627 WHERE "Municipality" = 'Courtenay' |
CREATE TABLE table_74129 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
) | What is the highest entry in November for the game 20? | SELECT MAX("November") FROM table_74129 WHERE "Game" = '20' |
CREATE TABLE table_1341663_11 (
result VARCHAR,
incumbent VARCHAR
) | In the race involving Billy Lee Evans as the seated Representative, was he elected again? | SELECT result FROM table_1341663_11 WHERE incumbent = "Billy Lee Evans" |
CREATE TABLE table_name_52 (
score VARCHAR,
date VARCHAR,
home VARCHAR,
visitor VARCHAR
) | Which Score has a Home of quebec nordiques, and a Visitor of vancouver blazers on february 28? | SELECT score FROM table_name_52 WHERE home = "quebec nordiques" AND visitor = "vancouver blazers" AND date = "february 28" |
CREATE TABLE table_40087 (
"Name" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
) | Which author is located in Mexico? | SELECT "Authors" FROM table_40087 WHERE "Location" = 'mexico' |
CREATE TABLE table_17001658_10 (
date VARCHAR,
team VARCHAR
) | On what date was the team Philadelphia? | SELECT date FROM table_17001658_10 WHERE team = "Philadelphia" |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory... | Retrieve Answered Questions Tagged as 'Java' Created In The Month of January 2018. | SELECT Q.Id, Q.AcceptedAnswerId, Q.CreationDate, Q.Score, Q.Body AS "Question Body", Q.Title AS "Question Title", A.Body AS "Answer Body", Q.Tags FROM Posts AS Q INNER JOIN Posts AS A ON Q.AcceptedAnswerId = A.Id WHERE Q.Tags = '<##tag?java##>' AND Q.CreationDate BETWEEN '2018-01-01' AND '2018-01-31' AND Q.Score >= 0 O... |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | Interest groups, user affinity Tagvector. | SELECT TOP(200) AS TagName, ROUND(10 * MIN(merit) * (AVG(merit) - STDEVP(merit)) / (AVG(merit) + STDEVP(merit)), 0) AS affinity_index, MAX(merit) AS mx, MIN(merit) AS mn FROM (SELECT Posts.OwnerUserId AS userId, TagName, ROUND(SQRT(COUNT(*)), 0) AS merit FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER J... |
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... | provide the number of patients whose admission year is less than 2119 and diagnoses icd9 code is 70714? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2119" AND diagnoses.icd9_code = "70714" |
CREATE TABLE table_name_49 (
year INTEGER,
city VARCHAR,
score VARCHAR
) | What is the lowest year that has chester-le-street as the city, with 345 runs as the score? | SELECT MIN(year) FROM table_name_49 WHERE city = "chester-le-street" AND score = "345 runs" |
CREATE TABLE table_46979 (
"2004/ 05" text,
"2006/ 07" text,
"2007/ 08" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | What was the 2012/13 result for the tournament that had a 2006/07 and 2007/08 finish of LQ, with the tournament not held in 2009/10? | SELECT "2012/ 13" FROM table_46979 WHERE "2007/ 08" = 'lq' AND "2006/ 07" = 'lq' AND "2009/ 10" = 'tournament not held' |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE job... | What courses that I 've taken are among the hardest in the AAPTIS 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 = 'AAPTIS' AND program_course.workload = (SELECT MA... |
CREATE TABLE table_name_5 (
sales__billion_ INTEGER,
company VARCHAR,
profits__billion_$_ VARCHAR
) | What is the average sales in billions of walmart, which has more than 15.7 billion in profits? | SELECT AVG(sales__billion_) AS $_ FROM table_name_5 WHERE company = "walmart" AND profits__billion_$_ > 15.7 |
CREATE TABLE table_1827690_4 (
no VARCHAR,
elected VARCHAR
) | When 1462/63 was the elected what was the no.? | SELECT no FROM table_1827690_4 WHERE elected = "1462/63" |
CREATE TABLE table_name_64 (
year INTEGER,
sideline_reporter_s_ VARCHAR
) | What was the earliest year featuring Sideline reporter(s) of michelle tafoya and suzy kolber? | SELECT MIN(year) FROM table_name_64 WHERE sideline_reporter_s_ = "michelle tafoya and suzy kolber" |
CREATE TABLE table_15700367_6 (
runs_conceded VARCHAR,
name VARCHAR
) | How many runs conceded for chaminda vaas? | SELECT runs_conceded FROM table_15700367_6 WHERE name = "Chaminda Vaas" |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
di... | Show name and distance for all aircrafts. | SELECT name, distance FROM aircraft |
CREATE TABLE table_16729063_2 (
date VARCHAR,
opponent VARCHAR
) | What date was the opponent the Los Angeles Raiders? | SELECT date FROM table_16729063_2 WHERE opponent = "Los Angeles Raiders" |
CREATE TABLE table_33339 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | WHAT HOME TEAM SCORED 9.11 (65)? | SELECT "Home team" FROM table_33339 WHERE "Home team score" = '9.11 (65)' |
CREATE TABLE table_name_93 (
to_par VARCHAR,
player VARCHAR,
place VARCHAR,
country VARCHAR,
score VARCHAR
) | How far to par did ed furgol from the United States get when he scored less than 72 and was placed at t3? | SELECT to_par FROM table_name_93 WHERE country = "united states" AND score < 72 AND place = "t3" AND player = "ed furgol" |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, sort by the Y from low to high. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) |
CREATE TABLE table_61083 (
"Date of release" text,
"Title" text,
"Billboard peak" real,
"RIAA cert." text,
"Label" text
) | What label is released on September 20, 2005? | SELECT "Label" FROM table_61083 WHERE "Date of release" = 'september 20, 2005' |
CREATE TABLE table_5783 (
"Call sign" text,
"Frequency" text,
"City of License" text,
"Owner" text,
"Format" text
) | Which format is in St. George with a frequency of 0 107.3 fm? | SELECT "Format" FROM table_5783 WHERE "City of License" = 'st. george' AND "Frequency" = '0 107.3 fm' |
CREATE TABLE table_name_37 (
total INTEGER,
nation VARCHAR
) | What was the most total medals awarded to Poland? | SELECT MAX(total) FROM table_name_37 WHERE nation = "poland" |
CREATE TABLE table_name_40 (
margin INTEGER,
country VARCHAR
) | What is canada's margin? | SELECT SUM(margin) FROM table_name_40 WHERE country = "canada" |
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 with death staus 0 have been diagnosed with preterm nec1750-1999g? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Preterm NEC 1750-1999g" |
CREATE TABLE table_29533 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (millions)" text,
"Original U.S. air date" text,
"Prod. code" real
) | Name who wrote the production code 322 | SELECT "Written by" FROM table_29533 WHERE "Prod. code" = '322' |
CREATE TABLE table_15190346_2 (
stadium VARCHAR,
bowl_game VARCHAR
) | What stadium was the 1994 Gator Bowl in? | SELECT stadium FROM table_15190346_2 WHERE bowl_game = "1994 Gator Bowl" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what was the monthly average value of weight for patient 018-119251 until 11/2105? | SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-119251') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2105-11' GROUP BY STRFTIME('%y-%m', patient.... |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, order the average of department id in ascending order. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) |
CREATE TABLE table_name_58 (
interface VARCHAR,
product VARCHAR
) | What is the interface of the product xerox travel scanner 100? | SELECT interface FROM table_name_58 WHERE product = "xerox travel scanner 100" |
CREATE TABLE table_name_81 (
opposing_teams VARCHAR,
date VARCHAR
) | What is Opposing Teams, when Date is '11/10/1991'? | SELECT opposing_teams FROM table_name_81 WHERE date = "11/10/1991" |
CREATE TABLE table_203_654 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) | in 1926 brazilian football , how many teams scored above 10 points in the season ? | SELECT COUNT("team") FROM table_203_654 WHERE "points" > 10 |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | Find the states where have the colleges whose enrollments are less than the largest size. | SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college) |
CREATE TABLE table_64675 (
"Rank:" real,
"Premier:" text,
"Assumed Office:" text,
"Left Office:" text,
"TOTAL Time in Office:" text
) | What is the TOTAL Time in Office with a rank smaller than 18, and premier is Joh Bjelke-Petersen? | SELECT "TOTAL Time in Office:" FROM table_64675 WHERE "Rank:" < '18' AND "Premier:" = 'joh bjelke-petersen' |
CREATE TABLE table_24807774_1 (
bosnian VARCHAR,
cook_islands VARCHAR
) | how many bosnian in cook islands is sri lankan | SELECT bosnian FROM table_24807774_1 WHERE cook_islands = "Sri Lankan" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | when was patient 85131 prescribed the drug neo*iv*chlorothiazide and d5w at the same time for the last time until 19 months ago? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'neo*iv*chlorothiazide' AND admissions.subject_id = 85131 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-19 mon... |
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER... | A bar chart about what are the different product names? What is the average product price for each of them?, sort X from low to high order. | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name by a bar chart, could you show in desc by the Y-axis? | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC |
CREATE TABLE table_name_75 (
area_km_2 INTEGER,
official_name VARCHAR
) | Can you tell me the sum of Area km 2 that has the Official Name of glenelg? | SELECT SUM(area_km_2) FROM table_name_75 WHERE official_name = "glenelg" |
CREATE TABLE table_1974545_3 (
basketball_arena VARCHAR,
capacity VARCHAR
) | How many basketball arenas are there that belong to a school with a capacity of 3,000? | SELECT COUNT(basketball_arena) FROM table_1974545_3 WHERE capacity = "3,000" |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE enroll (
class_code text,
stu_n... | Find the first names and offices of all professors sorted by alphabetical order of their first name. | SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname |
CREATE TABLE table_11750 (
"Town/City" text,
"Population" real,
"Operator" text,
"First year" real,
"Duration" text
) | What is Ivaipor , pr's biggest population? | SELECT MAX("Population") FROM table_11750 WHERE "Town/City" = 'ivaiporã, pr' |
CREATE TABLE table_204_986 (
id number,
"#" number,
"event year" number,
"season" text,
"flag bearer" text
) | who was the first samoan flag bearer at the olympic games ? | SELECT "flag bearer" FROM table_204_986 ORDER BY "event year" LIMIT 1 |
CREATE TABLE table_name_62 (
gold INTEGER,
rank VARCHAR,
silver VARCHAR
) | What shows for gold when the rank is less than 3, and silver less than 1? | SELECT SUM(gold) FROM table_name_62 WHERE rank < 3 AND silver < 1 |
CREATE TABLE table_name_91 (
silver VARCHAR,
gold INTEGER
) | What is the number in total of silver with a gold smaller than 0? | SELECT COUNT(silver) FROM table_name_91 WHERE gold < 0 |
CREATE TABLE table_41890 (
"RR Romaja" text,
"M\u2013R Romaja" text,
"Hangul" text,
"Hanja" text,
"Name origin" text,
"Capital" text,
"Region" text,
"Korean dialect" text,
"Post-1896 Provinces" text
) | What is the Korean dialect in the daegu capital? | SELECT "Korean dialect" FROM table_41890 WHERE "Capital" = 'daegu' |
CREATE TABLE table_1771753_3 (
race_time VARCHAR,
team VARCHAR,
laps VARCHAR
) | When 228 is the lap and chip ganassi racing is the team what is the race time? | SELECT race_time FROM table_1771753_3 WHERE team = "Chip Ganassi Racing" AND laps = "228" |
CREATE TABLE table_55560 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the game where Collingwood is the home team what is the score of the away team? | SELECT "Away team score" FROM table_55560 WHERE "Home team" = 'collingwood' |
CREATE TABLE table_8061 (
"Rank" text,
"Margin" text,
"Opponent" text,
"Venue" text,
"Season" text
) | What is the Rank that has a Venue of bellerive oval , hobart, and a Margin of 115 runs? | SELECT "Rank" FROM table_8061 WHERE "Venue" = 'bellerive oval , hobart' AND "Margin" = '115 runs' |
CREATE TABLE table_name_11 (
place VARCHAR,
score VARCHAR
) | WHAT IS THE PLACE WITH THE SCORE 69-71-66-73=279? | SELECT place FROM table_name_11 WHERE score = 69 - 71 - 66 - 73 = 279 |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | Stuff Ids inside user names. | SELECT STUFF(DisplayName, 5, 0, Id) FROM Users ORDER BY Reputation DESC LIMIT 100 |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | how many patients have had neurology consultation done until 4 years ago? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'neurology consultation' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year')) |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE t... | Bar chart x axis location y axis the average of number of platforms | SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.