table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, show total number in ascending order. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) |
CREATE TABLE table_2668374_18 (
incumbent VARCHAR,
district VARCHAR
) | Who was the incumbent in Virginia 3? | SELECT incumbent FROM table_2668374_18 WHERE district = "Virginia 3" |
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, find name and the average of manufacturer , and group by attribute name, and visualize them by a bar chart. | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name |
CREATE TABLE table_name_25 (
date VARCHAR,
game_site VARCHAR
) | When did they play at Candlestick Park? | SELECT date FROM table_name_25 WHERE game_site = "candlestick park" |
CREATE TABLE table_name_74 (
viewers__millions_ INTEGER,
episode__number VARCHAR,
rating VARCHAR
) | What is the lowest number of million viewers for an episode before episode 5 with a rating/share of 1.1/3? | SELECT MIN(viewers__millions_) FROM table_name_74 WHERE rating / SHARE(18 AS –49) = 1.1 / 3 AND episode__number < 5 |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer... | i want a nonstop flight from INDIANAPOLIS to TORONTO that leaves thursday morning | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONTO' AND date_day.day_number = 24 AND date_day.month_number = 5 AND... |
CREATE TABLE table_49340 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Can you tell me the Date that has the Week smaller than 13, and the Opponent of green bay packers? | SELECT "Date" FROM table_49340 WHERE "Week" < '13' AND "Opponent" = 'green bay packers' |
CREATE TABLE table_name_55 (
score VARCHAR,
date VARCHAR
) | What was the score on October 24, 2005? | SELECT score FROM table_name_55 WHERE date = "october 24, 2005" |
CREATE TABLE table_21830 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Colour commentator(s)" text,
"Sideline reporters" text,
"Pregame host" text,
"Pregame analysts" text
) | How many different play-by-play announcers also had pregame analysis by Darren Flutie, Eric Tillman and Greg Frers? | SELECT COUNT("Play-by-play") FROM table_21830 WHERE "Pregame analysts" = 'Darren Flutie, Eric Tillman and Greg Frers' |
CREATE TABLE table_17994 (
"Year" real,
"Competition" text,
"Location" text,
"Event" text,
"Final-Rank" text,
"Final-Score" text,
"Qualifying Rank" real,
"Qualifying Score" text
) | what is the lowest qualifying rank? | SELECT MIN("Qualifying Rank") FROM table_17994 |
CREATE TABLE table_26150 (
"Copper Age" text,
"Chalcolithic (4500 BC - 3300 BC)" text,
"Early Chalcolithic" text,
"4500 BC - 4000 BC" text,
"Ubaid period in Mesopotamia" text
) | When hittite middle kingdom , new kingdom of egypt is the ubaid period in mesopotamia how many early chalcolithics are there? | SELECT COUNT("Early Chalcolithic") FROM table_26150 WHERE "Ubaid period in Mesopotamia" = 'Hittite Middle Kingdom , New Kingdom of Egypt' |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | since 2105, did patient 010-16627 get antibiotics - quinolone in other hospitals? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '010-16627' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '010-16627' AND patient.hospitaldischargetime IS NULL)) AND tr... |
CREATE TABLE table_79832 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
) | What are the number of goals conceded that has a played greater than 18? | SELECT COUNT("Goals Conceded") FROM table_79832 WHERE "Played" > '18' |
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 department_id bin hire_date by time, and rank mean department id in descending order. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) DESC |
CREATE TABLE table_name_34 (
losses VARCHAR,
awards VARCHAR
) | What are the losses where the award is Mike Miller (Smoy)? | SELECT losses FROM table_name_34 WHERE awards = "mike miller (smoy)" |
CREATE TABLE table_27330 (
"Region" text,
"Public network" text,
"Own/community generator" text,
"Solar panel" text,
"Other source" text,
"None" text
) | How many regions have 0.5% solar panels? | SELECT COUNT("Public network") FROM table_27330 WHERE "Solar panel" = '0.5%' |
CREATE TABLE table_name_19 (
rank VARCHAR,
location VARCHAR
) | What rank is the airport in Fortaleza? | SELECT rank FROM table_name_19 WHERE location = "fortaleza" |
CREATE TABLE table_name_17 (
race VARCHAR,
athlete VARCHAR
) | What is the name of the race when Lineth Chepkurui is the athlete? | SELECT race FROM table_name_17 WHERE athlete = "lineth chepkurui" |
CREATE TABLE table_64272 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | Which socket goes with the item with release price of $378 and turbo of 6/6/8/9? | SELECT "Socket" FROM table_64272 WHERE "Release price ( USD )" = '$378' AND "Turbo" = '6/6/8/9' |
CREATE TABLE table_37749 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the largest round number for Dan Connor, the player? | SELECT MAX("Round") FROM table_37749 WHERE "Player" = 'dan connor' |
CREATE TABLE table_34689 (
"Name" text,
"Born \u2013 Died" text,
"Notable for" text,
"Connection with Australia" text,
"Connection with America" text
) | What is the person born in Australia, rick springfield notable for? | SELECT "Notable for" FROM table_34689 WHERE "Connection with Australia" = 'born in australia' AND "Name" = 'rick springfield' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | what is the number of patients whose admission year is less than 2182 and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Blood" |
CREATE TABLE diagnoses (
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
)
C... | provide the number of patients whose admission location is clinic referral/premature and primary disease is sepsis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "SEPSIS" |
CREATE TABLE table_21980_1 (
january__°f_ VARCHAR,
location VARCHAR
) | What were the January ( F) temperatures in the Corner Brook location? | SELECT january__°f_ FROM table_21980_1 WHERE location = "Corner Brook" |
CREATE TABLE manager (
Age INTEGER
) | What is the average age for all managers? | SELECT AVG(Age) FROM manager |
CREATE TABLE table_name_96 (
time_retired VARCHAR,
laps VARCHAR
) | what is the time/retired when the laps is 55? | SELECT time_retired FROM table_name_96 WHERE laps = 55 |
CREATE TABLE greatermanchestercrime (
crimeid text,
crimets time,
location text,
lsoa text,
type text,
outcome text
) | Which location has the top amount of 'Drugs' crime conducted? | SELECT location FROM greatermanchestercrime WHERE type LIKE "%Drug%" GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
N... | Best Algerian stack overflow users. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Age, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?1##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR UP... |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
... | what's the number of patients who had a tpn d11.5 intake a year before? | 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 = 'tpn d11.5' AND d_it... |
CREATE TABLE table_31495 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
) | What is the fewest area in Derrynanool townland? | SELECT MIN("Area( acres )") FROM table_31495 WHERE "Townland" = 'Derrynanool' |
CREATE TABLE table_16724844_1 (
mens_u20 VARCHAR,
womens_40 VARCHAR
) | How many times was the mens u20 recorded when the Womens 40 were Sydney Scorpions def North Queensland Cyclones? | SELECT COUNT(mens_u20) FROM table_16724844_1 WHERE womens_40 = "Sydney Scorpions def North Queensland Cyclones" |
CREATE TABLE table_60903 (
"Stage" text,
"Route" text,
"Distance" text,
"Date" text,
"Winner" text
) | Who was the winner of the mechelen > mechelen route? | SELECT "Winner" FROM table_60903 WHERE "Route" = 'mechelen > mechelen' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | has patient 002-4486 been ordered chlorhexidine gluconate 0.12%, morphine 4 mg/ml syringe : 1 ml syringe, or amlodipine 5 mg tab during this month? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND medication.drugname IN ('morphine 4 mg/ml syringe : 1 ml s... |
CREATE TABLE table_61154 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | What is 4:30 pm, when Noon is 'Local Programs', and when 11:00 am is 'Local Programs'? | SELECT "4:30 pm" FROM table_61154 WHERE "noon" = 'local programs' AND "11:00 am" = 'local programs' |
CREATE TABLE table_name_95 (
position VARCHAR,
notes VARCHAR
) | What position did the person finish in with a notes of junior men individual 5.64km? | SELECT position FROM table_name_95 WHERE notes = "junior men individual 5.64km" |
CREATE TABLE table_1378 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" real
) | How many episodes were written by Jack Burditt & Robert Carlock | SELECT COUNT("Production code") FROM table_1378 WHERE "Written by" = 'Jack Burditt & Robert Carlock' |
CREATE TABLE table_27953 (
"meas. num" real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
) | What was the type of ballot measure with the description of Department of Industry and Public Works Amendment? | SELECT "type" FROM table_27953 WHERE "description" = 'Department of Industry and Public Works Amendment' |
CREATE TABLE table_2093995_1 (
parking VARCHAR,
city__neighborhood VARCHAR,
stations VARCHAR
) | How much parking is in Van Nuys at the Sepulveda station? | SELECT parking FROM table_2093995_1 WHERE city__neighborhood = "Van Nuys" AND stations = "Sepulveda" |
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... | Please list the age and famous title of artists in descending order of age. | SELECT famous_title, age FROM artist ORDER BY age DESC |
CREATE TABLE table_name_92 (
laps INTEGER,
grid VARCHAR,
manufacturer VARCHAR,
time_retired VARCHAR
) | What was the average number of laps completed by KTM riders, with times of +56.440 and grid values under 11? | SELECT AVG(laps) FROM table_name_92 WHERE manufacturer = "ktm" AND time_retired = "+56.440" AND grid < 11 |
CREATE TABLE table_name_80 (
network VARCHAR,
premiere VARCHAR
) | Tell me the network for 13 january 2009 | SELECT network FROM table_name_80 WHERE premiere = "13 january 2009" |
CREATE TABLE table_name_27 (
website VARCHAR,
name VARCHAR
) | What's the website for the yamagata international documentary film festival? | SELECT website FROM table_name_27 WHERE name = "yamagata international documentary film festival" |
CREATE TABLE table_name_74 (
replaced_by VARCHAR,
date_of_appointment VARCHAR
) | What is the name of the person that was appointed on 13 May 2009? | SELECT replaced_by FROM table_name_74 WHERE date_of_appointment = "13 may 2009" |
CREATE TABLE table_10284 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team's Venue is western oval? | SELECT "Away team" FROM table_10284 WHERE "Venue" = 'western oval' |
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,
... | give me the number of patients whose age is less than 62 and diagnoses short title is esophageal reflux? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.short_title = "Esophageal reflux" |
CREATE TABLE table_name_32 (
image_quality VARCHAR,
date VARCHAR,
multiple_sessions VARCHAR,
authentication VARCHAR
) | what is the image quality when the multiple sessions is x, the authentication is and the date is may 15, 2007? | SELECT image_quality FROM table_name_32 WHERE multiple_sessions = "x" AND authentication = "✓" AND date = "may 15, 2007" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | is patient 027-4674 ever diagnosed with anything during the last year? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-4674')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIM... |
CREATE TABLE table_name_83 (
race VARCHAR,
time VARCHAR
) | Who holds the time of 17:11.572? | SELECT race FROM table_name_83 WHERE time = "17:11.572" |
CREATE TABLE table_3099 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who directed 'hey now hey now perry'S girlfriend's back'? | SELECT "Directed by" FROM table_3099 WHERE "Title" = 'Hey Now Hey Now Perry''s Girlfriend''s Back' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | when was the first time patient 011-31236's procedure was performed in 2101? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31236')) AND STRFTIME('%y', treatment.treatmenttime) = '2101'... |
CREATE TABLE table_22517 (
"Number" real,
"Sanskrit" text,
"International Alphabet of Sanskrit Transliteration" text,
"Sanskrit gloss" text,
"Western name" text,
"Greek" text,
"Gloss" text,
"Tattva (Element)" text,
"Quality" text,
"Ruling Planet" text
) | When kumbha is the international alphabet of sanskrit transliteration what is the gloss? | SELECT "Gloss" FROM table_22517 WHERE "International Alphabet of Sanskrit Transliteration" = 'Kumbha' |
CREATE TABLE table_60214 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | How much money does the player with a 68-67-69-71=275 score have? | SELECT "Money ( \u00a3 )" FROM table_60214 WHERE "Score" = '68-67-69-71=275' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | were any medications prescribed to patient 27038 when they came to the hospital last time? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) |
CREATE TABLE table_13632 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
) | Which Rank has a Player of matt ruth? | SELECT SUM("Rank") FROM table_13632 WHERE "Player" = 'matt ruth' |
CREATE TABLE table_16703 (
"Year" real,
"Winners" text,
"Grand Finalist" text,
"Scores" text,
"Venue" text,
"Crowd" real,
"Margin" real,
"Season Result" text
) | what is the venue where the scores are 15.13 (103) 8.4 (52)? | SELECT "Venue" FROM table_16703 WHERE "Scores" = '15.13 (103) – 8.4 (52)' |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types ... | A bar chart for returning the number of the lot details of lots that belong to investors with details 'l'?, I want to rank by the how many lot details in descending. | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY COUNT(lot_details) DESC |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | how many patients have medicaid health insurance? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" |
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 TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
... | What are the number of different course codes? | SELECT COUNT(DISTINCT crs_code) FROM class |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Des... | The Reputation of Voters in This Election. | SELECT u.Reputation FROM Badges AS b LEFT JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'Constituent' AND CAST((JULIANDAY(Date) - JULIANDAY('2018-08-06')) * 1440.0 AS INT) > 0 |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | What are the name and population of each county? | SELECT county_name, population FROM county |
CREATE TABLE table_name_36 (
week VARCHAR,
venue VARCHAR,
attendance VARCHAR
) | What is the number of weeks where the venue was memorial stadium and the attendance was less than 41,252? | SELECT COUNT(week) FROM table_name_36 WHERE venue = "memorial stadium" AND attendance < 41 OFFSET 252 |
CREATE TABLE table_204_123 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) | was the attendance more or less in the saturday , april 13th game compared to the saturday , may 11th | SELECT (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, april 13') > (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, may 11') |
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 (
... | among patients admitted in the year less than 2203, how many of them were aged below 70? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" AND demographic.admityear < "2203" |
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREATE TABLE manager_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE manager... | What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007? | SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JO... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | find out the average age of patients whose marital status is single and ethnicity is hispanic/latino - puerto rican. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" |
CREATE TABLE table_66233 (
"Year" real,
"Stage" real,
"Start" text,
"Finish" text,
"Leader at the summit" text
) | What year was finish Toulouse, and stage was larger than 12? | SELECT SUM("Year") FROM table_66233 WHERE "Finish" = 'toulouse' AND "Stage" > '12' |
CREATE TABLE table_36288 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | WHICH Outcome IS ON 18 july 1993? | SELECT "Outcome" FROM table_36288 WHERE "Date" = '18 july 1993' |
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,
... | since 2105, what are the top four most frequent diagnoses that patients were given during the same hospital encounter after being diagnosed with ventricular tachycardia - sustained? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ventr... |
CREATE TABLE table_name_48 (
wins VARCHAR,
draws INTEGER
) | What is the total number of Wins, when Draws is less than 2? | SELECT COUNT(wins) FROM table_name_48 WHERE draws < 2 |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | what was the first type of hospital admission type of patient 3939? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 3939 ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE table_66047 (
"Hull Number" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | What year was the USS Cambridge laid down? | SELECT "Laid down" FROM table_66047 WHERE "Name" = 'uss cambridge' |
CREATE TABLE table_name_89 (
rank INTEGER,
player VARCHAR,
wins VARCHAR
) | What is the rank of Lee Trevino, who had less than 27 wins? | SELECT SUM(rank) FROM table_name_89 WHERE player = "lee trevino" AND wins < 27 |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE va... | How many courses for each office? Show me a bar chart, could you show by the x-axis in desc please? | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC |
CREATE TABLE table_1507852_5 (
cancelable VARCHAR,
bubbles VARCHAR
) | what's the cancelable with bubbles being yes | SELECT cancelable FROM table_1507852_5 WHERE bubbles = "Yes" |
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
)
... | to which religious background does the patient with patient id 6983 belong to? | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983" |
CREATE TABLE table_37107 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School/Club Team" text
) | What is the highest numbered pick from round 7? | SELECT MAX("Pick") FROM table_37107 WHERE "Round" = '7' |
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... | list patient identifications of patients who were diagnosed with ac/chr syst/dia hrt fail since 2 years ago. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac/chr syst/dia hrt fail') AND DATETIME(diagnoses_icd.charttime) >= DATETI... |
CREATE TABLE table_name_38 (
premiere VARCHAR,
rating VARCHAR
) | What was the date of the premiere that had a 20.9 rating? | SELECT premiere FROM table_name_38 WHERE rating = "20.9" |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | What are the number of the dates in which the mean sea level pressure was between 30.3 and 31? | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 |
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... | count the number of patients whose marital status is married and age is less than 31? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age < "31" |
CREATE TABLE table_28062 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many field goals did Donald Green score? | SELECT COUNT("Field goals") FROM table_28062 WHERE "Player" = 'Donald Green' |
CREATE TABLE aircraft (
Aircraft VARCHAR,
Aircraft_ID VARCHAR
)
CREATE TABLE MATCH (
Location VARCHAR,
Winning_Aircraft VARCHAR
) | Please list the location and the winning aircraft name. | SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft |
CREATE TABLE table_name_60 (
lms_spr VARCHAR,
car_no VARCHAR
) | Which is the LMS SPR when the car number was 15? | SELECT lms_spr FROM table_name_60 WHERE car_no = "15" |
CREATE TABLE table_77470 (
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | Which Run 4 has a Run 3 of 1:26.63? | SELECT "Run 4" FROM table_77470 WHERE "Run 3" = '1:26.63' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | how many patients died in or before 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0" |
CREATE TABLE table_80101 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Before 1956, what Chassis has Gordini Straight-4 engine with 3 points? | SELECT "Chassis" FROM table_80101 WHERE "Year" < '1956' AND "Engine" = 'gordini straight-4' AND "Points" = '3' |
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,
... | count the number of times that patient 031-15666 has received a anion gap test in the lab since 157 months ago. | 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 = '031-15666')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime) >= DATETIME(CURRE... |
CREATE TABLE table_name_4 (
rank INTEGER,
title VARCHAR
) | What is the rank of American Pie 2? | SELECT MIN(rank) FROM table_name_4 WHERE title = "american pie 2" |
CREATE TABLE table_60905 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | What's the total for the wc belgrade event with 10 rank points? | SELECT "Total" FROM table_60905 WHERE "Event" = 'wc belgrade' AND "Rank points" = '10' |
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
)
... | count the number of patients whose admission location is emergency room admit and age is less than 85? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.age < "85" |
CREATE TABLE table_54933 (
"Year" text,
"Team" text,
"Comp" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text
) | What year was the comp 33? | SELECT "Year" FROM table_54933 WHERE "Comp" = '33' |
CREATE TABLE table_15615 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Which date has a Record of 22-22? | SELECT "Date" FROM table_15615 WHERE "Record" = '22-22' |
CREATE TABLE table_name_12 (
round VARCHAR,
club VARCHAR
) | What round did the spartak moscow club play? | SELECT round FROM table_name_12 WHERE club = "spartak moscow" |
CREATE TABLE table_72293 (
"Season" text,
"League" text,
"Rank" real,
"Games" real,
"Points" real,
"GF" real,
"GA" real,
"Manager" text,
"Top Scorer" text,
"Goals" real
) | Who is the manager whose rank is 16? | SELECT "Manager" FROM table_72293 WHERE "Rank" = '16' |
CREATE TABLE table_20385 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) | Was there HDTV when the service was Priv ? | SELECT "HDTV" FROM table_20385 WHERE "Television service" = 'PRIVÈ' |
CREATE TABLE table_1181375_1 (
builder VARCHAR,
withdrawn VARCHAR
) | what's the builder where withdrawn is 1954 1958 | SELECT builder FROM table_1181375_1 WHERE withdrawn = "1954–1958" |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TA... | Give me a bar chart that the x-axis is the services and the Y is the count(services), and could you show bars from low to high order? | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clu... | How many different roles are there in the club 'Bootup Baltimore'? | SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore" |
CREATE TABLE table_name_94 (
date VARCHAR,
tournament VARCHAR
) | What is the date of the Outback Steakhouse Pro-Am Tournament? | SELECT date FROM table_name_94 WHERE tournament = "outback steakhouse pro-am" |
CREATE TABLE table_41009 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Conference Matchups" text,
"Payout ( US$ )" text
) | What stadium was the December 29, 2008 game played at? | SELECT "Stadium" FROM table_41009 WHERE "Date" = 'december 29, 2008' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.