table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | Please show the trend about the number of days with max temperature reaches 80 change over dates. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date |
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,
... | provide the number of patients whose diagnoses short title is routine circumcision and drug route is ng? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Routine circumcision" AND prescriptions.route = "NG" |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE prereq (
... | Find the total number of students in each department Show bar chart, and I want to show in descending by the total number. | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC |
CREATE TABLE table_26323 (
"Episode number Production number" text,
"Title" text,
"Original airing" text,
"Rating" text,
"Share" real,
"Rating/share (18\u201349)" text,
"Total viewers (in millions)" text
) | If the rating is 9.1, what was the total viewers? | SELECT "Total viewers (in millions)" FROM table_26323 WHERE "Rating" = '9.1' |
CREATE TABLE table_75802 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text,
"Notes" text
) | What is the Status of the dinosaur, whose notes are, 'n coelurosauria'? | SELECT "Status" FROM table_75802 WHERE "Notes" = 'n coelurosauria' |
CREATE TABLE table_5188 (
"Maryland Counties" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
) | What is the sum of all values in Fall 09 in Allegany county with Fall 07 less than 751? | SELECT SUM("Fall 09") FROM table_5188 WHERE "Maryland Counties" = 'allegany' AND "Fall 07" < '751' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id nu... | among patients who were prescribed with tromethamine, what is the five most frequently prescribed drug at the same time,? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'tromethamine') AS t1 JOIN (SELECT admissions.subject_id, prescrip... |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
r... | what is the difference between the total output and the input sum of patient 19175 on 11/04/2105? | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2105-11-04') - (SELE... |
CREATE TABLE table_76804 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the attendance when the Cincinnati Bengals were the opponents? | SELECT "Attendance" FROM table_76804 WHERE "Opponent" = 'cincinnati bengals' |
CREATE TABLE table_51492 (
"Games" text,
"Gold" text,
"Silver" text,
"Bronze" text,
"Total" text,
"Rank" text
) | How many golds were there in a game that has 17 bronze and a total of 31? | SELECT "Gold" FROM table_51492 WHERE "Bronze" = '17' AND "Total" = '31' |
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 ... | Get the admission time and procedure icd9 code for the patient with patient id 2560. | SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | what are the five most commonly given microbiology tests for patients who have previously had their unilat ing hern rep nos done within 2 months until 2104? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
CREATE TABLE table_3456 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What is every value of Top 10 when team is #10 Phil Parsons Racing and average finish is 22.9? | SELECT "Top 10" FROM table_3456 WHERE "Team(s)" = '#10 Phil Parsons Racing' AND "Avg. Finish" = '22.9' |
CREATE TABLE table_name_65 (
score VARCHAR,
date VARCHAR
) | What was the score on August 19? | SELECT score FROM table_name_65 WHERE date = "august 19" |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | whats the last ward id of patient 81783 during the first hospital encounter? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81783 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1 |
CREATE TABLE table_name_16 (
engine VARCHAR,
tire VARCHAR,
sponsor VARCHAR
) | What is the engine of the goodyear tire and Herdez as a sponsor? | SELECT engine FROM table_name_16 WHERE tire = "goodyear" AND sponsor = "herdez" |
CREATE TABLE table_78578 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the time of Troy Bayliss with less than 8 grids? | SELECT "Time" FROM table_78578 WHERE "Grid" < '8' AND "Rider" = 'troy bayliss' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | tell me the maximum sao2 for patient 004-13127's body today? | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND NOT vitalperiodic.sao2 IS NULL AND DATET... |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE cour... | What is the easiest class available that meets the Other requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c... |
CREATE TABLE table_name_71 (
date VARCHAR,
event VARCHAR
) | What is the Date for the Event ept copenhagen? | SELECT date FROM table_name_71 WHERE event = "ept copenhagen" |
CREATE TABLE table_7587 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | When did the Chargers play the Denver Broncos before Week 10? | SELECT "Date" FROM table_7587 WHERE "Week" < '10' AND "Opponent" = 'denver broncos' |
CREATE TABLE table_name_95 (
result VARCHAR,
game_site VARCHAR
) | What was the result of the game played at Jeppesen Stadium? | SELECT result FROM table_name_95 WHERE game_site = "jeppesen stadium" |
CREATE TABLE staff (
staff_id number,
staff_gender text,
staff_name text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE... | What are id and name of the products whose price is lower than 600 or higher than 900? | SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900 |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and sort by the y axis in desc please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC |
CREATE TABLE farm_competition (
competition_id number,
year number,
theme text,
host_city_id number,
hosts text
)
CREATE TABLE competition_record (
competition_id number,
farm_id number,
rank number
)
CREATE TABLE city (
city_id number,
official_name text,
status text,
... | What is the official name and status of the city with the most residents? | SELECT official_name, status FROM city ORDER BY population DESC LIMIT 1 |
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 departments (
DEP... | For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
CREATE TABLE table_67200 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the score with a place of t6 for the player k.j. choi? | SELECT "Score" FROM table_67200 WHERE "Place" = 't6' AND "Player" = 'k.j. choi' |
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year numbe... | In the year 2000, what is the campus fee for San Francisco State University? | SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000 |
CREATE TABLE table_75339 (
"Station" text,
"Services" text,
"Local authority" text,
"Zone 2007" text,
"Zone 2008" text,
"Zone 2010" text,
"Zone 2013" text
) | Which Services have a Local authority of chiltern, and a Zone 2010 of 9? | SELECT "Services" FROM table_75339 WHERE "Local authority" = 'chiltern' AND "Zone 2010" = '9' |
CREATE TABLE table_204_25 (
id number,
"rank" number,
"mountain peak" text,
"mountain range" text,
"elevation" text,
"prominence" text,
"isolation" text,
"location" text
) | which is taller , mount humphreys or mount kaweah . | SELECT "mountain peak" FROM table_204_25 WHERE "mountain peak" IN ('mount humphreys', 'mount kaweah') ORDER BY "elevation" DESC LIMIT 1 |
CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
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... | Show all payment method codes and the number of orders for each code in a bar chart, show by the y axis from low to high please. | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*) |
CREATE TABLE table_name_28 (
place VARCHAR,
player VARCHAR
) | What Place has a Player of tony jacklin? | SELECT place FROM table_name_28 WHERE player = "tony jacklin" |
CREATE TABLE table_name_49 (
overall VARCHAR,
player VARCHAR
) | When was petter ronnquist picked? | SELECT overall FROM table_name_49 WHERE player = "petter ronnquist" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | tell me the total number of patients in the 508 wards since 2102? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 508 AND STRFTIME('%y', patient.unitadmittime) >= '2102' |
CREATE TABLE table_55855 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the Home team with a crowd relevant to footscray? | SELECT "Crowd" FROM table_55855 WHERE "Home team" = 'footscray' |
CREATE TABLE table_24603 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
) | What was the final score when the game was @ roughriders? | SELECT "Final Score" FROM table_24603 WHERE "Opponent" = '@ Roughriders' |
CREATE TABLE table_1557974_1 (
ring_name VARCHAR,
current_rank VARCHAR
) | Which ring names are currently ranked f0 j ry 3 west? | SELECT ring_name FROM table_1557974_1 WHERE current_rank = "f0 Jūryō 3 West" |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | How many stadiums does each country have Show bar chart, and rank by the Y-axis in descending. | SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY COUNT(*) DESC |
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... | Tag associated with 'homework' tag. | SELECT COUNT(*), at.TagName FROM PostTags AS a JOIN PostTags AS b ON (a.PostId = b.PostId) JOIN Tags AS at ON (a.TagId = at.Id) JOIN Tags AS bt ON (b.TagId = bt.Id) WHERE bt.TagName = 'homework' AND at.TagName != 'homework' GROUP BY at.TagName ORDER BY 1 DESC |
CREATE TABLE table_44162 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the overall sum of round 3? | SELECT SUM("Overall") FROM table_44162 WHERE "Round" = '3' |
CREATE TABLE table_77471 (
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | Which Run 4 has a Run 1 of 1:25.82? | SELECT "Run 4" FROM table_77471 WHERE "Run 1" = '1:25.82' |
CREATE TABLE table_23408094_14 (
span_of_years_led INTEGER,
tournament_at_which_lead_began VARCHAR
) | Of the players whose lead began at the australian championships, what was the shortest span of years led? | SELECT MIN(span_of_years_led) FROM table_23408094_14 WHERE tournament_at_which_lead_began = "Australian Championships" |
CREATE TABLE table_train_63 (
"id" int,
"immune_suppression" bool,
"leukocyte_count" int,
"need_hemodialysis" bool,
"head_injury" bool,
"periodic_paralysis" bool,
"renal_disease" bool,
"glasgow_come_score_gcs" int,
"sepsis" bool,
"pancreatitis" bool,
"enteral_feeding" bool,
... | head trauma with a glasgow come score ( gcs ) less or equal to 5 | SELECT * FROM table_train_63 WHERE head_injury = 1 AND glasgow_come_score_gcs <= 5 |
CREATE TABLE table_204_524 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | which division were they in the most ? | SELECT "division" FROM table_204_524 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_200_1 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | what is the name of the movie where mischa barton plays the role of ms. monica ? | SELECT "title" FROM table_200_1 WHERE "role" = 'ms. monica' |
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, a bar chart shows the distribution of headquarter and the average of manufacturer , and group by attribute headquarter. | SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
CREATE TABLE table_name_61 (
production_company VARCHAR,
producer_s_ VARCHAR
) | For which production company did Sam Mccarthy produce? | SELECT production_company FROM table_name_61 WHERE producer_s_ = "sam mccarthy" |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | Return a bar chart about the distribution of login_name and author_id . | SELECT login_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name |
CREATE TABLE table_16423070_4 (
golf VARCHAR,
soccer VARCHAR
) | how many teams won at golf when wooster won soccer | SELECT COUNT(golf) FROM table_16423070_4 WHERE soccer = "Wooster" |
CREATE TABLE table_78540 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School" text
) | Which round was Tom Morris picked in? | SELECT COUNT("Round") FROM table_78540 WHERE "Player" = 'tom morris' |
CREATE TABLE table_75904 (
"RR Romaja" text,
"M\u2013R Romaja" text,
"Hangul/Chosongul" text,
"Hanja" text,
"Area" text,
"Capital" text,
"Region" text,
"Country" text
) | Which capital has a Hangul of ? | SELECT "Capital" FROM table_75904 WHERE "Hangul/Chosongul" = '경상남도' |
CREATE TABLE table_29697744_1 (
movements VARCHAR,
position VARCHAR
) | what is the name of the movement in the 7th position | SELECT movements FROM table_29697744_1 WHERE position = "7th" |
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Descri... | Show the number of documents in different ending date and group by ending date with a line chart. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To |
CREATE TABLE table_name_35 (
second VARCHAR,
nation VARCHAR
) | Who was second for the United States team? | SELECT second FROM table_name_35 WHERE nation = "united states" |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
... | please find all the flights from CINCINNATI to any airport in the NEW YORK area that arrive next saturday before 1800 | 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 ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 26 AND da... |
CREATE TABLE table_28484 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | How many times is the original artist Alicia keys? | SELECT COUNT("Result") FROM table_28484 WHERE "Original artist" = 'Alicia Keys' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | did patient 006-62367 ever underwent any therapeutic antibacterials - vancomycin procedure in 2105? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-62367')) AND treatment.treatmentname = 'therapeutic antibacterials - van... |
CREATE TABLE table_name_89 (
place VARCHAR,
score VARCHAR,
country VARCHAR
) | When the score is 71 and the player is from United States what is the place? | SELECT place FROM table_name_89 WHERE score = 71 AND country = "united states" |
CREATE TABLE table_7254 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What score has notts county as the home team? | SELECT "Score" FROM table_7254 WHERE "Home team" = 'notts county' |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats 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
)
... | What are the names of artists who are Male and are from UK? | SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male" |
CREATE TABLE table_75955 (
"Tournament" text,
"2006" text,
"2009" text,
"2012" text,
"2013" text
) | What is the 2006 when the 2013 is 1r, and the 2012 is 1r? | SELECT "2006" FROM table_75955 WHERE "2013" = '1r' AND "2012" = '1r' |
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 drug patient 22648 had been prescribed two or more times in 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 = 22648) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ... |
CREATE TABLE table_204_699 (
id number,
"district" text,
"name" text,
"party" text,
"residence" text,
"first served" number
) | nelsano albano served in the same year as which washington twp . member ? | SELECT "name" FROM table_204_699 WHERE "name" <> 'nelson albano' AND "first served" = (SELECT "first served" FROM table_204_699 WHERE "name" = 'nelson albano') AND "residence" = 'washington twp' |
CREATE TABLE table_name_95 (
score VARCHAR,
place VARCHAR
) | Which Score has a Place of t2? | SELECT score FROM table_name_95 WHERE place = "t2" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | what time was the last time patient 006-2586 had the maximum respiration value today? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND NOT vitalperiodic.respiration IS NU... |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Buscando posts sobre windows phone de 2018 at hoje. | SELECT Id, LastActivityDate, CreationDate, Score, ViewCount, Body, OwnerUserId, Title, Tags, AnswerCount FROM Posts WHERE Tags LIKE '%<windows-phone%' AND PostTypeId = 1 AND CreationDate >= '01/01/2018' ORDER BY LastActivityDate DESC |
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_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | For those employees who did not have any job in the past, visualize the relationship between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
CREATE TABLE table_53963 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | What type of object has an NGC number higher than 2090 and has a right ascension (J2000) of 05h52m19s? | SELECT "Object type" FROM table_53963 WHERE "NGC number" > '2090' AND "Right ascension ( J2000 )" = '05h52m19s' |
CREATE TABLE table_14378 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Distance" text
) | In which year did he finish 8th? | SELECT "Year" FROM table_14378 WHERE "Result" = '8th' |
CREATE TABLE table_name_77 (
year VARCHAR,
national_champion VARCHAR
) | In what Year was Rhode Island the National Champion? | SELECT year FROM table_name_77 WHERE national_champion = "rhode island" |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_s... | give me US flights for next wednesday from CLEVELAND to MIAMI | 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 = 'MIAMI' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da... |
CREATE TABLE table_19778010_5 (
game INTEGER,
date VARCHAR
) | What's the number of the game played on June 22? | SELECT MAX(game) FROM table_19778010_5 WHERE date = "June 22" |
CREATE TABLE table_19338 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall FHT points" text,
"Overall WC points (Rank)" text
) | How many total points did roman Koudelka have | SELECT "Overall WC points (Rank)" FROM table_19338 WHERE "Name" = 'Roman Koudelka' |
CREATE TABLE table_name_22 (
tries_against VARCHAR,
tries_for VARCHAR
) | What is Tries Against, when Tries For is 20? | SELECT tries_against FROM table_name_22 WHERE tries_for = "20" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | when is the last time patient 015-52724 has had a heartrate measurement since 2 days ago? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724')) AND NOT vitalperiodic.heartrate IS NUL... |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | is there a meal on DL flight 852 from SAN FRANCISCO to DALLAS FORT WORTH | SELECT DISTINCT food_service.compartment, food_service.meal_code, food_service.meal_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, food_service WHERE (((CITY_1.city_code = AIRPORT_SERVI... |
CREATE TABLE table_3313 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
) | What were the LOA metres for the yacht ichi ban? | SELECT "LOA (Metres)" FROM table_3313 WHERE "Yacht" = 'Ichi Ban' |
CREATE TABLE table_58606 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | Which tournament resulted in 6th place? | SELECT "Tournament" FROM table_58606 WHERE "Result" = '6th' |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
... | Give me a group line chart showing the number of documents in different ending date The x-axis is ending date and group by location code, rank by the x axis from low to high please. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code, Date_in_Locaton_To ORDER BY Date_in_Locaton_To |
CREATE TABLE table_59946 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
) | How tall is the structure built in 1907? | SELECT "Height ft (m)" FROM table_59946 WHERE "Year" = '1907' |
CREATE TABLE table_49496 (
"Issued" real,
"Type" text,
"Design" text,
"Serial format" text,
"Serials issued" text
) | What is the issued serial given in 1966? | SELECT "Serials issued" FROM table_49496 WHERE "Issued" = '1966' |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | Find the name and account balance of the customer whose name includes the letter a Visualize them using a bar chart, show y-axis in descending order. | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal DESC |
CREATE TABLE table_name_77 (
object_type VARCHAR,
right_ascension___j2000__ VARCHAR
) | what is the object type when the right ascension (j2000) is 11h10m42.8s? | SELECT object_type FROM table_name_77 WHERE right_ascension___j2000__ = "11h10m42.8s" |
CREATE TABLE table_name_96 (
loss VARCHAR,
record VARCHAR
) | What loss has 26-9 as a loss? | SELECT loss FROM table_name_96 WHERE record = "26-9" |
CREATE TABLE table_203_620 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"attendance" number
) | which team was the first team to score six goals ? | SELECT "home team" FROM table_203_620 WHERE "score" = 6 LIMIT 1 |
CREATE TABLE table_68203 (
"Team" text,
"City" text,
"Stadium" text,
"Manager" text,
"Past season" text
) | what stadium has a prior record of 7th? | SELECT "Stadium" FROM table_68203 WHERE "Past season" = '7th' |
CREATE TABLE table_47749 (
"Elector" text,
"Nationality" text,
"Order and title" text,
"Elevated" text,
"Elevator" text
) | When the elevator was Innocent IV what was the nationality? | SELECT "Nationality" FROM table_47749 WHERE "Elevator" = 'innocent iv' |
CREATE TABLE attribute_definitions (
attribute_id number,
attribute_name text,
attribute_data_type text
)
CREATE TABLE catalog_contents (
catalog_entry_id number,
catalog_level_number number,
parent_entry_id number,
previous_entry_id number,
next_entry_id number,
catalog_entry_name ... | Find all the catalog publishers whose name contains 'Murray | SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%" |
CREATE TABLE table_31945 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Tell me the tournament with a hard surface for 6 1, 6 2 | SELECT "Tournament" FROM table_31945 WHERE "Surface" = 'hard' AND "Score" = '6–1, 6–2' |
CREATE TABLE table_66262 (
"Event" text,
"Performance" text,
"Athlete" text,
"Nation" text,
"Place" text,
"Date" text
) | What's the date when Yelena Isinbayeva for Russia was in Beijing, China? | SELECT "Date" FROM table_66262 WHERE "Nation" = 'russia' AND "Place" = 'beijing, china' AND "Athlete" = 'yelena isinbayeva' |
CREATE TABLE table_28540609_2 (
earnings__ VARCHAR,
best_finish VARCHAR
) | How many earnings values are associated with players who had a best finish of T38? | SELECT COUNT(earnings__) AS €_ FROM table_28540609_2 WHERE best_finish = "T38" |
CREATE TABLE table_58991 (
"Name" text,
"Years" text,
"MLS Cup" real,
"U.S. Open Cup" real,
"CONCACAF" real,
"Other" real,
"Total" real
) | What is the total where there are 4 MLS Cups and more US Open Cups than 1? | SELECT COUNT("Total") FROM table_58991 WHERE "MLS Cup" = '4' AND "U.S. Open Cup" > '1' |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGu... | High Rep users with the peer pressure badge. A way to find which users (mostly high rep) have the peer pressure badge. Was just playing around with T-SQL and cooked this. =D | SELECT Id AS "user_link", DisplayName, Reputation FROM Users WHERE Reputation > @RepLimit AND NOT EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Peer Pressure') ORDER BY Reputation DESC |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients with drug code glyb5 died in or before 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2115.0" AND prescriptions.formulary_drug_cd = "GLYB5" |
CREATE TABLE table_4036 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which junior team is associated with an NHL pick by the Buffalo Sabres? | SELECT "College/junior/club team" FROM table_4036 WHERE "NHL team" = 'Buffalo Sabres' |
CREATE TABLE table_name_29 (
jianshu INTEGER,
rank VARCHAR,
qiangshu VARCHAR
) | What is the average Jianshu higher than rank 2, with a Qiangshu smaller than 9.85? | SELECT AVG(jianshu) FROM table_name_29 WHERE rank < 2 AND qiangshu < 9.85 |
CREATE TABLE table_204_443 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number,
"bye" text
) | what is the date for the first game played in the meadowlands ? | SELECT "date" FROM table_204_443 WHERE "game site" = 'the meadowlands' ORDER BY "date" LIMIT 1 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose admission location is phys referral/normal deli and diagnoses short title is 29-30 comp wks gestation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "29-30 comp wks gestation" |
CREATE TABLE table_name_33 (
top_25 INTEGER,
events VARCHAR,
cuts_made VARCHAR
) | Tell me the average top 25 with events of 5 and cuts madde less than 3 | SELECT AVG(top_25) FROM table_name_33 WHERE events = 5 AND cuts_made < 3 |
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rat... | Find all cities which has a ' Taj Mahal ' . | SELECT city FROM business WHERE name = 'Taj Mahal' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.