answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT manner_of_departure FROM table_27383390_4 WHERE incoming_head_coach = "Mohammad Khakpour" | What is the manner of departure when the incoming head coach is mohammad khakpour? | CREATE TABLE table_27383390_4 (manner_of_departure VARCHAR, incoming_head_coach VARCHAR) |
SELECT team FROM table_name_45 WHERE year = 2000 | Which Team has a Year of 2000? | CREATE TABLE table_name_45 (team VARCHAR, year VARCHAR) |
SELECT "2007" FROM table_76405 WHERE "2003" = 'desert prince' | What is the 2007 for the 2003 desert prince? | CREATE TABLE table_76405 (
"Year" text,
"2009" text,
"2008" text,
"2007" text,
"2006" text,
"2005" text,
"2004" text,
"2003" text
) |
SELECT original_air_date FROM table_27389024_2 WHERE written_by = "Rama Stagner" | What is the original air date of the episode that was written by Rama Stagner? | CREATE TABLE table_27389024_2 (original_air_date VARCHAR, written_by VARCHAR) |
SELECT 2010 FROM table_name_33 WHERE tournament = "australian open" | What is the info for the year 2010, for the Australian Open tournament? | CREATE TABLE table_name_33 (tournament VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "30" | give the number of patients who have been transferred within this facility and have stayed in the hospital for more than 30 days. | 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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) |
SELECT MAX(pos) FROM table_27396005_2 WHERE car = 19 | For the #19 car, what was their finish position? | CREATE TABLE table_27396005_2 (pos INTEGER, car VARCHAR) |
SELECT android FROM table_name_42 WHERE other_unix = "unknown" | Which Android has anOther Unix of unknown? | CREATE TABLE table_name_42 (android VARCHAR, other_unix VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abn react-procedure NOS" AND lab."CATEGORY" = "Chemistry" | what is the number of patients categorized under chemistry lab test who have diagnoses of unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at the time of procedure? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) |
SELECT COUNT(constructor) FROM table_27396005_2 WHERE grid = 13 | How many constructors had a grid of 13? | CREATE TABLE table_27396005_2 (constructor VARCHAR, grid VARCHAR) |
SELECT mac_os_x FROM table_name_66 WHERE amigaos = "partial" | Which Mac OS X has an AmigaOS of partial? | CREATE TABLE table_name_66 (mac_os_x VARCHAR, amigaos VARCHAR) |
SELECT "owner" FROM table_204_781 WHERE id = 1 | who is the first owner listed in the top portion of the table ? | CREATE TABLE table_204_781 (
id number,
"name(s)" text,
"yard no." number,
"type (as built)" text,
"owner" text,
"imo number" number,
"laid down" text,
"launched" text,
"delivered/\ncommissioned" text,
"fate/\ndecommissioned" text,
"notes" text
) |
SELECT MAX(pos) FROM table_27396005_2 WHERE constructor = "Joe Gibbs Racing" AND driver = "Denny Hamlin" | What was the maximum finish position of the car whose constructor was Joe Gibbs Racing, driven by Denny Hamlin? | CREATE TABLE table_27396005_2 (pos INTEGER, constructor VARCHAR, driver VARCHAR) |
SELECT mac_os_x FROM table_name_88 WHERE linux = "no" AND amigaos = "no" AND android = "unknown" | Which Mac OS X has a Linux of no, and an AmigaOS of no, and an Android of unknown? | CREATE TABLE table_name_88 (mac_os_x VARCHAR, android VARCHAR, linux VARCHAR, amigaos VARCHAR) |
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '016-27397' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime LIMIT 1 | how many hours have passed since the first time that patient 016-27397 was given a procedure during the current hospital visit? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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 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 time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
) |
SELECT title FROM table_27397948_2 WHERE no_in_series = 57 | List all titles with a 57 series number. | CREATE TABLE table_27397948_2 (title VARCHAR, no_in_series VARCHAR) |
SELECT score FROM table_name_54 WHERE opponent = "golden state warriors" | What was the score for the game against the Golden State Warriors? | CREATE TABLE table_name_54 (score VARCHAR, opponent VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.itemid = "50993" | what is the number of patients whose admission year is less than 2129 and item id is 50993? | 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
)
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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) |
SELECT MAX(no_in_season) FROM table_27397948_2 WHERE no_in_series = 47 | What's the highest season number with a series number of 47? | CREATE TABLE table_27397948_2 (no_in_season INTEGER, no_in_series VARCHAR) |
SELECT score FROM table_name_57 WHERE game = 43 | What was the score of game 43? | CREATE TABLE table_name_57 (score VARCHAR, game VARCHAR) |
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND STRFTIME('%y', transfers.intime) = '2105') | how many patients in the ccu careunit in 2105? | 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
) |
SELECT written_by FROM table_27397948_2 WHERE no_in_season = 7 | Who was the writer for season episode 7? | CREATE TABLE table_27397948_2 (written_by VARCHAR, no_in_season VARCHAR) |
SELECT team FROM table_name_70 WHERE date = "february 1" | Who was the opposing team for the February 1 game? | CREATE TABLE table_name_70 (team VARCHAR, date VARCHAR) |
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058')) AND STRFTIME('%y-%m', medication.drugstarttime) >= '2105-05' ORDER BY medication.drugstarttime LIMIT 1 | when was the first time since 05/2105 that a medication prescribed to patient 022-89058. | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
) |
SELECT directed_by FROM table_27401228_1 WHERE us_viewers__million_ = "5.86" | Name who directed when the viewers is 5.86 | CREATE TABLE table_27401228_1 (directed_by VARCHAR, us_viewers__million_ VARCHAR) |
SELECT SUM(year) FROM table_name_37 WHERE team = "porsche kremer racing" | What's the total of Year that's got a Team of Porsche Kremer Racing? | CREATE TABLE table_name_37 (year INTEGER, team VARCHAR) |
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 = 'drug withdrawal syndrome - alcohol') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 4 | what are the top four most frequently given diagnoses that patients were given in the same hospital visit after being diagnosed with drug withdrawal syndrome - alcohol? | 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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) |
SELECT location FROM table_27409644_1 WHERE club = "Lootos Põlva" | Where is lootos põlva from? | CREATE TABLE table_27409644_1 (location VARCHAR, club VARCHAR) |
SELECT class FROM table_name_16 WHERE chassis = "mazda 787b" | Which Class has a Chassis of Mazda 787B? | CREATE TABLE table_name_16 (class VARCHAR, chassis VARCHAR) |
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) | A bar chart for listing the number of the names of patients who have made appointments, and order from low to high by the y axis. | CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom TEXT
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Block (
BlockFloor INTEGER,
BlockCode INTEGER
)
CREATE TABLE Trained_In (
Physician INTEGER,
Treatment INTEGER,
CertificationDate DATETIME,
CertificationExpires DATETIME
)
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Department (
DepartmentID INTEGER,
Name VARCHAR(30),
Head INTEGER
)
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Medication (
Code INTEGER,
Name VARCHAR(30),
Brand VARCHAR(30),
Description VARCHAR(30)
)
CREATE TABLE Prescribes (
Physician INTEGER,
Patient INTEGER,
Medication INTEGER,
Date DATETIME,
Appointment INTEGER,
Dose VARCHAR(30)
) |
SELECT manager FROM table_27409644_1 WHERE club = "Lootos Põlva" | Who is the manager for lootos põlva? | CREATE TABLE table_27409644_1 (manager VARCHAR, club VARCHAR) |
SELECT year FROM table_name_55 WHERE tyre = "d" AND chassis = "mazda 787" | What Year has a Tyre of D, and Chassis of Mazda 787? | CREATE TABLE table_name_55 (year VARCHAR, tyre VARCHAR, chassis VARCHAR) |
SELECT location FROM table_1140082_2 WHERE race = "German Grand Prix" | Where is the German Grand Prix? | CREATE TABLE table_1140082_2 (
location VARCHAR,
race VARCHAR
) |
SELECT location FROM table_27409644_1 WHERE ground = "Lootospark" | Where is lootospark from? | CREATE TABLE table_27409644_1 (location VARCHAR, ground VARCHAR) |
SELECT SUM(laps) FROM table_name_16 WHERE year < 1987 | What is the total number of Laps that's got a Year less than 1987? | CREATE TABLE table_name_16 (laps INTEGER, year INTEGER) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2198" AND procedures.long_title = "Circumcision" | give the number of patients who were admitted before the year 2198 and undergone the procedure circumcision. | 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,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) |
SELECT manager FROM table_27409644_1 WHERE club = "Pärnu" | Who is the pärnu manager? | CREATE TABLE table_27409644_1 (manager VARCHAR, club VARCHAR) |
SELECT MIN(week) FROM table_name_76 WHERE result = "l 35-10" | In what week was the Result L 35-10? | CREATE TABLE table_name_76 (week INTEGER, result VARCHAR) |
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a scatter chart about the correlation between employee_id and commission_pct . | 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(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
) |
SELECT location FROM table_27409644_1 WHERE manager = "Richard Barnwell" | Where is the team that is managed by richard barnwell from? | CREATE TABLE table_27409644_1 (location VARCHAR, manager VARCHAR) |
SELECT played FROM table_name_33 WHERE points_against = "263" | What is listed for Played that has Points against of 263? | CREATE TABLE table_name_33 (played VARCHAR, points_against VARCHAR) |
SELECT AVG("Lose") FROM table_78172 WHERE "Lost point" > '16' AND "Goal difference" < '37' AND "Point" < '43' | I want the average lose for lost point more than 16 and goal difference less than 37 and point less than 43 | CREATE TABLE table_78172 (
"Season" real,
"Belonging league" text,
"Matches" real,
"league point" real,
"Draw" real,
"Lose" real,
"Goal difference" real,
"Point" real,
"Lost point" real,
"Final rank" real
) |
SELECT ground FROM table_27409644_1 WHERE club = "Flora Tallinn" | What is the home location for team flora tallinn? | CREATE TABLE table_27409644_1 (ground VARCHAR, club VARCHAR) |
SELECT played FROM table_name_35 WHERE club = "morriston rfc" | What is listed under Played that has a Club of Morriston RFC? | CREATE TABLE table_name_35 (played VARCHAR, club VARCHAR) |
SELECT gender, COUNT(*) FROM customers GROUP BY gender | Show the number of customers for each gender. | CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE orders (
order_id number,
customer_id number,
date_order_placed time,
order_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
date_account_opened time,
account_name text,
other_account_details text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity text,
other_order_item_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
email_address text,
login_name text,
login_password text,
phone_number text,
town_city text,
state_county_province text,
country text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code text,
unit_price number,
product_name text,
product_color text,
product_size text
)
CREATE TABLE invoices (
invoice_number number,
order_id number,
invoice_date time
)
CREATE TABLE product_categories (
production_type_code text,
product_type_description text,
vat_rating number
) |
SELECT us_viewers__million_ FROM table_27403436_1 WHERE written_by = "Shana Goldberg-Meehan & Greg Malins" | How many viewers watched the episode written by shana goldberg-meehan & greg malins? | CREATE TABLE table_27403436_1 (us_viewers__million_ VARCHAR, written_by VARCHAR) |
SELECT tries_against FROM table_name_95 WHERE played = "22" AND club = "ystalyfera rfc" | What is listed for the Tries against that has a Played of 22, along with a Club of Ystalyfera RFC? | CREATE TABLE table_name_95 (tries_against VARCHAR, played VARCHAR, club VARCHAR) |
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 51977 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime LIMIT 1 | when did patient 51977 last year for the first time leave the hospital? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 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,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
) |
SELECT no FROM table_27403436_1 WHERE production_code = "2J5809" | which number lists the production code as 2j5809 | CREATE TABLE table_27403436_1 (no VARCHAR, production_code VARCHAR) |
SELECT points_for FROM table_name_14 WHERE "club" = "club" | What is listed for Points for that has a Club of Club? | CREATE TABLE table_name_14 (points_for VARCHAR) |
SELECT nationality FROM table_name_21 WHERE pick = "415" | Which nationality's pick was 415? | CREATE TABLE table_name_21 (
nationality VARCHAR,
pick VARCHAR
) |
SELECT position FROM table_274117_5 WHERE player = "Bob Lilly" | What position was Bob Lilly? | CREATE TABLE table_274117_5 (position VARCHAR, player VARCHAR) |
SELECT losing_bonus FROM table_name_29 WHERE try_bonus = "8" | Which Losing Bonus has a Try Bonus of 8? | CREATE TABLE table_name_29 (losing_bonus VARCHAR, try_bonus VARCHAR) |
SELECT opposition FROM table_name_17 WHERE city = "taunton" | Which Opposition has a City of taunton? | CREATE TABLE table_name_17 (
opposition VARCHAR,
city VARCHAR
) |
SELECT seasons_by_team FROM table_274117_5 WHERE position = "OL" AND number = 11 | What are seasons by team for Pro Bowl appearances of the player who was an OL and had 11 appearances? | CREATE TABLE table_274117_5 (seasons_by_team VARCHAR, position VARCHAR, number VARCHAR) |
SELECT drawn FROM table_name_23 WHERE try_bonus = "5" AND points_for = "517" | What is listed for the Drawn that has a Tray bonus of 5 wiht Points for of 517? | CREATE TABLE table_name_23 (drawn VARCHAR, try_bonus VARCHAR, points_for VARCHAR) |
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'opioid/other dep-unspec') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3 | what are the three most commonly prescribed medications for patients who have previously been diagnosed with opioid/other dep-unspec within 2 months, since 4 years ago? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
) |
SELECT position FROM table_274117_5 WHERE year_of_induction_into_pro_football_hall_of_fame = "1980" | What position was the player who was inducted into the Pro Football Hall of Fame in 1980? | CREATE TABLE table_274117_5 (position VARCHAR, year_of_induction_into_pro_football_hall_of_fame VARCHAR) |
SELECT AVG(top_10) FROM table_name_57 WHERE cuts_made = 10 AND top_25 > 6 | Name the average top-10 for cuts made of 10 and top-25 more than 6 | CREATE TABLE table_name_57 (top_10 INTEGER, cuts_made VARCHAR, top_25 VARCHAR) |
SELECT radio_commentator FROM table_2794180_11 WHERE television_commentator = "Jan Gabrielsson" | Who made the comments for radio broadcast when Jan Gabrielsson made them for television broadcast? | CREATE TABLE table_2794180_11 (
radio_commentator VARCHAR,
television_commentator VARCHAR
) |
SELECT year_of_induction_into_pro_football_hall_of_fame FROM table_274117_5 WHERE player = "Will Shields" | When was Will Shields inducted into the Pro Football Hall of Fame? | CREATE TABLE table_274117_5 (year_of_induction_into_pro_football_hall_of_fame VARCHAR, player VARCHAR) |
SELECT MAX(top_5) FROM table_name_88 WHERE events < 16 AND wins < 0 | Name the most top-5 for wins less than 0 and events less than 16 | CREATE TABLE table_name_88 (top_5 INTEGER, events VARCHAR, wins VARCHAR) |
SELECT Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE 'what have you tried%' AND LENGTH(Text) < 75 ORDER BY LENGTH(Text), Id | Short WHYT comments, Id only. | 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 PostHistoryTypes (
Id number,
Name text
)
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
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
) |
SELECT MIN(number) FROM table_274117_5 | What is the fewest amount of Pro Bowl appearances any of the players had? | CREATE TABLE table_274117_5 (number INTEGER) |
SELECT MIN(top_10) FROM table_name_10 WHERE cuts_made < 11 AND wins > 0 | Name the least top-10 for cuts made less than 11 and wins more than 0 | CREATE TABLE table_name_10 (top_10 INTEGER, cuts_made VARCHAR, wins VARCHAR) |
SELECT "Movements" FROM table_31288 WHERE "Position" = '7th' | what is the name of the movement in the 7th position | CREATE TABLE table_31288 (
"Season" text,
"Level" text,
"Division" text,
"Section" text,
"Position" text,
"Movements" text
) |
SELECT live_births_per_year FROM table_27434_2 WHERE life_expectancy_total = "65.1" | How many live births per year do people with a life expectancy of 65.1 have? | CREATE TABLE table_27434_2 (live_births_per_year VARCHAR, life_expectancy_total VARCHAR) |
SELECT MIN(cuts_made) FROM table_name_90 WHERE top_10 < 11 AND top_5 > 2 AND top_25 < 6 | Name the least cuts for top-5 more than 2 with top 25 less than 6 and top 10 less than 11 | CREATE TABLE table_name_90 (cuts_made INTEGER, top_25 VARCHAR, top_10 VARCHAR, top_5 VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "PTT" | How many patients admitted before the year 2164 had a test for PTT? | 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid 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
) |
SELECT period FROM table_27434_2 WHERE life_expectancy_total = "62.4" | What period was the life expectancy at 62.4? | CREATE TABLE table_27434_2 (period VARCHAR, life_expectancy_total VARCHAR) |
SELECT preservation FROM table_name_16 WHERE episode = "1b-16 (42)" | Has Episode 1b-16 (42) been preserved? | CREATE TABLE table_name_16 (preservation VARCHAR, episode VARCHAR) |
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Tracy Farmer" | what is admission time and discharge time of subject name tracy farmer? | 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) |
SELECT COUNT(year) FROM table_27435931_1 WHERE continent = "Australia/Oceania" | In what year is australia/oceania listed? | CREATE TABLE table_27435931_1 (year VARCHAR, continent VARCHAR) |
SELECT SUM(domestic_passengers) FROM table_name_38 WHERE _percentage_change_2005_2006 = "10.9%" AND freight__metric_tonnes_ < 4 OFFSET 022 | What is the sum of all domestic passengers with 10.9% change and less than 4,022 tonnes in freight? | CREATE TABLE table_name_38 (domestic_passengers INTEGER, _percentage_change_2005_2006 VARCHAR, freight__metric_tonnes_ VARCHAR) |
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output (ml)-urethral catheter latex;temperature probe 14 fr.' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-89 month') | had patient 017-59454 excreted any output (ml)-urethral catheter latex;temperature probe 14 fr. since 89 months ago? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
drugstarttime time,
drugstoptime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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 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
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
) |
SELECT elevation_m FROM table_27435931_1 WHERE year = "September 2009" | what was the elevation in september 2009? | CREATE TABLE table_27435931_1 (elevation_m VARCHAR, year VARCHAR) |
SELECT 2004 FROM table_name_34 WHERE 2003 = "1r" AND tournament = "wimbledon" | Which in 2004 has a 2003 of 1r and Wimbledon Tournament | CREATE TABLE table_name_34 (tournament VARCHAR) |
SELECT "Points for" FROM table_74945 WHERE "Played" = '22' AND "Tries against" = '43' | If played is 22 and the tries against are 43, what are the points? | CREATE TABLE table_74945 (
"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
) |
SELECT continent FROM table_27435931_1 WHERE country = "Russia" | what is the continent in which the country russia is listed? | CREATE TABLE table_27435931_1 (continent VARCHAR, country VARCHAR) |
SELECT 2007 FROM table_name_16 WHERE 2004 = "olympic games" | What is in 2007 has 2004 olympic games? | CREATE TABLE table_name_16 (Id VARCHAR) |
SELECT production_code FROM table_25604014_9 WHERE written_by = "Theresa Rebeck" | Name the production code for theresa rebeck | CREATE TABLE table_25604014_9 (
production_code VARCHAR,
written_by VARCHAR
) |
SELECT MIN(elevation_ft) FROM table_27435931_1 WHERE year = "April 2006" | what was the lowest elevation in april 2006? | CREATE TABLE table_27435931_1 (elevation_ft INTEGER, year VARCHAR) |
SELECT 2002 FROM table_name_85 WHERE 2001 = "1–0" AND 2000 = "3–0" | What is in 2002 has a 2001 score 1–0, and a 2000 of 3–0? | CREATE TABLE table_name_85 (Id VARCHAR) |
SELECT fleet_numbers FROM table_name_68 WHERE diagram < 99 AND built = "1960" | What fleet numbers have a diagram less than 99 and built in 1960? | CREATE TABLE table_name_68 (
fleet_numbers VARCHAR,
diagram VARCHAR,
built VARCHAR
) |
SELECT COUNT(elevation_ft) FROM table_27435931_1 WHERE country = "Tanzania" | what is elevation of tanzania? | CREATE TABLE table_27435931_1 (elevation_ft VARCHAR, country VARCHAR) |
SELECT 2003 FROM table_name_84 WHERE career_win_loss = "6–7" | What is in 2003 that has a Career Win-Loss of 6–7 | CREATE TABLE table_name_84 (career_win_loss VARCHAR) |
SELECT "Engine" FROM table_48183 WHERE "Entrant" = 'mercedes amg petronas f1 team' AND "Points" = '93' | What engine has the Mercedes AMG Petronas f1 team, and 93 points? | CREATE TABLE table_48183 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
) |
SELECT elevation_ft FROM table_27435931_1 WHERE continent = "South America" | what is the elevation of south america? | CREATE TABLE table_27435931_1 (elevation_ft VARCHAR, continent VARCHAR) |
SELECT score FROM table_name_11 WHERE decision = "parent" AND home = "philadelphia" AND visitor = "pittsburgh" | What is the score of the game that had a decision of Parent, home team of Philadelphia, and visitor of Pittsburgh? | CREATE TABLE table_name_11 (score VARCHAR, visitor VARCHAR, decision VARCHAR, home VARCHAR) |
SELECT "Athlete" FROM table_44347 WHERE "Time" = '30:48' | What is the name of the athlete with a time of 30:48? | CREATE TABLE table_44347 (
"Rank" text,
"Time" text,
"Athlete" text,
"Nation" text,
"Date" text,
"Race" text
) |
SELECT no_in_season FROM table_27437601_2 WHERE directed_by = "Brad Tanenbaum" AND no_in_series > 241.0 | List the season above 241.0 that was handled by brad tanenbaum. | CREATE TABLE table_27437601_2 (no_in_season VARCHAR, directed_by VARCHAR, no_in_series VARCHAR) |
SELECT MIN(top_5) FROM table_name_27 WHERE wins < 0 | Which Top-5 is the lowest one that has Wins smaller than 0? | CREATE TABLE table_name_27 (top_5 INTEGER, wins INTEGER) |
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND STRFTIME('%y-%m', labevents.charttime) >= '2104-08' ORDER BY labevents.valuenum DESC, labevents.charttime DESC LIMIT 1 | when was the last time when patient 65582 had the maximum value of calculated total co2 since 08/2104? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) |
SELECT original_air_date FROM table_27437601_2 WHERE no_in_season = 12 | List the 1st air date for season 12. | CREATE TABLE table_27437601_2 (original_air_date VARCHAR, no_in_season VARCHAR) |
SELECT MAX(cuts_made) FROM table_name_89 WHERE top_5 = 1 AND top_25 > 16 | Which Cuts made is the highest one that has a Top-5 of 1, and a Top-25 larger than 16? | CREATE TABLE table_name_89 (cuts_made INTEGER, top_5 VARCHAR, top_25 VARCHAR) |
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of headquarter and the average of manufacturer , and group by attribute headquarter, I want to sort by the x-axis in descending. | 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
) |
SELECT COUNT(no_in_series) FROM table_27437601_2 WHERE no_in_season = 12 | List the series number for season 12. | CREATE TABLE table_27437601_2 (no_in_series VARCHAR, no_in_season VARCHAR) |
SELECT MAX(events) FROM table_name_93 WHERE top_5 > 5 AND top_10 > 28 | Which Events is the highest one that has a Top-5 larger than 5, and a Top-10 larger than 28? | CREATE TABLE table_name_93 (events INTEGER, top_5 VARCHAR, top_10 VARCHAR) |
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | For all employees who have the letters D or S in their first name, show me the trend about salary over hire_date with a line chart, I want to show x axis in desc order. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 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(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 (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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)
) |
SELECT COUNT(year) FROM table_27441210_13 WHERE country = "Belgium" | How many years was the country Belgium? | CREATE TABLE table_27441210_13 (year VARCHAR, country VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.