table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_77901 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the top grid that laps less than 66 and a retried engine? | SELECT MAX("Grid") FROM table_77901 WHERE "Time/Retired" = 'engine' AND "Laps" < '66' |
CREATE TABLE table_name_96 (
elimination VARCHAR,
wrestler VARCHAR
) | What is the Elimination for Candice? | SELECT elimination FROM table_name_96 WHERE wrestler = "candice" |
CREATE TABLE table_1140083_2 (
rnd VARCHAR,
pole_position VARCHAR,
fastest_lap VARCHAR
) | How many rounds were won with James Hunt as pole position and John Watson as fastest lap? | SELECT COUNT(rnd) FROM table_1140083_2 WHERE pole_position = "James Hunt" AND fastest_lap = "John Watson" |
CREATE TABLE table_29743928_5 (
int_caps INTEGER
) | What is the lowest value for int. caps? | SELECT MIN(int_caps) FROM table_29743928_5 |
CREATE TABLE table_204_878 (
id number,
"model" text,
"release date" text,
"sensor\nres., size" text,
"lens (35 mm equiv.)\nzoom, aperture" text,
"screen\nsize, pixels" text,
"dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text,
"weight" text,
"features" text
) | how many models weighed between 100 and 200 grams ? | SELECT COUNT("model") FROM table_204_878 WHERE "weight" >= 100 AND "weight" <= 200 |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
ge... | Find the number of students for the cities where have more than one student. | SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1 |
CREATE TABLE table_201_19 (
id number,
"rank" number,
"title" text,
"studio" text,
"director" text,
"actors" text,
"gross" text
) | how many movies did 20th century fox create that were in the top 10 grossing films of 1965 ? | SELECT COUNT("title") FROM table_201_19 WHERE "title" IN (SELECT "title" FROM table_201_19 ORDER BY "gross" DESC LIMIT 10) AND "studio" = '20th century fox' |
CREATE TABLE table_name_65 (
score_points VARCHAR,
total VARCHAR
) | With Olympic Bronze Medalist as the total what are the score points? | SELECT score_points FROM table_name_65 WHERE total = "olympic bronze medalist" |
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's the name of the drug that patient 030-77189 was prescribed two or more times in 12/2102? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030... |
CREATE TABLE table_name_7 (
week INTEGER,
record VARCHAR
) | Which week did the Seattle Seahawks have a record of 6-6? | SELECT AVG(week) FROM table_name_7 WHERE record = "6-6" |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal bool... | First Time Posts that are on bounty questions. | SELECT COUNT(DISTINCT p.Id) AS QuestionWithBounty, COUNT(DISTINCT Answer.Id) AS BountyAnswers, SUM(CASE WHEN PostsBeforeBounty.Id IS NULL THEN 1 ELSE 0 END) AS FirstTimePosts FROM Posts AS P INNER JOIN Votes AS bStart ON p.Id = bStart.PostId AND bStart.VoteTypeId = 8 INNER JOIN Posts AS Answer ON Answer.ParentId = p.Id... |
CREATE TABLE table_2383498_4 (
last_year_in_qld_cup VARCHAR,
qld_cup_premierships VARCHAR
) | How many values of last year in QLD Cup if QLD Cup Premierships is 1996, 2001? | SELECT COUNT(last_year_in_qld_cup) FROM table_2383498_4 WHERE qld_cup_premierships = "1996, 2001" |
CREATE TABLE table_203_872 (
id number,
"year" number,
"location(s)" text,
"number of contestants" number,
"ladies winner" text,
"men's winner" text
) | what is the name of the location listed first on this list ? | SELECT "location(s)" FROM table_203_872 WHERE id = 1 |
CREATE TABLE table_75462 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Competition" text
) | Which Competition has a Score of 0-1, and Opponents of pkns fc? | SELECT "Competition" FROM table_75462 WHERE "Score" = '0-1' AND "Opponents" = 'pkns fc' |
CREATE TABLE table_13715 (
"Sr No" real,
"Name" text,
"Locale" text,
"Height" text,
"Floors" real,
"Building Type" text
) | what is the name when the sr no is less than 74 and floors is more than 36? | SELECT "Name" FROM table_13715 WHERE "Sr No" < '74' AND "Floors" > '36' |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_add... | How many professors have a Ph.D. in each department? | SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code |
CREATE TABLE table_name_13 (
tries VARCHAR,
points VARCHAR
) | How many tries did the player have which ended with 20 Points? | SELECT tries FROM table_name_13 WHERE points = 20 |
CREATE TABLE table_38755 (
"Couple" text,
"Score" text,
"Style" text,
"Music" text,
"Result" text
) | Which Score has a Couple comprised of jason & edyta, and a Style of freestyle? | SELECT "Score" FROM table_38755 WHERE "Couple" = 'jason & edyta' AND "Style" = 'freestyle' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | what is a drug that patient 76372 was prescribed two or more times during this month? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76372) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ... |
CREATE TABLE table_204_770 (
id number,
"season" number,
"date" text,
"jia-a/csl winner" text,
"result" text,
"fa cup winner" text,
"scorers" text,
"stadium" text
) | how many had a total goals scored over 6 ? | SELECT COUNT(*) FROM table_204_770 WHERE "result" + "result" > 6 |
CREATE TABLE table_39542 (
"Rank" real,
"Place" text,
"County" text,
"Per Capita Income" text,
"Median House- hold Income" text,
"Median Family Income" text,
"Population" real,
"Number of Households" real
) | What is the population where the rank is higher than 51 and the Median House-hold income is $25,250? | SELECT SUM("Population") FROM table_39542 WHERE "Rank" > '51' AND "Median House- hold Income" = '$25,250' |
CREATE TABLE manager_half (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
half INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank INTEGER
)
CREATE TABLE salary (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
salary IN... | Count the number of players who enter hall of fame for each year with a line chart, rank X-axis in asc order please. | SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid ORDER BY yearid |
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... | count the number of patients who have had a abscess microbiology test done since 2104. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'abscess' AND STRFTIME('%y', microlab.culturetakentime) >= '2104') |
CREATE TABLE table_38387 (
"Product" text,
"Extensions" text,
"Projects templates" text,
"MSDN integration" text,
"Debugging" text,
"Profiling" text,
"IntelliTrace" text,
"Unit test" text,
"Code coverage" text,
"Test impact analysis" text,
"Load testing" text,
"Lab manage... | Which Architecture and modelling has a Unit test of no, and a Projects templates of limited? | SELECT "Architecture and modelling" FROM table_38387 WHERE "Unit test" = 'no' AND "Projects templates" = 'limited' |
CREATE TABLE table_58487 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | What was the attendance when the Hawks played? | SELECT COUNT("Attendance") FROM table_58487 WHERE "Home" = 'hawks' |
CREATE TABLE table_name_35 (
celebrity VARCHAR,
exited VARCHAR
) | Who was the celebrity who exited on day 13? | SELECT celebrity FROM table_name_35 WHERE exited = "day 13" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | tell me the five most frequently ordered procedure for patients of 40s since 2102? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
CREATE TABLE table_name_35 (
episode VARCHAR,
rating VARCHAR,
viewers__m_ VARCHAR
) | What Episode has a Rating of 1.8, and Viewers (m) smaller than 2.73? | SELECT episode FROM table_name_35 WHERE rating = "1.8" AND viewers__m_ < 2.73 |
CREATE TABLE table_57670 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time of the driver on grid 7? | SELECT "Time/Retired" FROM table_57670 WHERE "Grid" = '7' |
CREATE TABLE table_59940 (
"Spaceport" text,
"Launch complex" text,
"Launcher" text,
"Spacecraft" text,
"Flights" text,
"Years" text
) | What was the launcher vehicle for Apollo-Soyuz? | SELECT "Launcher" FROM table_59940 WHERE "Spacecraft" = 'apollo-soyuz' |
CREATE TABLE table_name_74 (
against INTEGER,
status VARCHAR,
opposing_teams VARCHAR
) | What is the average Against, when Status is '2007 Rugby World Cup', and when Opposing Teams is 'U.S.A.'? | SELECT AVG(against) FROM table_name_74 WHERE status = "2007 rugby world cup" AND opposing_teams = "u.s.a." |
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 has it been since the first time that patient 033-22108 had intake of cl flush: non-tunneled ij r on the current icu 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose drug code is vanc250l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VANC250L" |
CREATE TABLE table_73077 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering this round" text
) | Name the new entries this round for third round | SELECT "New entries this round" FROM table_73077 WHERE "Round" = 'Third round' |
CREATE TABLE table_name_95 (
rider VARCHAR,
grid VARCHAR,
laps VARCHAR,
manufacturer VARCHAR
) | Which rider had more than 23 laps, a manufacturer of Aprilia, and a grid of 14 | SELECT rider FROM table_name_95 WHERE laps > 23 AND manufacturer = "aprilia" AND grid = 14 |
CREATE TABLE table_name_61 (
opponent VARCHAR,
date VARCHAR
) | Who was the Opponent on July 29? | SELECT opponent FROM table_name_61 WHERE date = "july 29" |
CREATE TABLE table_name_80 (
date VARCHAR,
attendance VARCHAR
) | Attendance of 29,000 occurred on what date? | SELECT date FROM table_name_80 WHERE attendance = "29,000" |
CREATE TABLE table_name_77 (
seasons VARCHAR,
goals VARCHAR,
lost VARCHAR
) | How many seasons have goals of 261-338 with more than 111 losses? | SELECT COUNT(seasons) FROM table_name_77 WHERE goals = "261-338" AND lost > 111 |
CREATE TABLE table_name_57 (
name VARCHAR,
medal VARCHAR,
event VARCHAR
) | Which participants won the silver medal for the Men's Doubles? | SELECT name FROM table_name_57 WHERE medal = "silver" AND event = "men's doubles" |
CREATE TABLE table_11964154_9 (
record VARCHAR,
score VARCHAR
) | what's the record where score is w 105 92 (ot) | SELECT record FROM table_11964154_9 WHERE score = "W 105–92 (OT)" |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_... | List the customers first and last name of 10 least expensive invoices. | SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10 |
CREATE TABLE table_name_57 (
opponent VARCHAR,
score VARCHAR
) | What Opponent has a Score that is 1-6, 3-6? | SELECT opponent FROM table_name_57 WHERE score = "1-6, 3-6" |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,... | Plot the number of order date over order date in a line chart | SELECT Order_Date, COUNT(Order_Date) FROM Bookings |
CREATE TABLE table_10234 (
"Date" text,
"Venue" text,
"Opponent" text,
"Result" text,
"Competition" text
) | What is the result of game played on 10-05-2012? | SELECT "Result" FROM table_10234 WHERE "Date" = '10-05-2012' |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | NEW YORK to LAS VEGAS on sunday afternoon | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 27 AND DATE_DAYalias0.month_number = 8 AND DATE_DAYalias0.year = 1991)) AND to... |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABL... | Who is the advisor of Linda Smith? Give me the first name and last name. | SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" |
CREATE TABLE table_name_64 (
seats_2006 INTEGER,
_percentage_2001 VARCHAR,
seats_2001 VARCHAR
) | what is the seats 2006 total with %2001 of 39 and seats 2001 less than 12? | SELECT MAX(seats_2006) FROM table_name_64 WHERE _percentage_2001 = 39 AND seats_2001 < 12 |
CREATE TABLE table_17755 (
"Clinical Status" text,
"Compound Name" text,
"Trademark" text,
"Marine Organism \u03b1" text,
"Chemical Class" text,
"Molecular Target" text,
"Clinical Trials \u03b2" text,
"Disease Area" text
) | What is the trademark listed for the molecular target : dna-binding? | SELECT "Trademark" FROM table_17755 WHERE "Molecular Target" = 'DNA-Binding' |
CREATE TABLE table_20630462_1 (
years INTEGER,
tournament VARCHAR
) | What is the most years that tournaments held in Rome have lasted? | SELECT MAX(years) FROM table_20630462_1 WHERE tournament = "Rome" |
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... | What number of credits do I get for 425 ? | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 425 |
CREATE TABLE table_name_20 (
effic INTEGER,
name VARCHAR
) | What was the total effic for the quarterbacks? | SELECT MIN(effic) FROM table_name_20 WHERE name = "total" |
CREATE TABLE table_203_109 (
id number,
"treaty" text,
"organization" text,
"introduced" number,
"signed" number,
"ratified" number
) | which was the first treaty in morocco to be ratified ? | SELECT "treaty" FROM table_203_109 ORDER BY "ratified" LIMIT 1 |
CREATE TABLE table_name_16 (
against INTEGER,
opposing_teams VARCHAR,
venue VARCHAR,
status VARCHAR
) | What is the lowest against score for Twickenham, London with the status of Five Nations against Ireland? | SELECT MIN(against) FROM table_name_16 WHERE venue = "twickenham, london" AND status = "five nations" AND opposing_teams = "ireland" |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | what is the name of a procedure that patient 4718 has been given for two times until 08/2102? | 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 = 471... |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays ... | what are the four most common medications that patients were prescribed with during the same hospital visit after being prescribed with lidocaine 2% since 1 year ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lidocaine 2%' AND DATETIME(prescriptions.star... |
CREATE TABLE table_64924 (
"Event" text,
"Date" text,
"Location" text,
"Winning skip" text,
"Runner-up skip" text
) | Who was the runner-up during the Mac Ice Classic? | SELECT "Runner-up skip" FROM table_64924 WHERE "Event" = 'mac ice classic' |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE S... | Count: Answers by top users in year by month. Answers by top users in year broken down by month | SELECT MONTH(p.CreationDate), COUNT(p.Id) FROM Posts AS p WHERE p.PostTypeId = 2 AND YEAR(p.CreationDate) = @Year AND p.OwnerUserId IN (SELECT TOP(1000) AS Id FROM Users ORDER BY Reputation DESC) GROUP BY MONTH(p.CreationDate) |
CREATE TABLE table_name_22 (
games INTEGER,
drawn INTEGER
) | What games have more than 1 draw? | SELECT AVG(games) FROM table_name_22 WHERE drawn > 1 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | among patients from white ethnic origin, calculate the total number of male patients. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "WHITE" |
CREATE TABLE table_name_48 (
team VARCHAR,
stadium VARCHAR
) | What is the team at Stadion Maksimir? | SELECT team FROM table_name_48 WHERE stadium = "stadion maksimir" |
CREATE TABLE table_name_76 (
date INTEGER,
championship VARCHAR
) | What is the earliest date when the championship was Monterrey WCT, Mexico? | SELECT MIN(date) FROM table_name_76 WHERE championship = "monterrey wct, mexico" |
CREATE TABLE table_name_7 (
athlete VARCHAR,
fastest_time__s_ VARCHAR
) | Which athlete has the fastest time of 15.82? | SELECT athlete FROM table_name_7 WHERE fastest_time__s_ = 15.82 |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what procedure was performed on patient 003-33922 for the last time during their first hospital encounter? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-33922' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
CREATE TABLE table_22040 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1991-92" text,
"1992-93" text,
"1993-94" real
) | Name the points for 1992-93 for 42 | SELECT "Points" FROM table_22040 WHERE "1992-93" = '42' |
CREATE TABLE table_21220720_1 (
position VARCHAR,
name VARCHAR
) | Name the position for van den brink, bas | SELECT position FROM table_21220720_1 WHERE name = "van den Brink, Bas" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | when did patient 13440 receive the first microbiology test on their last hospital visit? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13440 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime LIMIT 1 |
CREATE TABLE table_53989 (
"Track #" real,
"Song" text,
"Singers" text,
"Picturization" text,
"Length" text,
"Lyricist" text
) | How long is the song 'Maduraikku Pogathadee'? | SELECT "Length" FROM table_53989 WHERE "Song" = 'maduraikku pogathadee' |
CREATE TABLE table_36070 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | with games more than 22 what is the rebound total? | SELECT SUM("Rebounds") FROM table_36070 WHERE "Games" > '22' |
CREATE TABLE table_27214 (
"Number" real,
"Name" text,
"Titles" text,
"Date" text,
"Opponent" text,
"Result" text,
"Defenses" real
) | Name the most number | SELECT MAX("Number") FROM table_27214 |
CREATE TABLE table_14835 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in final" text,
"Score" text
) | What is the name of the partner who played in the final against Lucas Arnold Ker Mart n Garc a? | SELECT "Partner" FROM table_14835 WHERE "Opponents in final" = 'lucas arnold ker martín garcía' |
CREATE TABLE table_25894 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | When did the Portland Trail Blazers play against Cleveland? | SELECT "Date" FROM table_25894 WHERE "Team" = 'Cleveland' |
CREATE TABLE table_28744929_2 (
years_at_school VARCHAR,
team VARCHAR
) | How many values were used to express the years at school of the Maryland team? | SELECT COUNT(years_at_school) FROM table_28744929_2 WHERE team = "Maryland" |
CREATE TABLE table_name_31 (
surface VARCHAR,
opponent VARCHAR
) | What is Surface, when Opponent is 'Ji Van k'? | SELECT surface FROM table_name_31 WHERE opponent = "jiří vaněk" |
CREATE TABLE table_12828723_3 (
lost VARCHAR,
try_bonus VARCHAR,
points_for VARCHAR
) | what's the loss with try bonus being 5 and points for being 390 | SELECT lost FROM table_12828723_3 WHERE try_bonus = "5" AND points_for = "390" |
CREATE TABLE table_1072 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Time ( ET )" text,
"TV" text,
"Result" text,
"Record" text
) | How many days were the Kansas City Chiefs the opposing team? | SELECT COUNT("Date") FROM table_1072 WHERE "Opponent" = 'Kansas City Chiefs' |
CREATE TABLE table_73072 (
"Date" text,
"B-52 Model" text,
"Serial #" text,
"Unit" text,
"Bomb Capacity" text,
"Mission/Target" text,
"Cause of Loss" text
) | When hit by sam at 38,500 feet just after bomb release was the cause of loss what is the mission/target? | SELECT "Mission/Target" FROM table_73072 WHERE "Cause of Loss" = 'Hit by SAM at 38,500 feet just after bomb release' |
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 employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the email . | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
CREATE TABL... | What is the average duration of songs that have mp3 format and resolution below 800? | SELECT AVG(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" AND T2.resolution < 800 |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Ag... | Plot the number of home city by grouped by home city as a bar graph, could you order in asc by the total number? | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY COUNT(Home_city) |
CREATE TABLE table_203_694 (
id number,
"#" number,
"name" text,
"took office" text,
"left office" text,
"party" text
) | who was next to serve after nejat konuk ? | SELECT "name" FROM table_203_694 WHERE "took office" > (SELECT "took office" FROM table_203_694 WHERE "name" = 'nejat konuk') ORDER BY "took office" LIMIT 1 |
CREATE TABLE table_1311 (
"Team" text,
"Titles" real,
"Runner-up" real,
"Third place" real,
"Fourth place" real,
"Years participated" real
) | When colgate is the team how many times did they place fourth? | SELECT COUNT("Fourth place") FROM table_1311 WHERE "Team" = 'Colgate' |
CREATE TABLE table_name_18 (
weeks VARCHAR,
date VARCHAR
) | On December 12, 2001, how many weeks had the single been in its position? | SELECT weeks FROM table_name_18 WHERE date = "december 12, 2001" |
CREATE TABLE table_20549 (
"Season" text,
"1st Place" text,
"2nd Place" text,
"3rd Place" text,
"4th Place" text
) | What team finished in 1st when tau cer mica was in 3rd? | SELECT "1st Place" FROM table_20549 WHERE "3rd Place" = 'TAU Cerámica' |
CREATE TABLE table_64297 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
) | Which TV station, has romaji title of tantei gakuen q and episodes larger than 10? | SELECT "TV Station" FROM table_64297 WHERE "Episodes" > '10' AND "Romaji Title" = 'tantei gakuen q' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what was the drug prescribed to patient 016-24379 for the last time via intravenous route in 12/this year? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-24379')) AND medication.routeadmin = 'intravenous' AND DATETIME... |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | what is the number of patients who have had a 1:1 ns repletion. intake since 1 year ago? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '1:1 ns repletion.' ... |
CREATE TABLE table_6876 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | What is the average Number, when Position is Forward? | SELECT AVG("Number") FROM table_6876 WHERE "Position" = 'forward' |
CREATE TABLE table_52864 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team had a score of 17.13 (115)? | SELECT "Away team" FROM table_52864 WHERE "Away team score" = '17.13 (115)' |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose admission location is clinic referral/premature and procedure short title is cont inv mec ven is less than96 hrs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.short_title = "Cont inv mec ven <96 hrs" |
CREATE TABLE table_204_313 (
id number,
"date" text,
"operation" text,
"location" text,
"type" text,
"information" text
) | which operation occurred right after operation maritime guard ? | SELECT "operation" FROM table_204_313 WHERE "date" > (SELECT "date" FROM table_204_313 WHERE "operation" = 'operation maritime guard') ORDER BY "date" LIMIT 1 |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | Is EECS 282 easier , or EECS 767 ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 282 OR course.number = 767) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | Are there usually 2 or 3 lectures held for 541 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 table_18442691_2 (
no VARCHAR,
released VARCHAR
) | When cannot handle non-empty timestamp argument! 2007 is released what is the no.? | SELECT no FROM table_18442691_2 WHERE released = "Cannot handle non-empty timestamp argument! 2007" |
CREATE TABLE table_30611 (
"Callsign" text,
"City of license" text,
"Virtual channel" text,
"Digital channel" text,
"Network" text
) | What city licensed the broadcast on virtual channel 8.2? | SELECT "City of license" FROM table_30611 WHERE "Virtual channel" = '8.2' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what number of patients with elective admission type had hemodialysis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Hemodialysis" |
CREATE TABLE table_78730 (
"Played" real,
"Drawn" real,
"Lost" real,
"Winning %" real,
"Tries" real,
"Conversions" real,
"Penalties" real,
"s Drop goal" real,
"Points total" real
) | How many ties did he have when he had 1 penalties and more than 20 conversions? | SELECT SUM("Drawn") FROM table_78730 WHERE "Penalties" = '1' AND "Conversions" > '20' |
CREATE TABLE table_name_98 (
injured VARCHAR,
date VARCHAR
) | What is Injured, when Date is '09.15 Sep. 15'? | SELECT injured FROM table_name_98 WHERE date = "09.15 sep. 15" |
CREATE TABLE table_name_83 (
date VARCHAR,
outcome VARCHAR,
score VARCHAR
) | What is the Date of the game with an Outcome of runner-up and Score of 5 7, 3 6, 6 3, 2 6? | SELECT date FROM table_name_83 WHERE outcome = "runner-up" AND score = "5–7, 3–6, 6–3, 2–6" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is days of hospital stay and diagnoses long title of subject id 91588? | SELECT demographic.days_stay, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "91588" |
CREATE TABLE table_11438 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the record on April 7? | SELECT "Record" FROM table_11438 WHERE "Date" = 'april 7' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.