table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_24 (
call_sign VARCHAR,
erp_w VARCHAR,
class VARCHAR,
frequency_mhz VARCHAR
) | Class of d, and a Frequency MHz smaller than 107.7, and a ERP W smaller than 232 has what call sign? | SELECT call_sign FROM table_name_24 WHERE class = "d" AND frequency_mhz < 107.7 AND erp_w < 232 |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | how many procedures for ddavp injection are performed since 6 years ago? | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'ddavp injection' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year') |
CREATE TABLE table_name_18 (
begin VARCHAR,
state_territory VARCHAR,
icao VARCHAR
) | What begin has victoria as the state/territory and a ICA0 of ymml? | SELECT begin FROM table_name_18 WHERE state_territory = "victoria" AND icao = "ymml" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | what is diagnoses long title of diagnoses icd9 code 7756? | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "7756" |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Most viewed posts for tag. | SELECT ViewCount, Score, ((Score + 0.0) / (ViewCount + 0.0)) AS Strength, Title, Tags FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id WHERE PostTags.TagId = 1 AND ((Score + 0.0) / (ViewCount + 0.0)) > 0.00724 ORDER BY ViewCount DESC LIMIT 50 |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | Return the decor of the room named 'Recluse and defiance'. | SELECT decor FROM rooms WHERE roomname = "Recluse and defiance" |
CREATE TABLE table_41050 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | What team was the opponent on 09/20/1975? | SELECT "Opponent" FROM table_41050 WHERE "Date" = '09/20/1975' |
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair (
repair_I... | What are the names of the technicians and how many machines are they assigned to repair, show from high to low by the x axis. | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY Name DESC |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was the last type of the hospital admission of patient 60136 since 2105? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 60136 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStat... | An extremely noisy query for finding users who hate SO. | SELECT * FROM Users WHERE (AboutMe LIKE '%rude%' OR AboutMe LIKE '%belittle%') AND (AboutMe LIKE '%Stack Overflow%' OR AboutMe LIKE '%StackOverflow%' OR AboutMe LIKE '%stack overflow%' OR AboutMe LIKE '%stackoverflow%') |
CREATE TABLE table_34673 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" real
) | What is the best time for a rusport driver with a qual 2 time of 1:10.166? | SELECT MAX("Best") FROM table_34673 WHERE "Team" = 'rusport' AND "Qual 2" = '1:10.166' |
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE music_festival (
id... | Return the average age across all artists. | SELECT AVG(age) FROM artist |
CREATE TABLE tourist_attractions (
tourist_attraction_id number,
attraction_type_code text,
location_id number,
how_to_get_there text,
name text,
description text,
opening_hours text,
other_details text
)
CREATE TABLE photos (
photo_id number,
tourist_attraction_id number,
n... | Tell me the name of the staff in charge of the attraction called 'US museum'. | SELECT T1.name FROM staff AS T1 JOIN tourist_attractions AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id WHERE T2.name = "US museum" |
CREATE TABLE table_60479 (
"Edition" text,
"Round" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Result" text
) | What round had a result of 6 7 (6 8) , 1 6? | SELECT "Round" FROM table_60479 WHERE "Result" = '6–7 (6–8) , 1–6' |
CREATE TABLE table_17551 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the original air date for 'Oliver's Jaded Past'? | SELECT "Original air date" FROM table_17551 WHERE "Title" = 'Oliver''s Jaded Past' |
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... | how many patients whose gender is f and diagnoses short title is lap surg convert to open? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Lap surg convert to open" |
CREATE TABLE table_33171 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What was the score of the Jeff Tarango game? | SELECT "Score" FROM table_33171 WHERE "Partner" = 'jeff tarango' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give the number of patients under the age of41 who had the procedure for insertion of drug-eluting coronary artery stent(s). | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "41" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)" |
CREATE TABLE table_name_96 (
venue VARCHAR,
score VARCHAR,
date VARCHAR
) | what is the venue when the score is 1 goal and the date is october 11, 1997? | SELECT venue FROM table_name_96 WHERE score = "1 goal" AND date = "october 11, 1997" |
CREATE TABLE table_3258 (
"Date" text,
"Time (ET)" text,
"Event #" real,
"Event" text,
"Winner" text,
"Prize" text,
"Entries" text,
"Prize Pool" text,
"Elapsed Time" text
) | Name the time for entries being 907 | SELECT "Time (ET)" FROM table_3258 WHERE "Entries" = '907' |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE T... | Find the first names of all professors in the Accounting department who is teaching some course and the class room. | SELECT T2.emp_fname, T1.class_room FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting' |
CREATE TABLE table_224672_2 (
type VARCHAR,
term_ended VARCHAR
) | What branch of government was the term that ended on January 3, 2001? | SELECT type FROM table_224672_2 WHERE term_ended = "January 3, 2001" |
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 prescription... | count the number of patients whose primary disease is s/p fall and year of death is less than or equal to 2112? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2112.0" |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CR... | Which CHE classes do n't meet on Friday ? | 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_offering.friday = 'N' AND course.department = 'CHE' AND semester.semester = 'WN' AND se... |
CREATE TABLE table_1574 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Name the replaced by when outgoing manager is kent nielsen | SELECT "Replaced by" FROM table_1574 WHERE "Outgoing manager" = 'Kent Nielsen' |
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... | Find out the number of government insurance patients who had a lactate lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Lactate" |
CREATE TABLE table_17875 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | what's player with position being forward and current club being real madrid | SELECT "Player" FROM table_17875 WHERE "Position" = 'Forward' AND "Current Club" = 'Real Madrid' |
CREATE TABLE airport_aircraft (
id number,
airport_id number,
aircraft_id number
)
CREATE TABLE pilot (
pilot_id number,
name text,
age number
)
CREATE TABLE match (
round number,
location text,
country text,
date text,
fastest_qualifying text,
winning_pilot text,
w... | What are the maximum and minimum number of transit passengers of all aiports. | SELECT MAX(transit_passengers), MIN(transit_passengers) FROM airport |
CREATE TABLE table_26396 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | Who was the writer for the episode originally airing on March 1, 2004? | SELECT "Written by" FROM table_26396 WHERE "Original air date" = 'March 1, 2004' |
CREATE TABLE products_booked (
booking_id number,
product_id number,
returned_yn text,
returned_late_yn text,
booked_count number,
booked_amount number
)
CREATE TABLE products_for_hire (
product_id number,
product_type_code text,
daily_hire_cost number,
product_name text,
pr... | How many different product types are there? | SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire |
CREATE TABLE table_name_6 (
teams VARCHAR,
league VARCHAR,
away VARCHAR
) | What team played in the Bundesliga league with an Away record of 2-1? | SELECT teams FROM table_name_6 WHERE league = "bundesliga" AND away = "2-1" |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | what was the name of a drug patient 28048 was last prescribed until 51 months ago? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28048) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-51 month') ORDER BY prescriptions.startdate DESC LIMIT 1 |
CREATE TABLE table_40650 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
) | What was Jimmy Jones' rank when the matches were smaller than 285? | SELECT MAX("Rank") FROM table_40650 WHERE "Name" = 'jimmy jones' AND "Matches" < '285' |
CREATE TABLE table_name_30 (
silver INTEGER,
gold VARCHAR,
nation VARCHAR
) | What is the low silver total for switzerland with over 0 golds? | SELECT MIN(silver) FROM table_name_30 WHERE gold > 0 AND nation = "switzerland" |
CREATE TABLE table_1195 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | When marshmallow cookies is segment b what episode is it on netflix? | SELECT "Netflix" FROM table_1195 WHERE "Segment B" = 'Marshmallow Cookies' |
CREATE TABLE table_name_97 (
draws INTEGER,
points VARCHAR,
goal_difference VARCHAR,
goals_against VARCHAR
) | What is the average Draws, when Goal Difference is greater than -3, when Goals Against is 30, and when Points is greater than 45? | SELECT AVG(draws) FROM table_name_97 WHERE goal_difference > -3 AND goals_against = 30 AND points > 45 |
CREATE TABLE table_27268238_4 (
matches INTEGER
) | What is the smallest amount of matches? | SELECT MIN(matches) FROM table_27268238_4 |
CREATE TABLE table_16828 (
"Model name" text,
"Power (ps)" real,
"Torque (Nm@rpm)" text,
"Displacement (cm\u00b3)" real,
"Engine code" text,
"Comment" text
) | What is the model of the engine d5244 t7? | SELECT "Model name" FROM table_16828 WHERE "Engine code" = 'D5244 T7' |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId num... | What is the total number of users on StackOverflow. | SELECT * FROM Users WHERE DisplayName = 'BalusC' |
CREATE TABLE table_61361 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What Score in the final has a Surface of hard, a Championship of washington, d.c. , u.s., and an Opponent in the final of ivan lendl? | SELECT "Score in the final" FROM table_61361 WHERE "Surface" = 'hard' AND "Championship" = 'washington, d.c. , u.s.' AND "Opponent in the final" = 'ivan lendl' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Who are answering the same questions as me? List those users that have answered at least two questions which I have also answered. List those users that have answered at least two questions which I have also answered | SELECT COUNT(DISTINCT myAnswer.ParentId) AS QuestionCount, otherAnswer.OwnerUserId AS "user_link" FROM Posts AS myAnswer, Posts AS otherAnswer WHERE otherAnswer.OwnerUserId != @MyUserId AND myAnswer.OwnerUserId = @MyUserId AND myAnswer.ParentId = otherAnswer.ParentId AND otherAnswer.PostTypeId = 2 AND myAnswer.PostType... |
CREATE TABLE table_24423 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What week #(s featured sara bareilles as the original artist? | SELECT "Week #" FROM table_24423 WHERE "Original artist" = 'Sara Bareilles' |
CREATE TABLE table_name_93 (
ship_type VARCHAR,
tonnage VARCHAR
) | With a tonnage of 225 what is the ship type? | SELECT ship_type FROM table_name_93 WHERE tonnage = "225" |
CREATE TABLE table_77142 (
"Blocks" text,
"Opponent" text,
"Home/Away" text,
"Minutes played" real,
"Points" real,
"Rebounds" real,
"Assists" real
) | How many minutes were played when there were 18 points and the opponent was Chicago Bulls? | SELECT COUNT("Minutes played") FROM table_77142 WHERE "Points" = '18' AND "Opponent" = 'chicago bulls' |
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connectio... | Find the number of web accelerators used for each Operating system, show from high to low by the total number. | SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY COUNT(*) DESC |
CREATE TABLE table_33922 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | what city is the toamasina airport in? | SELECT "City" FROM table_33922 WHERE "Airport" = 'toamasina airport' |
CREATE TABLE table_69752 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What date was the match on a clay surface against Andrea Hlav kov ? | SELECT "Date" FROM table_69752 WHERE "Surface" = 'clay' AND "Opponent" = 'andrea hlaváčková' |
CREATE TABLE table_name_54 (
year INTEGER,
award VARCHAR,
nominated_work VARCHAR,
category VARCHAR
) | What is the most recent year that the Mineola Twins was nominated for outstanding actress in a play and a Drama Desk award? | SELECT MAX(year) FROM table_name_54 WHERE nominated_work = "the mineola twins" AND category = "outstanding actress in a play" AND award = "drama desk award" |
CREATE TABLE table_203_644 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text,
"difference" text,
"points" number
) | which driver and co driver have the most points ? | SELECT "driver", "co-driver" FROM table_203_644 ORDER BY "points" DESC LIMIT 1 |
CREATE TABLE table_67438 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
) | When was the first performance with a replacement cast? | SELECT "First Performance" FROM table_67438 WHERE "Status" = 'replacement cast' |
CREATE TABLE table_54727 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What company constructed the car with more than 0 laps and shows 5 for grid? | SELECT "Constructor" FROM table_54727 WHERE "Laps" > '0' AND "Grid" = '5' |
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 is the top five most common procedures that followed in the same hospital encounter for patients who received mechanical ventilation - pressure controlled until 2104? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mecha... |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is admission location and procedure short title of subject name dominga garvin? | SELECT demographic.admission_location, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Dominga Garvin" |
CREATE TABLE table_26498 (
"Administrative division" text,
"Area (km\u00b2) 2011**" text,
"Population 2001 Census (Adjusted)" real,
"Population 2011 Census (Adjusted)" real,
"Population density (/km\u00b2 2011)" text
) | In what division was there a population density in km2 of 1,604.3 in 2011? | SELECT "Administrative division" FROM table_26498 WHERE "Population density (/km\u00b2 2011)" = '1,604.3' |
CREATE TABLE table_name_73 (
venue VARCHAR,
city VARCHAR
) | What venue is in Long Beach? | SELECT venue FROM table_name_73 WHERE city = "long beach" |
CREATE TABLE table_37214 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Duchess" text,
"Ceased to be Duchess" text,
"Death" text,
"Spouse" text
) | Which Birth has a Became Duchess of 17 april 1711 husband's ascension? | SELECT "Birth" FROM table_37214 WHERE "Became Duchess" = '17 april 1711 husband''s ascension' |
CREATE TABLE table_203_788 (
id number,
"year" number,
"author" text,
"illustrator" text,
"title" text,
"publisher" text
) | which other author , besides lewis carroll , has won the kurt maschler award twice ? | SELECT "author" FROM table_203_788 WHERE "author" <> 'lewis carroll' GROUP BY "author" HAVING COUNT(*) = 2 |
CREATE TABLE table_53128 (
"Record" text,
"Date" text,
"Driver" text,
"Time" text,
"Speed/Avg. Speed" text
) | What is the record time at the Nascar Camping World Truck Series? | SELECT "Time" FROM table_53128 WHERE "Record" = 'nascar camping world truck series' |
CREATE TABLE table_name_44 (
circuit VARCHAR,
winning_constructor VARCHAR
) | Which circuit was Delage the winning constructor for? | SELECT circuit FROM table_name_44 WHERE winning_constructor = "delage" |
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 was the total amount of output patient 92846 had in the previous day? | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846)) AND DATETIME(outputevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of... |
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 diagnoses (
... | what is the number of patients whose drug code is busp10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BUSP10" |
CREATE TABLE table_name_28 (
screen_size VARCHAR,
pixels VARCHAR,
dimensions_w×h×d__mm_ VARCHAR,
model VARCHAR
) | What is the screen size and pixel amount of model p5000 when the dimensions are 98 64.5 41? | SELECT screen_size, pixels FROM table_name_28 WHERE dimensions_w×h×d__mm_ = "98×64.5×41" AND model = "p5000" |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
) | which player had the most receptions but no touchdowns ? | SELECT "player" FROM table_203_8 WHERE "td's" = 0 ORDER BY "rec." DESC LIMIT 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give the number of newborns who were born before the year 2121. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2121" |
CREATE TABLE table_203_774 (
id number,
"name" text,
"dates" text,
"grt" number,
"propulsion" text,
"port" text,
"notes" text
) | which is the only ship used as a work boat ? | SELECT "name" FROM table_203_774 WHERE "notes" = 'work boat' |
CREATE TABLE table_23976 (
"Model Type" text,
"Model Designation" text,
"Engine" text,
"Wheelbase (mm/inch)" text,
"GVW (kg/ton)" text,
"Axle Ratio" text
) | What's the wheelbase (in mm/inch) of the model with model designation 97G00? | SELECT "Wheelbase (mm/inch)" FROM table_23976 WHERE "Model Designation" = '97G00' |
CREATE TABLE table_name_36 (
wins INTEGER,
played VARCHAR,
points VARCHAR,
position VARCHAR
) | How many wins when there are more than 19 points, place smaller than 12, and fewer than 30 played? | SELECT SUM(wins) FROM table_name_36 WHERE points > 19 AND position < 12 AND played < 30 |
CREATE TABLE table_1803 (
"Year" text,
"Governor" text,
"Lieutenant Governor" text,
"Secretary of State" text,
"Attorney General" text,
"Treasurer" text,
"State Senate" text,
"State Assembly" text,
"U.S. Senator (Class I)" text,
"U.S. Senator (Class III)" text,
"U.S. House" t... | What was the composition of the state assembly in 2008? | SELECT "State Assembly" FROM table_1803 WHERE "Year" = '2008' |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHA... | Visualize a bar chart for how many students are older than average for each gender?, could you order Sex in ascending order please? | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex |
CREATE TABLE table_name_63 (
width_feet__m_ VARCHAR,
source__year_ VARCHAR
) | What is the width feet in meeters for the truss with a source of nbi (2009)? | SELECT width_feet__m_ FROM table_name_63 WHERE source__year_ = "nbi (2009)" |
CREATE TABLE table_13564637_5 (
points_against VARCHAR,
tries_for VARCHAR
) | How many numbers were recorded points against when the tries were for 43? | SELECT COUNT(points_against) FROM table_13564637_5 WHERE tries_for = "43" |
CREATE TABLE table_name_63 (
season VARCHAR,
year VARCHAR
) | Which Season has a Year of 2005 06? | SELECT season FROM table_name_63 WHERE year = "2005–06" |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city... | Show all the ranks and the number of male and female faculty for each rank in a bar chart, list by the bar in desc. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY Rank DESC |
CREATE TABLE table_name_60 (
horizontal_bar VARCHAR,
pommel_horse VARCHAR
) | What horizontal bar score also has a pommel horse score of 15.250? | SELECT horizontal_bar FROM table_name_60 WHERE pommel_horse = "15.250" |
CREATE TABLE table_56155 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
) | What is the sum of the difference for 9 draws and over 18 played? | SELECT SUM("Diff") FROM table_56155 WHERE "Drawn" = '9' AND "Played" > '18' |
CREATE TABLE table_name_2 (
ihsaa_class VARCHAR,
mascot VARCHAR
) | Which IHSAA Class has a Mascot of wildcats? | SELECT ihsaa_class FROM table_name_2 WHERE mascot = "wildcats" |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute headquarter, and rank from low to high by the Code. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code |
CREATE TABLE table_name_82 (
place VARCHAR,
player VARCHAR
) | Where is the player Davis Love III? | SELECT place FROM table_name_82 WHERE player = "davis love iii" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is primary disease and admission time of subject id 29767? | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "29767" |
CREATE TABLE advisor (
s_id text,
i_id text
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE department (
dept_name text,
buil... | Find the names of students who have taken any course in the fall semester of year 2003. | SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND year = 2003) |
CREATE TABLE table_66608 (
"Year" real,
"Championship" text,
"Event" text,
"Nation" text,
"Result" text
) | What year did Canada get a silver in the olympics in the Men's Coxless Pair event? | SELECT MIN("Year") FROM table_66608 WHERE "Nation" = 'canada' AND "Result" = 'silver' AND "Championship" = 'olympics' AND "Event" = 'men''s coxless pair' |
CREATE TABLE table_51681 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | Tell me the constructor for zolder | SELECT "Constructor" FROM table_51681 WHERE "Location" = 'zolder' |
CREATE TABLE table_name_45 (
town_city VARCHAR,
name VARCHAR
) | In what Town/City is Nana Museum of The Arctic located? | SELECT town_city FROM table_name_45 WHERE name = "nana museum of the arctic" |
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
)
... | Let me know the number of patients with guillain barre syndrome who died in or before 2111. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dod_year <= "2111.0" |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEG... | How many students are older than 20 in each dorm Visualize by bar chart, and could you display by the y axis in descending please? | SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*) DESC |
CREATE TABLE table_203_374 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what was the total number of medals won by portugal ? | SELECT "total" FROM table_203_374 WHERE "nation" = 'portugal' |
CREATE TABLE table_45358 (
"Team" text,
"Tries for" text,
"Tries against" text,
"Try diff" text,
"Points for" text,
"Points against" text,
"Points diff" text
) | What is Tries Against, when Points For is 98? | SELECT "Tries against" FROM table_45358 WHERE "Points for" = '98' |
CREATE TABLE table_67687 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What is the Losing bonus, when the value for Points is 43? | SELECT "Losing bonus" FROM table_67687 WHERE "Points" = '43' |
CREATE TABLE table_name_6 (
tournament VARCHAR
) | What is the tournament in 2012 results that has a 2003 results of 2r and played at Wimbledon? | SELECT 2012 FROM table_name_6 WHERE 2003 = "2r" AND tournament = "wimbledon" |
CREATE TABLE table_20667854_1 (
free_float VARCHAR,
bse_code VARCHAR
) | How many values of free float for the BSE code of 4EH? | SELECT COUNT(free_float) FROM table_20667854_1 WHERE bse_code = "4EH" |
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, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart, and could you order x axis in desc order? | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | What is the number of hispanic or latino - puerto rican patients who were given the drug named latanoprost 0.005% ophth.soln.? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Latanoprost 0.005% Ophth. Soln." |
CREATE TABLE table_name_53 (
tournament VARCHAR
) | Which 2007 has a 2008 of 1r, and a Tournament of wimbledon? | SELECT 2007 FROM table_name_53 WHERE 2008 = "1r" AND tournament = "wimbledon" |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who was hired before 2002-06-21, visualize a line chart about the change of salary over hire_date . | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' |
CREATE TABLE table_8727 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | What is the method when the opponent is Andre Roberts? | SELECT "Method" FROM table_8727 WHERE "Opponent" = 'andre roberts' |
CREATE TABLE table_name_75 (
capital VARCHAR,
voivodeship_or_city VARCHAR
) | Voivodeship or city of nowogr dzkie has what capital? | SELECT capital FROM table_name_75 WHERE voivodeship_or_city = "nowogródzkie" |
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, visualize a bar chart about the distribution of name and the average of price , and group by attribute name, and order Y from high to low order. | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC |
CREATE TABLE table_17340355_6 (
high_assists VARCHAR,
score VARCHAR
) | Who made high points on games of score w 106 104 (ot) | SELECT high_assists FROM table_17340355_6 WHERE score = "W 106–104 (OT)" |
CREATE TABLE table_19753079_35 (
party VARCHAR,
candidates VARCHAR
) | Name the number of party for richard l. hanna (r) 53.1% mike arcuri (d) 46.9% | SELECT COUNT(party) FROM table_19753079_35 WHERE candidates = "Richard L. Hanna (R) 53.1% Mike Arcuri (D) 46.9%" |
CREATE TABLE table_name_43 (
dismissals VARCHAR,
venue VARCHAR
) | What is the Dismissals with a Venue with source: cricinfo.com? | SELECT dismissals FROM table_name_43 WHERE venue = "source: cricinfo.com" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.