table
stringlengths 33
7.14k
| question
stringlengths 4
1.06k
| output
stringlengths 2
4.44k
⌀ |
|---|---|---|
CREATE TABLE table_name_49 (
away_team VARCHAR,
home_team VARCHAR
)
|
When the Home team of collingwood played, what was the opposing Away team score?
|
SELECT away_team AS score FROM table_name_49 WHERE home_team = "collingwood"
|
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
)
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 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
)
|
how many patients whose insurance is government and lab test name is po2?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "pO2"
|
CREATE TABLE table_name_10 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
)
|
What Player has a To par of +1 and the Score 75-70-71-73=289?
|
SELECT player FROM table_name_10 WHERE to_par = "+1" AND score = 75 - 70 - 71 - 73 = 289
|
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 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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
|
how many treatment of hyperkalemia - insulin / glucose procedures have occurred since 2100?
|
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'treatment of hyperkalemia - insulin / glucose' AND STRFTIME('%y', treatment.treatmenttime) >= '2100'
|
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
|
Show the number of courses each instructor taught in a stacked bar chart The x-axis is the instructor's first name and group by course code, and show by the bars from low to high please.
|
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME ORDER BY EMP_FNAME
|
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 medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate 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 treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
|
had patient 032-4849 when they visited the hospital first time been admitted to an er?
|
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '032-4849' AND patient.hospitaladmitsource = 'emergency department' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
|
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
|
Give me the comparison about All_Games_Percent over the All_Neutral by a bar chart, I want to order by the x axis in desc.
|
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Neutral DESC
|
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
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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_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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
|
when was patient 62977 in 2101 admitted for the first time to the hospital?
|
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 62977 AND STRFTIME('%y', admissions.admittime) = '2101' ORDER BY admissions.admittime LIMIT 1
|
CREATE TABLE table_54660 (
"Name" text,
"Scotland career" text,
"Caps" real,
"Goals" real,
"Average" real
)
|
What is the low goal for kenny miller with an average smaller than 0.261?
|
SELECT MIN("Goals") FROM table_54660 WHERE "Name" = 'kenny miller' AND "Average" < '0.261'
|
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
|
Return a scatter chart about the correlation between People_ID and Height , and group by attribute Sex.
|
SELECT People_ID, Height FROM people GROUP BY Sex
|
CREATE TABLE table_name_19 (
civilian_deaths VARCHAR,
total_deaths__not_including_foreigners_ VARCHAR
)
|
How many civilians died in the conflict that left 178, excluding foreigners, dead?
|
SELECT civilian_deaths FROM table_name_19 WHERE total_deaths__not_including_foreigners_ = "178"
|
CREATE TABLE table_name_76 (
away_team VARCHAR,
tie_no VARCHAR
)
|
In Tie #18, who was the away team?
|
SELECT away_team FROM table_name_76 WHERE tie_no = "18"
|
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
|
Draw a bar chart showing the total number of every ship type by categorizing by nationality, could you sort bars in asc order?
|
SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY Type
|
CREATE TABLE table_204_375 (
id number,
"#" number,
"season" number,
"competition" text,
"date" text,
"round" text,
"opponent" text,
"h / a" text,
"result" text,
"scorer (s)" text
)
|
what was the total number of points scored in the game held on 2013-05-21 ?
|
SELECT "result" + "result" FROM table_204_375 WHERE "date" = '2013-05-21'
|
CREATE TABLE table_name_34 (
season VARCHAR,
score VARCHAR
)
|
Can you tell me the Season that has the Score of 1-0?
|
SELECT season FROM table_name_34 WHERE score = "1-0"
|
CREATE TABLE payment (
payment_id SMALLINT UNSIGNED,
customer_id SMALLINT UNSIGNED,
staff_id TINYINT UNSIGNED,
rental_id INT,
amount DECIMAL(5,2),
payment_date DATETIME,
last_update TIMESTAMP
)
CREATE TABLE film_actor (
actor_id SMALLINT UNSIGNED,
film_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE staff (
staff_id TINYINT UNSIGNED,
first_name VARCHAR(45),
last_name VARCHAR(45),
address_id SMALLINT UNSIGNED,
picture BLOB,
email VARCHAR(50),
store_id TINYINT UNSIGNED,
active BOOLEAN,
username VARCHAR(16),
password VARCHAR(40),
last_update TIMESTAMP
)
CREATE TABLE category (
category_id TINYINT UNSIGNED,
name VARCHAR(25),
last_update TIMESTAMP
)
CREATE TABLE address (
address_id SMALLINT UNSIGNED,
address VARCHAR(50),
address2 VARCHAR(50),
district VARCHAR(20),
city_id SMALLINT UNSIGNED,
postal_code VARCHAR(10),
phone VARCHAR(20),
last_update TIMESTAMP
)
CREATE TABLE language (
language_id TINYINT UNSIGNED,
name CHAR(20),
last_update TIMESTAMP
)
CREATE TABLE film_category (
film_id SMALLINT UNSIGNED,
category_id TINYINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE customer (
customer_id SMALLINT UNSIGNED,
store_id TINYINT UNSIGNED,
first_name VARCHAR(45),
last_name VARCHAR(45),
email VARCHAR(50),
address_id SMALLINT UNSIGNED,
active BOOLEAN,
create_date DATETIME,
last_update TIMESTAMP
)
CREATE TABLE film_text (
film_id SMALLINT,
title VARCHAR(255),
description TEXT
)
CREATE TABLE city (
city_id SMALLINT UNSIGNED,
city VARCHAR(50),
country_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE actor (
actor_id SMALLINT UNSIGNED,
first_name VARCHAR(45),
last_name VARCHAR(45),
last_update TIMESTAMP
)
CREATE TABLE inventory (
inventory_id MEDIUMINT UNSIGNED,
film_id SMALLINT UNSIGNED,
store_id TINYINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE store (
store_id TINYINT UNSIGNED,
manager_staff_id TINYINT UNSIGNED,
address_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE country (
country_id SMALLINT UNSIGNED,
country VARCHAR(50),
last_update TIMESTAMP
)
CREATE TABLE film (
film_id SMALLINT UNSIGNED,
title VARCHAR(255),
description TEXT,
release_year YEAR,
language_id TINYINT UNSIGNED,
original_language_id TINYINT UNSIGNED,
rental_duration TINYINT UNSIGNED,
rental_rate DECIMAL(4,2),
length SMALLINT UNSIGNED,
replacement_cost DECIMAL(5,2),
rating any,
special_features any,
last_update TIMESTAMP
)
CREATE TABLE rental (
rental_id INT,
rental_date DATETIME,
inventory_id MEDIUMINT UNSIGNED,
customer_id SMALLINT UNSIGNED,
return_date DATETIME,
staff_id TINYINT UNSIGNED,
last_update TIMESTAMP
)
|
What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a bar chart, I want to display by the Y in descending.
|
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC
|
CREATE TABLE table_245 (
"Model" text,
"Engine make/Capacity" text,
"Power kW@rpm" text,
"Torque Nm@rpm" text,
"Transmission Make/Type/Speed" text,
"GVM (kg) Technical Capacity" text,
"GCM (kg) Technical Capacity" text
)
|
When the transmission make/type/speed is eaton fs 5306-a manual synchromesh 6 speed, what is the value of the gcm (kg) technical capacity?
|
SELECT "GCM (kg) Technical Capacity" FROM table_245 WHERE "Transmission Make/Type/Speed" = 'Eaton FS 5306-A Manual Synchromesh 6 Speed'
|
CREATE TABLE table_name_62 (
points VARCHAR,
year INTEGER
)
|
with year greater than 1988 what is the total number of points?
|
SELECT COUNT(points) FROM table_name_62 WHERE year > 1988
|
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 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
)
|
What is the number of hispanic or latino-puerto rican patients who had ventriculo puncture through previously implanted catheter?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Ventriculopuncture through previously implanted catheter"
|
CREATE TABLE table_44634 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
|
What was the par for the t5 place player Steve Jones?
|
SELECT "To par" FROM table_44634 WHERE "Place" = 't5' AND "Player" = 'steve jones'
|
CREATE TABLE table_11690135_1 (
interview VARCHAR,
evening_gown VARCHAR
)
|
Who had an evening gown score of 9.78?
|
SELECT interview FROM table_11690135_1 WHERE evening_gown = "9.78"
|
CREATE TABLE table_name_56 (
enrollment VARCHAR,
school VARCHAR
)
|
How much Enrollment has a School of shakamak?
|
SELECT COUNT(enrollment) FROM table_name_56 WHERE school = "shakamak"
|
CREATE TABLE table_2861364_1 (
executed_person VARCHAR,
under_president VARCHAR,
crime VARCHAR
)
|
who was executed during president charles de gaulle's reign for thr crime of child murder after rape?
|
SELECT executed_person FROM table_2861364_1 WHERE under_president = "Charles de Gaulle" AND crime = "Child murder after rape"
|
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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_miles int,
pressurized varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
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 date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
|
what airlines fly into SALT LAKE CITY
|
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SALT LAKE CITY' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
|
CREATE TABLE manufacturer (
name VARCHAR,
open_year VARCHAR,
num_of_shops VARCHAR,
Num_of_Factories VARCHAR
)
|
Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.
|
SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10
|
CREATE TABLE table_64899 (
"Elector" text,
"Place of birth" text,
"Cardinalatial title" text,
"Elevated" text,
"Elevator" text
)
|
What Elector has the Place of Birth listed as Bavaria?
|
SELECT "Elector" FROM table_64899 WHERE "Place of birth" = 'bavaria'
|
CREATE TABLE table_45195 (
"Rank" real,
"Title" text,
"Studio" text,
"Director(s)" text,
"Worldwide Gross" text
)
|
Sum of m. night shyamalan ranks?
|
SELECT SUM("Rank") FROM table_45195 WHERE "Director(s)" = 'm. night shyamalan'
|
CREATE TABLE table_train_179 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_plasma_glucose_fpg" float,
"diastolic_blood_pressure_dbp" int,
"diabetes" bool,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"hypertension" bool,
"age" float,
"NOUSE" float
)
|
uncontrolled diabetes defined as a fpg level of > 240 mg / dl at screening
|
SELECT * FROM table_train_179 WHERE diabetes = 1 OR fasting_plasma_glucose_fpg > 240
|
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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 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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age 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 procedures_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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
|
what does patient 13686 age be in their first hospital visit?
|
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 13686 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
|
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
|
return me the authors who have papers in VLDB conference before 2002 after 1995 .
|
SELECT author.name FROM author, conference, publication, writes WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year < 2002 AND publication.year > 1995 AND writes.aid = author.aid AND writes.pid = publication.pid
|
CREATE TABLE table_38657 (
"Discipline" text,
"Peter" real,
"Adam" real,
"Jade" real,
"Plat'num" real
)
|
What's Adam's score when Jade's score is greater than 5 and Peter's score is less than 0?
|
SELECT AVG("Adam") FROM table_38657 WHERE "Jade" > '5' AND "Peter" < '0'
|
CREATE TABLE table_54517 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
)
|
What was the venue where the result was 12th?
|
SELECT "Venue" FROM table_54517 WHERE "Result" = '12th'
|
CREATE TABLE table_name_85 (
turbine_vendor VARCHAR,
wind_farm VARCHAR,
size__mw_ VARCHAR,
turbines VARCHAR,
county VARCHAR
)
|
Who is the turbine vendor for Meenadreen in Donegal county with less than 6 turbines with a size of 0.85 MW?
|
SELECT turbine_vendor FROM table_name_85 WHERE turbines < 6 AND county = "donegal" AND size__mw_ = "0.85" AND wind_farm = "meenadreen"
|
CREATE TABLE table_46409 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real
)
|
What's the total diameter when longitude is 357.8e later than 1985?
|
SELECT COUNT("Diameter (km)") FROM table_46409 WHERE "Longitude" = '357.8e' AND "Year named" > '1985'
|
CREATE TABLE table_name_4 (
result VARCHAR,
date VARCHAR
)
|
What is the Result with a Date with 4 september 2013?
|
SELECT result FROM table_name_4 WHERE date = "4 september 2013"
|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime 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 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
|
tell me the change in bedside glucose levels of patient 027-178495 measured at 2102-06-02 12:25:17 compared to the value measured at 2102-06-02 00:23:17?
|
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '2102-06-02 12:25:17') - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '2102-06-02 00:23:17')
|
CREATE TABLE table_25421463_1 (
season VARCHAR,
final_placing VARCHAR,
team_name VARCHAR
)
|
In what season was the final placing NC and the team SL Formula Racing?
|
SELECT season FROM table_25421463_1 WHERE final_placing = "NC†" AND team_name = "SL Formula Racing"
|
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
|
Show me about the distribution of Team_Name and Team_ID in a bar chart, and order Y-axis in asc order.
|
SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID
|
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 PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
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 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description 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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
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 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
|
Posts which had given tag in the past.
|
SELECT DISTINCT PostHistory.PostId AS "post_link", url = 'site://posts/' + CAST(PostHistory.PostId AS TEXT) + '/revisions', Posts.OwnerUserId AS "user_link", Posts.Score, Posts.Tags, Posts.CreationDate, Posts.LastActivityDate FROM PostHistory INNER JOIN Posts ON PostHistory.PostId = Posts.Id WHERE PostHistoryTypeId IN (3, 6, 9) AND Text LIKE '%<##tagName##>%' ORDER BY CreationDate
|
CREATE TABLE company (
headquarters VARCHAR,
main_industry VARCHAR
)
|
Show headquarters with at least two companies in the banking industry.
|
SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2
|
CREATE TABLE table_25162 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
)
|
What was the date if the driver was Robert Pressley?
|
SELECT "Date" FROM table_25162 WHERE "Driver" = 'Robert Pressley'
|
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
|
Which upper level classes do not require 496 ?
|
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.course_id) AND COURSE_1.department = 'department0' AND COURSE_1.number = 496 AND PROGRAM_COURSE_0.category LIKE '%ULCS%' AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id
|
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,
booking_start_date time,
booking_end_date time
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE guests (
guest_id number,
gender_code text,
guest_first_name text,
guest_last_name text,
date_of_birth time
)
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
building_full_name text,
building_description text,
building_address text,
building_manager text,
building_phone text
)
CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_date time,
available_yn others
)
|
Give me the minimum and maximum bathroom count among all the apartments.
|
SELECT MIN(bathroom_count), MAX(bathroom_count) FROM apartments
|
CREATE TABLE table_204_833 (
id number,
"game" number,
"date" text,
"team" text,
"score" text,
"high points" text,
"high rebounds" text,
"high assists" text,
"location\nattendance" text,
"record" text
)
|
what is the next date after april 8 ?
|
SELECT "date" FROM table_204_833 WHERE "game" = (SELECT "game" FROM table_204_833 WHERE "date" = 'april 8') + 1
|
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
|
For CEE 650 next semester , are there any sections not on Monday ?
|
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'CEE' AND course.number = 650 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
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 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
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
count the number of patients whose marital status is single and lab test category is blood gas?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab."CATEGORY" = "Blood Gas"
|
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
|
For those records from the products and each product's manufacturer, find founder and the average of revenue , and group by attribute founder, and visualize them by a bar chart, I want to list X in descending order please.
|
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
|
CREATE TABLE table_name_29 (
rank INTEGER,
source VARCHAR,
year VARCHAR
)
|
What is the average rank that has cia world factbook as the source and a year prior to 2005?
|
SELECT AVG(rank) FROM table_name_29 WHERE source = "cia world factbook" AND year < 2005
|
CREATE TABLE table_name_76 (
player VARCHAR,
place VARCHAR,
score VARCHAR
)
|
Who placed in t5 and scored 73-69-68=210?
|
SELECT player FROM table_name_76 WHERE place = "t5" AND score = 73 - 69 - 68 = 210
|
CREATE TABLE table_203_594 (
id number,
"canal" text,
"length (miles)" number,
"locks" number,
"max length (ft)" number,
"width (ft)" number,
"year opened" number,
"year abandoned" number,
"year restored" number
)
|
which was the last canal opened in scotland ?
|
SELECT "canal" FROM table_203_594 WHERE "year opened" = (SELECT MAX("year opened") FROM table_203_594)
|
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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_miles int,
pressurized varchar
)
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
)
|
show me all flights from SAN FRANCISCO to DENVER
|
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
CREATE TABLE table_203_349 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text,
"production\ncode" text,
"u.s. viewers\n(millions)" number
)
|
how many episodes were shown in season 1 ?
|
SELECT COUNT("title") FROM table_203_349
|
CREATE TABLE table_200_35 (
id number,
"party" text,
"active voters" number,
"inactive voters" number,
"total voters" number,
"percentage" text
)
|
as of october 25 , 2005 , how many voters are either democratic or republican ?
|
SELECT SUM("total voters") FROM table_200_35 WHERE "party" IN ('democratic', 'republican')
|
CREATE TABLE table_name_33 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
)
|
What is the lowest silver that has 2 as the bronze, with a total greater than 4?
|
SELECT MIN(silver) FROM table_name_33 WHERE bronze = 2 AND total > 4
|
CREATE TABLE table_name_75 (
bronze INTEGER,
nation VARCHAR
)
|
How many Bronzes that has a Nation of italy?
|
SELECT MAX(bronze) FROM table_name_75 WHERE nation = "italy"
|
CREATE TABLE table_16941304_4 (
driver___passenger VARCHAR,
points VARCHAR
)
|
Name the driver passenger for 394 points
|
SELECT driver___passenger FROM table_16941304_4 WHERE points = 394
|
CREATE TABLE table_31326 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
|
Who is the director when the title is 'believers'?
|
SELECT "Directed by" FROM table_31326 WHERE "Title" = 'Believers'
|
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 Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
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 TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
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 PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
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 PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
|
My answers on Stack Exchange.
|
SELECT * FROM Posts WHERE OwnerUserId = 3422261
|
CREATE TABLE table_name_46 (
lost INTEGER,
games INTEGER
)
|
How many games lost for teams with over 6 games?
|
SELECT MIN(lost) FROM table_name_46 WHERE games > 6
|
CREATE TABLE table_23098 (
"Year" text,
"Marriages between men" real,
"Marriages between women" real,
"Same-sex marriages" real,
"Total marriages" real,
"% same-sex marriages" text
)
|
How many marriages between women have % same-sex marriages of 1.06?
|
SELECT "Marriages between women" FROM table_23098 WHERE "% same-sex marriages" = '1.06'
|
CREATE TABLE club (
Club_ID int,
Club_name text,
Region text,
Start_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
Bronze int,
Points int
)
CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
|
Show different occupations along with the number of players in each occupation with a bar chart.
|
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation
|
CREATE TABLE table_203_300 (
id number,
"year" number,
"tournament" text,
"venue" text,
"result" text,
"extra" text
)
|
was there a result of 1st place after the year 2006 ?
|
SELECT (SELECT COUNT(*) FROM table_203_300 WHERE "result" = 1 AND "year" > 2006) > 0
|
CREATE TABLE table_name_4 (
date VARCHAR,
record VARCHAR
)
|
Which Date has a Record of 29 47?
|
SELECT date FROM table_name_4 WHERE record = "29–47"
|
CREATE TABLE table_9712 (
"Province" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
)
|
How many ends lost for Alberta when stolen ends are greater than 7?
|
SELECT SUM("Ends Lost") FROM table_9712 WHERE "Province" = 'alberta' AND "Stolen Ends" > '7'
|
CREATE TABLE table_53769 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
|
what is the result when the competition is friendly on 8 october 2009?
|
SELECT "Result" FROM table_53769 WHERE "Competition" = 'friendly' AND "Date" = '8 october 2009'
|
CREATE TABLE table_12002388_1 (
year INTEGER,
reg_season VARCHAR
)
|
What year did they finish 1st, southern?
|
SELECT MAX(year) FROM table_12002388_1 WHERE reg_season = "1st, Southern"
|
CREATE TABLE table_30594 (
"Version" text,
"Release" text,
"Release date" text,
"End of maintenance" text,
"Requirement" text
)
|
What's the number of the 1.0.12 release version?
|
SELECT COUNT("Version") FROM table_30594 WHERE "Release" = '1.0.12'
|
CREATE TABLE table_21058823_1 (
result VARCHAR,
opponent VARCHAR
)
|
What did they do against Memphis?
|
SELECT result FROM table_21058823_1 WHERE opponent = "Memphis"
|
CREATE TABLE table_31153 (
"Name/ designation" text,
"Year of intro" real,
"Country of origin" text,
"Primary cartridge" text,
"Major users" text
)
|
Who are all the major users of the Saturn Machine Pistol?
|
SELECT "Major users" FROM table_31153 WHERE "Name/ designation" = 'Saturn machine pistol'
|
CREATE TABLE table_203_535 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
|
what is the total amount of medals spain has won ?
|
SELECT "total" FROM table_203_535 WHERE "nation" = 'spain'
|
CREATE TABLE table_name_3 (
surface VARCHAR,
date VARCHAR
)
|
Name the surface for 12 september 2006
|
SELECT surface FROM table_name_3 WHERE date = "12 september 2006"
|
CREATE TABLE table_16402 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
|
How many players played for adams state school?
|
SELECT COUNT("Player") FROM table_16402 WHERE "College" = 'Adams State'
|
CREATE TABLE table_74055 (
"English" text,
"Proto-Semitic" text,
"Akkadian" text,
"Arabic" text,
"Aramaic" text,
"Hebrew" text,
"Geez" text,
"Mehri" text
)
|
If in arabic it is sal m-, what is it in proto-semitic?
|
SELECT "Proto-Semitic" FROM table_74055 WHERE "Arabic" = 'salām-'
|
CREATE TABLE table_6945 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
)
|
What away team has tottenham hotspur as the home team?
|
SELECT "Away team" FROM table_6945 WHERE "Home team" = 'tottenham hotspur'
|
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 vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
|
what is the minimum total cost of a hospital involving a laboratory test for peak airway/pressure last year?
|
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'peak airway/pressure')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY cost.patienthealthsystemstayid) AS t1
|
CREATE TABLE table_203_239 (
id number,
"year" number,
"title" text,
"chinese title" text,
"role" text,
"notes" text
)
|
which year did she work on the most films ?
|
SELECT "year" FROM table_203_239 GROUP BY "year" ORDER BY COUNT("title") DESC LIMIT 1
|
CREATE TABLE table_56135 (
"Nation" text,
"Gold" text,
"Silver" text,
"Bronze" text,
"Total" real
)
|
Tell me the gold for netherlands
|
SELECT "Gold" FROM table_56135 WHERE "Nation" = 'netherlands'
|
CREATE TABLE table_14309 (
"Date" text,
"Opponent" text,
"City" text,
"Result" text,
"Score" text
)
|
Who was Milwaukee's opponent?
|
SELECT "Opponent" FROM table_14309 WHERE "City" = 'milwaukee'
|
CREATE TABLE table_53507 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
|
What is the total number on roll for Shelly Park school?
|
SELECT COUNT("Roll") FROM table_53507 WHERE "Name" = 'shelly park school'
|
CREATE TABLE table_name_56 (
publisher VARCHAR,
release_title VARCHAR
)
|
Who was the publisher of Martial Law: Dead Ringers?
|
SELECT publisher FROM table_name_56 WHERE release_title = "martial law: dead ringers"
|
CREATE TABLE table_28885977_1 (
location VARCHAR,
stadium VARCHAR
)
|
What is the location of the Moorabbin Oval stadium?
|
SELECT location FROM table_28885977_1 WHERE stadium = "Moorabbin Oval"
|
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 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 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 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
)
|
what was the name of the drug prescription that patient 030-53717 was last prescribed in their first hospital encounter?
|
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53717' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) ORDER BY medication.drugstarttime DESC LIMIT 1
|
CREATE TABLE table_203_726 (
id number,
"year" number,
"national champion" text,
"score" text,
"runner-up" text,
"host or site" text
)
|
how many times was ucla national champion ?
|
SELECT COUNT(*) FROM table_203_726 WHERE "national champion" = 'ucla'
|
CREATE TABLE table_42816 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
|
Who was the Home captain that played at the venue Oval?
|
SELECT "Home captain" FROM table_42816 WHERE "Venue" = 'oval'
|
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
)
|
how many teams finished better than spain in cycling at the 1996 summer olympics men 's team pursuit ?
|
SELECT COUNT("team") FROM table_204_735 WHERE "rank" < (SELECT "rank" FROM table_204_735 WHERE "team" = 'spain')
|
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
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_miles int,
pressurized varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
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 days (
days_code varchar,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
|
i would like a flight from SAN FRANCISCO to PITTSBURGH on friday morning after 1000 o'clock
|
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 (((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 1000 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200
|
CREATE TABLE table_26454128_4 (
athlete VARCHAR,
height VARCHAR,
country VARCHAR
)
|
Which athlete has a height of 1.87 and is from Sweden?
|
SELECT athlete FROM table_26454128_4 WHERE height = "1.87" AND country = "Sweden"
|
CREATE TABLE instructor (
dept_name VARCHAR,
salary INTEGER
)
|
Find the name of the department which has the highest average salary of professors.
|
SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1
|
CREATE TABLE table_17798093_20 (
ending VARCHAR,
examples VARCHAR
)
|
what are the endings of examples achilles, appendices, f ces
|
SELECT ending FROM table_17798093_20 WHERE examples = "Achilles, appendices, fæces"
|
CREATE TABLE table_1480455_1 (
area__km_2__ VARCHAR,
population_density___km_2__ VARCHAR
)
|
What is the area (km 2) where the population density (/mk2) is 84.3?
|
SELECT area__km_2__ FROM table_1480455_1 WHERE population_density___km_2__ = "84.3"
|
CREATE TABLE table_38154 (
"Date" text,
"Venue" text,
"Result" text,
"Goals" real,
"Competition" text
)
|
On what date was a friendly match held at Auckland?
|
SELECT "Date" FROM table_38154 WHERE "Competition" = 'friendly match' AND "Venue" = 'auckland'
|
CREATE TABLE table_74568 (
"Area" text,
"Advertisement date" text,
"Block" text,
"Winning applicant" text,
"Ensemble name" text
)
|
What is Oxfordshire Area's Ensemble Name?
|
SELECT "Ensemble name" FROM table_74568 WHERE "Area" = 'oxfordshire'
|
CREATE TABLE table_20477 (
"Headphone Model" text,
"Headphone Class" text,
"Driver-matched dB" text,
"Construction" text,
"Earpads" text,
"Termination" text,
"US MSRP" text
)
|
Which terminations correspond with headphone model SR80I?
|
SELECT "Termination" FROM table_20477 WHERE "Headphone Model" = 'SR80i'
|
CREATE TABLE table_3764 (
"Artist" text,
"Country" text,
"Number-one single(s)" text,
"Year" real,
"Weeks at #1" real,
"Straight to #1 ?" text
)
|
Name the number one singles for desvarieux, jacob
|
SELECT "Number-one single(s)" FROM table_3764 WHERE "Artist" = 'Desvarieux, Jacob'
|
CREATE TABLE table_name_80 (
original_us_air_date VARCHAR,
original_canadian_air_date VARCHAR
)
|
What is the Original U.S. air-date for the Original Canadian air-date of december 9, 2007?
|
SELECT original_us_air_date FROM table_name_80 WHERE original_canadian_air_date = "december 9, 2007"
|
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
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_miles int,
pressurized varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
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_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
|
i need to make reservations from DENVER to BOSTON
|
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
CREATE TABLE table_name_28 (
points INTEGER,
winnings VARCHAR
)
|
Which driver has the highest point total after winning $133,386?
|
SELECT MAX(points) FROM table_name_28 WHERE winnings = "$133,386"
|
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 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 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 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 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
|
what was the name of the output which patient 10855 had for the first time on this month/25?
|
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND DATETIME(outputevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', outputevents.charttime) = '25' ORDER BY outputevents.charttime LIMIT 1)
|
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 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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
|
when was the last time until 38 months ago that patient 88558 had the minimum red blood cells value?
|
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88558) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-38 month') ORDER BY labevents.valuenum, labevents.charttime DESC LIMIT 1
|
CREATE TABLE table_14850099_18 (
planet VARCHAR,
cardinal_direction VARCHAR
)
|
What is the planet associated with the direction of south?
|
SELECT planet FROM table_14850099_18 WHERE cardinal_direction = "South"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.