answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT moving_from FROM table_22810095_8 WHERE name = "Kisnorbo" | Where did Kisnorbo move from? | CREATE TABLE table_22810095_8 (moving_from VARCHAR, name VARCHAR) |
SELECT COUNT("Losses") FROM table_58695 WHERE "Goals for" = '30' AND "Points" > '24' | Hiw many losses have 30 for the goals with points greater than 24? | CREATE TABLE table_58695 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) |
SELECT driver FROM table_name_80 WHERE entrant = "enrico platé" | Who is the driver for the Entract of Enrico Platé? | CREATE TABLE table_name_80 (driver VARCHAR, entrant VARCHAR) |
SELECT name FROM table_22810095_8 WHERE n = 28 | What is the name of the player when n is 28? | CREATE TABLE table_22810095_8 (name VARCHAR, n VARCHAR) |
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 = 24 AND date_day.month_number = 5 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 = 'ST. PAUL' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. LOUIS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | what flights from ST. LOUIS to ST. PAUL on thursday leaving after 1000 | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name 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 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 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 code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 (
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 month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
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 city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
) |
SELECT entrant FROM table_name_79 WHERE driver = "luigi fagioli" | Which of the entrants had Luigi Fagioli as a driver? | CREATE TABLE table_name_79 (entrant VARCHAR, driver VARCHAR) |
SELECT transfer_fee FROM table_22810095_8 WHERE n = 2 | How much was the transfer fee when n is 2? | CREATE TABLE table_22810095_8 (transfer_fee VARCHAR, n VARCHAR) |
SELECT "2013" FROM table_33199 WHERE "2012" = 'grand slam tournaments' | What value in 2013 corresponds to Grand Slam Tournaments in 2012? | CREATE TABLE table_33199 (
"Tournament" text,
"2007" text,
"2011" text,
"2012" text,
"2013" text
) |
SELECT driver FROM table_name_94 WHERE constructor = "era" AND entrant = "t.a.s.o. mathieson" | Who is the driver whose Constructor was Era, and whose entrant was T.A.S.O. Mathieson? | CREATE TABLE table_name_94 (driver VARCHAR, constructor VARCHAR, entrant VARCHAR) |
SELECT name FROM table_22810095_9 WHERE age = 24 | What player is 24 years old? | CREATE TABLE table_22810095_9 (name VARCHAR, age VARCHAR) |
SELECT COUNT(*), constructorid FROM constructorstandings GROUP BY constructorid | What are the numbers of races for each constructor id? | CREATE TABLE qualifying (
qualifyid number,
raceid number,
driverid number,
constructorid number,
number number,
position number,
q1 text,
q2 text,
q3 text
)
CREATE TABLE races (
raceid number,
year number,
round number,
circuitid number,
name text,
date text,
time text,
url text
)
CREATE TABLE laptimes (
raceid number,
driverid number,
lap number,
position number,
time text,
milliseconds number
)
CREATE TABLE constructorstandings (
constructorstandingsid number,
raceid number,
constructorid number,
points number,
position number,
positiontext text,
wins number
)
CREATE TABLE constructors (
constructorid number,
constructorref text,
name text,
nationality text,
url text
)
CREATE TABLE circuits (
circuitid number,
circuitref text,
name text,
location text,
country text,
lat number,
lng number,
alt number,
url text
)
CREATE TABLE results (
resultid number,
raceid number,
driverid number,
constructorid number,
number number,
grid number,
position number,
positiontext text,
positionorder number,
points number,
laps number,
time text,
milliseconds number,
fastestlap number,
rank number,
fastestlaptime text,
fastestlapspeed text,
statusid number
)
CREATE TABLE status (
statusid number,
status text
)
CREATE TABLE constructorresults (
constructorresultsid number,
raceid number,
constructorid number,
points number,
status number
)
CREATE TABLE driverstandings (
driverstandingsid number,
raceid number,
driverid number,
points number,
position number,
positiontext text,
wins number
)
CREATE TABLE pitstops (
raceid number,
driverid number,
stop number,
lap number,
time text,
duration text,
milliseconds number
)
CREATE TABLE seasons (
year number,
url text
)
CREATE TABLE drivers (
driverid number,
driverref text,
number number,
code text,
forename text,
surname text,
dob text,
nationality text,
url text
) |
SELECT chassis FROM table_name_15 WHERE rounds = "7" AND entrant = "ecurie rosier" | Which chassis had Rounds of 7, and an Entrant of Ecurie Rosier? | CREATE TABLE table_name_15 (chassis VARCHAR, rounds VARCHAR, entrant VARCHAR) |
SELECT COUNT(bruce_coulter_award) FROM table_228149_1 WHERE game = "9th" | Nam the total number for bruce coulter award for 9th game | CREATE TABLE table_228149_1 (bruce_coulter_award VARCHAR, game VARCHAR) |
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165) AND STRFTIME('%y', procedures_icd.charttime) <= '2100' ORDER BY procedures_icd.charttime LIMIT 1 | when did patient 20165 first undergo the procedure until 2100? | 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE 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 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_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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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 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 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
) |
SELECT winning_constructor FROM table_name_79 WHERE winning_driver = "riccardo patrese" | Who is the winner constructor with driver riccardo patrese? | CREATE TABLE table_name_79 (winning_constructor VARCHAR, winning_driver VARCHAR) |
SELECT MIN(opponents) FROM table_22815265_1 WHERE opponent = "Arizona State" | How many opponents were there when the opponent was Arizona State? | CREATE TABLE table_22815265_1 (opponents INTEGER, opponent VARCHAR) |
SELECT AVG(heat) FROM table_name_43 WHERE time = "59.11" AND lane > 3 | What is the average of all Heats of competitors with a Time of 59.11 and a lane higher than 3? | CREATE TABLE table_name_43 (
heat INTEGER,
time VARCHAR,
lane VARCHAR
) |
SELECT MAX(round) FROM table_name_42 WHERE date = "5 april" | What is the highest round on 5 april? | CREATE TABLE table_name_42 (round INTEGER, date VARCHAR) |
SELECT COUNT(record) FROM table_22815265_1 WHERE opponent = "Utah" | How many records show Utah as the opponent? | CREATE TABLE table_22815265_1 (record VARCHAR, opponent VARCHAR) |
SELECT country FROM table_name_21 WHERE player = "charles coody" | What country does charles coody play for? | CREATE TABLE table_name_21 (
country VARCHAR,
player VARCHAR
) |
SELECT date FROM table_name_37 WHERE location = "hermanos rodríguez" | Which date was hermanos rodríguez the location? | CREATE TABLE table_name_37 (date VARCHAR, location VARCHAR) |
SELECT opponents FROM table_22815265_1 WHERE cowboys_points = 10 | How many opponents are there when cowboy points were 10? | CREATE TABLE table_22815265_1 (opponents VARCHAR, cowboys_points VARCHAR) |
SELECT state__class_ FROM table_225205_3 WHERE reason_for_change = "Iowa admitted to the Union December 28, 1846" | Name the state class for iowa admitted to the union december 28, 1846 | CREATE TABLE table_225205_3 (
state__class_ VARCHAR,
reason_for_change VARCHAR
) |
SELECT record FROM table_name_92 WHERE date = "may 3" | Name the record for may 3 | CREATE TABLE table_name_92 (record VARCHAR, date VARCHAR) |
SELECT COUNT(record) FROM table_22815265_1 WHERE opponents = 9 | How many records were there when opponents were 9? | CREATE TABLE table_22815265_1 (record VARCHAR, opponents VARCHAR) |
SELECT opponent FROM table_name_45 WHERE round = "sf" | Which opponent had a round of SF? | CREATE TABLE table_name_45 (
opponent VARCHAR,
round VARCHAR
) |
SELECT COUNT(attendance) FROM table_name_68 WHERE date = "may 1" | Name the total number in attendance for may 1 | CREATE TABLE table_name_68 (attendance VARCHAR, date VARCHAR) |
SELECT COUNT(record) FROM table_22815259_1 WHERE cowboys_points = 12 | Name the number of record for 12 cowboys points | CREATE TABLE table_22815259_1 (record VARCHAR, cowboys_points VARCHAR) |
SELECT MAX("No.") FROM table_72685 WHERE "Player" = 'Chris Gatling' | What number identifies Chris Gatling? | CREATE TABLE table_72685 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) |
SELECT loss FROM table_name_20 WHERE date = "may 29" | Name the loss on may 29 | CREATE TABLE table_name_20 (loss VARCHAR, date VARCHAR) |
SELECT MAX(game) FROM table_22815259_1 WHERE record = "4-0" | Name the most game for record 4-0 | CREATE TABLE table_22815259_1 (game INTEGER, record VARCHAR) |
SELECT SUM(gold) FROM table_name_79 WHERE total < 1 | How many total golds do teams have when the total medals is less than 1? | CREATE TABLE table_name_79 (
gold INTEGER,
total INTEGER
) |
SELECT SUM(cuts_made) FROM table_name_62 WHERE wins < 1 AND top_5 = 1 AND top_10 > 4 | How many cuts were made when there weren't any wins but had a top-5 of 1 and a top 10 larger than 4? | CREATE TABLE table_name_62 (cuts_made INTEGER, top_10 VARCHAR, wins VARCHAR, top_5 VARCHAR) |
SELECT COUNT(result) FROM table_22815259_1 WHERE cowboys_points = 23 | Name the result for cowboys points being 23 | CREATE TABLE table_22815259_1 (result VARCHAR, cowboys_points VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.age < "70" | how many patients whose language is span and age is less than 70? | 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 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
) |
SELECT college FROM table_name_36 WHERE player = "shabazz muhammad" | Which college has a Player of shabazz muhammad? | CREATE TABLE table_name_36 (college VARCHAR, player VARCHAR) |
SELECT record FROM table_22815259_1 WHERE opponent = "Arizona" | Name the record for arizona | CREATE TABLE table_22815259_1 (record VARCHAR, opponent VARCHAR) |
SELECT "Competition" FROM table_54604 WHERE "Goal" = '13' | What competition has a goal number of 13? | CREATE TABLE table_54604 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
) |
SELECT height FROM table_name_11 WHERE player = "nerlens noel" | How tall is nerlens noel? | CREATE TABLE table_name_11 (height VARCHAR, player VARCHAR) |
SELECT COUNT(unemployment_rate) FROM table_22815568_12 WHERE population = 34024 | Name the unemployment rate for 34024 | CREATE TABLE table_22815568_12 (unemployment_rate VARCHAR, population VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "MORBID OBESITY/SDA" | provide the number of patients whose gender is f and primary disease is morbid obesity/sda? | 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
)
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) |
SELECT player FROM table_name_47 WHERE hometown = "flower mound, tx" | Who is from flower mound, tx? | CREATE TABLE table_name_47 (player VARCHAR, hometown VARCHAR) |
SELECT COUNT(population) FROM table_22815568_12 WHERE county = "Craig" | Name the total number of population for craig | CREATE TABLE table_22815568_12 (population VARCHAR, county VARCHAR) |
SELECT * FROM table_train_195 WHERE heart_disease = 1 | history of congestive heart failure | CREATE TABLE table_train_195 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"allergy_to_perflutren" bool,
"heart_disease" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) |
SELECT hometown FROM table_name_58 WHERE player = "shabazz muhammad" | Where is shabazz muhammad from? | CREATE TABLE table_name_58 (hometown VARCHAR, player VARCHAR) |
SELECT unemployment_rate FROM table_22815568_12 WHERE county = "Botetourt" | Name the unemployment rate for botetourt | CREATE TABLE table_22815568_12 (unemployment_rate VARCHAR, county VARCHAR) |
SELECT title FROM table_name_99 WHERE pages = 96 | Tell me the title for pages of 96 | CREATE TABLE table_name_99 (
title VARCHAR,
pages VARCHAR
) |
SELECT opponent FROM table_name_35 WHERE date = "july 21" | What was the opponent for july 21? | CREATE TABLE table_name_35 (opponent VARCHAR, date VARCHAR) |
SELECT status FROM table_22815568_12 WHERE unemployment_rate = "6.7%" | Name the status for unemployment rate being 6.7% | CREATE TABLE table_22815568_12 (status VARCHAR, unemployment_rate VARCHAR) |
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.valuenum, labevents.charttime LIMIT 1 | when did patient 85700 have a minimum potassium for the first time this month? | 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE 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 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 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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
) |
SELECT record FROM table_name_95 WHERE date = "july 24" | What was the record on july 24? | CREATE TABLE table_name_95 (record VARCHAR, date VARCHAR) |
SELECT status FROM table_22815568_1 WHERE poverty_rate = "14.7%" | What is the status of the county that has a 14.7% poverty rate? | CREATE TABLE table_22815568_1 (status VARCHAR, poverty_rate VARCHAR) |
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6580) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-04' ORDER BY prescriptions.startdate DESC LIMIT 1 | tell me the drug that was prescribed to patient 6580 for the last time through the po route since 04/2105? | 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value 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 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 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 procedures_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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
) |
SELECT constructor FROM table_name_77 WHERE grid < 15 AND laps = 77 AND time_retired = "+ 0.771" | Who constructed the car with a grid under 15, 77 laps, and a Time/Retired of + 0.771? | CREATE TABLE table_name_77 (constructor VARCHAR, time_retired VARCHAR, grid VARCHAR, laps VARCHAR) |
SELECT poverty_rate FROM table_22815568_1 WHERE market_income_per_capita = "$16,420" | What is the poverty rate in the county that has a market income per capita of $16,420? | CREATE TABLE table_22815568_1 (poverty_rate VARCHAR, market_income_per_capita 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 = "Paraplegia NOS" AND lab.flag = "abnormal" | count the number of patients with unspecified paraplegia diagnoses who had abnormal lab test status. | 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
)
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 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 AVG(grid) FROM table_name_29 WHERE laps > 74 AND driver = "damon hill" | What is the average grid for damon hill with over 74 laps? | CREATE TABLE table_name_29 (grid INTEGER, laps VARCHAR, driver VARCHAR) |
SELECT MIN(population) FROM table_22815568_1 WHERE market_income_per_capita = "$24,383" | What is the lowest population in a county with market income per capita of $24,383? | CREATE TABLE table_22815568_1 (population INTEGER, market_income_per_capita VARCHAR) |
SELECT "player" FROM table_203_305 WHERE id = 1 | which player was the first player to be drafted ? | CREATE TABLE table_203_305 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) |
SELECT pos FROM table_name_81 WHERE school_club_team = "jacksonville" | Which position has a School/club team of jacksonville? | CREATE TABLE table_name_81 (pos VARCHAR, school_club_team VARCHAR) |
SELECT poverty_rate FROM table_22815568_1 WHERE market_income_per_capita = "$20,518" | What is the povery rate of the county with market income per capita of $20,518? | CREATE TABLE table_22815568_1 (poverty_rate VARCHAR, market_income_per_capita VARCHAR) |
SELECT current_marital_status FROM table_24143253_2 WHERE name = "Stella Farentino" | What is Stella Farentino's current relationship status? | CREATE TABLE table_24143253_2 (
current_marital_status VARCHAR,
name VARCHAR
) |
SELECT SUM(round) FROM table_name_21 WHERE pick = 13 | How many rounds have a Pick of 13? | CREATE TABLE table_name_21 (round INTEGER, pick VARCHAR) |
SELECT market_income_per_capita FROM table_22815568_13 WHERE county = "Hancock" | what is the market income per capita where the county is hancock? | CREATE TABLE table_22815568_13 (market_income_per_capita VARCHAR, county VARCHAR) |
SELECT MIN(game) FROM table_27713030_7 | What game in the season does this list start? | CREATE TABLE table_27713030_7 (
game INTEGER
) |
SELECT SUM(round) FROM table_name_91 WHERE school_club_team = "pan american" | How many rounds have School/club team of pan american? | CREATE TABLE table_name_91 (round INTEGER, school_club_team VARCHAR) |
SELECT county FROM table_22815568_13 WHERE market_income_per_capita = "$25,006" | what is the county where the market income per capita is $25,006? | CREATE TABLE table_22815568_13 (county VARCHAR, market_income_per_capita VARCHAR) |
SELECT MIN(season) FROM table_name_38 WHERE profile = "advertising account manager" | What is the earliest season with an advertising account manager profile? | CREATE TABLE table_name_38 (
season INTEGER,
profile VARCHAR
) |
SELECT chassis FROM table_name_41 WHERE points = "25" | What is the chassis when there is 25 points? | CREATE TABLE table_name_41 (chassis VARCHAR, points VARCHAR) |
SELECT unemployment_rate FROM table_22815568_13 WHERE market_income_per_capita = "$16,406" | what is the unemployment rate where the market income per capita is $16,406? | CREATE TABLE table_22815568_13 (unemployment_rate VARCHAR, market_income_per_capita VARCHAR) |
SELECT COUNT("Grid") FROM table_54320 WHERE "Laps" > '60' AND "Driver" = 'heinz-harald frentzen' | When driver heinz-harald frentzen has a number of laps greater than 60, what is the sum of grid? | CREATE TABLE table_54320 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) |
SELECT points FROM table_name_3 WHERE year < 1979 AND chassis = "ferrari 312b2" | How many points were there before 1979 with a ferrari 312b2 chassis? | CREATE TABLE table_name_3 (points VARCHAR, year VARCHAR, chassis VARCHAR) |
SELECT unemployment_rate FROM table_22815568_13 WHERE county = "Wayne" | what is the unemployment rate for wayne county? | CREATE TABLE table_22815568_13 (unemployment_rate VARCHAR, county VARCHAR) |
SELECT player_name FROM table_10361230_1 WHERE college = "Emporia State" | Which player went to Emporia State? | CREATE TABLE table_10361230_1 (
player_name VARCHAR,
college VARCHAR
) |
SELECT year FROM table_name_3 WHERE points = "29 (32)" | What year were there 29 (32) points? | CREATE TABLE table_name_3 (year VARCHAR, points VARCHAR) |
SELECT original_air_date FROM table_22815870_1 WHERE prod_code = 105 | What is the original air date of the episode with a production code of 105? | CREATE TABLE table_22815870_1 (original_air_date VARCHAR, prod_code VARCHAR) |
SELECT "Nationality" FROM table_4121 WHERE "Player" = 'Peter Slamiar' | What nationality was peter slamiar? | CREATE TABLE table_4121 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) |
SELECT result FROM table_name_87 WHERE round = "4 leg 2" | What result occurs when the round is 4 leg 2? | CREATE TABLE table_name_87 (result VARCHAR, round VARCHAR) |
SELECT COUNT(county) FROM table_22815568_3 WHERE population = 2266 | How many counties have a population of 2266? | CREATE TABLE table_22815568_3 (county VARCHAR, population VARCHAR) |
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vte prophylaxis - compression boots' AND STRFTIME('%y', treatment.treatmenttime) <= '2102') AS t1 JOIN (SELECT patient.uniquepid, lab.labname, lab.labresulttime FROM lab JOIN patient ON lab.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', lab.labresulttime) <= '2102') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.labresulttime AND DATETIME(t2.labresulttime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.labname) AS t3 WHERE t3.c1 <= 3 | what are the three most common laboratory tests patients had within 2 months after receiving a vte prophylaxis - compression boots treatment procedure until 2102? | 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 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 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 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
) |
SELECT home_team AS score FROM table_name_98 WHERE home_team = "fitzroy" | What did fitzroy score at their home game? | CREATE TABLE table_name_98 (home_team VARCHAR) |
SELECT COUNT(status) FROM table_22815568_3 WHERE county = "Wayne" | How many statuses are listed for Wayne county? | CREATE TABLE table_22815568_3 (status VARCHAR, county VARCHAR) |
SELECT visitor FROM table_name_77 WHERE home = "vancouver" | Who was the visitor when vancouver was at home? | CREATE TABLE table_name_77 (
visitor VARCHAR,
home VARCHAR
) |
SELECT away_team FROM table_name_16 WHERE venue = "western oval" | Which away team played at western oval? | CREATE TABLE table_name_16 (away_team VARCHAR, venue VARCHAR) |
SELECT market_income_per_capita FROM table_22815568_3 WHERE status = "Distressed" AND unemployment_rate = "10.5%" | What is the market income per capita in a county where the status is distressed and the unemployment rate is at 10.5%? | CREATE TABLE table_22815568_3 (market_income_per_capita VARCHAR, status VARCHAR, unemployment_rate VARCHAR) |
SELECT "Country" FROM table_20398 WHERE "DAR" = '16:9' AND "Language" = 'Italian English' AND "Television service" = 'Disney XD +2' | Name the country when dar is 16:9 for italian english for disney xd +2 | CREATE TABLE table_20398 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) |
SELECT surface FROM table_name_83 WHERE partner = "yew-ming si" | Which surface had Yew-Ming Si as a partner? | CREATE TABLE table_name_83 (surface VARCHAR, partner VARCHAR) |
SELECT status FROM table_22815568_3 WHERE poverty_rate = "36.6%" | What is the status for all the counties that have a poverty rate of 36.6%? | CREATE TABLE table_22815568_3 (status VARCHAR, poverty_rate VARCHAR) |
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'orthopedics consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'albumin human 25 % iv soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t2 WHERE t1.treatmenttime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') | count the number of patients who had been prescribed albumin human 25 % iv soln within 2 months after having received a orthopedics consultation procedure since 6 years ago. | 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 allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime 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 medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime 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
) |
SELECT result FROM table_name_73 WHERE rank = 1 | What was the result of rank 1? | CREATE TABLE table_name_73 (result VARCHAR, rank VARCHAR) |
SELECT status FROM table_22815568_6 WHERE poverty_rate = "11.4%" | What is the status if the poverty rate is 11.4%? | CREATE TABLE table_22815568_6 (status VARCHAR, poverty_rate VARCHAR) |
SELECT middle_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | Visualize a bar chart about the distribution of middle_name and gender_mf . | CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
) |
SELECT type FROM table_name_70 WHERE date = "1 june" | What type has a date of 1 june? | CREATE TABLE table_name_70 (type VARCHAR, date VARCHAR) |
SELECT county FROM table_22815568_6 WHERE poverty_rate = "12.9%" | If the poverty rate is 12.9%, what is the county? | CREATE TABLE table_22815568_6 (county VARCHAR, poverty_rate VARCHAR) |
SELECT stop_no FROM table_name_25 WHERE destination = "[2778] claisebrook station platforms" | What is Stop No., when Destination is [2778] Claisebrook Station Platforms? | CREATE TABLE table_name_25 (
stop_no VARCHAR,
destination VARCHAR
) |
SELECT date FROM table_name_16 WHERE type = "hilly stage" | What was the date with a hilly stage? | CREATE TABLE table_name_16 (date VARCHAR, type VARCHAR) |
SELECT MAX(population) FROM table_22815568_6 | What is the population maximum? | CREATE TABLE table_22815568_6 (population INTEGER) |
SELECT * FROM table_train_143 WHERE (pulse_rate >= 45 AND pulse_rate <= 100) AND (respiratory_rate >= 8 AND respiratory_rate <= 20) | pulse rate between 45 _ 100 bpm; respirations between 8 _ 20 per minute | CREATE TABLE table_train_143 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"agitation" bool,
"npi" int,
"aggression_domain" bool,
"delusions_hallucinations" bool,
"pulse_rate" int,
"fridericia_corrected_qt_interval_qtcf" int,
"diastolic_blood_pressure_dbp" int,
"liver_disease" bool,
"hallucinations" bool,
"kidney_disease" bool,
"delusions" bool,
"respiratory_rate" int,
"psychosis_subscale" bool,
"NOUSE" float
) |
SELECT winner FROM table_name_21 WHERE date = "18 may" | What is the name of the winner on 18 may? | CREATE TABLE table_name_21 (winner VARCHAR, date VARCHAR) |
SELECT county FROM table_22815568_6 WHERE unemployment_rate = "4.8%" | What county is the unemployment rate 4.8%? | CREATE TABLE table_22815568_6 (county VARCHAR, unemployment_rate VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.