answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT COUNT(result) FROM table_14951643_1 WHERE opponent = "Cleveland Browns" | how many result with opponent being cleveland browns | CREATE TABLE table_14951643_1 (result VARCHAR, opponent VARCHAR) |
SELECT away_captain FROM table_name_69 WHERE result = "wi by 9 wkts" | Name the away captain with result of wi by 9 wkts | CREATE TABLE table_name_69 (
away_captain VARCHAR,
result VARCHAR
) |
SELECT type_of_record FROM table_21436373_8 WHERE date_year = "Tue 11/02/75" | What record was set on Tue 11/02/75? | CREATE TABLE table_21436373_8 (type_of_record VARCHAR, date_year VARCHAR) |
SELECT result FROM table_14951643_1 WHERE opponent = "at New England Patriots" | what's the result with opponent being at new england patriots | CREATE TABLE table_14951643_1 (result VARCHAR, opponent VARCHAR) |
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner | Draw a bar chart of owner versus total number of rating in percent, and display in ascending by the X. | CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_percent real
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
) |
SELECT type_of_record FROM table_21436373_8 WHERE result_games = "9 games (28,595 avg.)" | What record was set when the result/game was equal to 9 games (28,595 avg.) | CREATE TABLE table_21436373_8 (type_of_record VARCHAR, result_games VARCHAR) |
SELECT record FROM table_14951643_1 WHERE result = "W 21–7" | what's the record with result being w 21–7 | CREATE TABLE table_14951643_1 (record VARCHAR, result VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Base Excess" | How many patients admitted to the hospital before 2139 had a lab test base excess? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
) |
SELECT type_of_record FROM table_21436373_8 WHERE result_games = "Montreal 20 @ Ottawa 10" | What record was set when the result/game was montreal 20 @ ottawa 10? | CREATE TABLE table_21436373_8 (type_of_record VARCHAR, result_games VARCHAR) |
SELECT date FROM table_14951643_1 WHERE attendance = 40657 | what's the date with attendance being 40657 | CREATE TABLE table_14951643_1 (date VARCHAR, attendance VARCHAR) |
SELECT date FROM table_name_6 WHERE score = "2-1" | Which date has a score of 2-1? | CREATE TABLE table_name_6 (
date VARCHAR,
score VARCHAR
) |
SELECT stadium FROM table_21436373_8 WHERE result_games = "Montreal 20 @ Ottawa 10" | Which stadium had the result/game montreal 20 @ ottawa 10? | CREATE TABLE table_21436373_8 (stadium VARCHAR, result_games VARCHAR) |
SELECT MIN(attendance) FROM table_14945881_1 WHERE date = "September 19, 1976" | Name the attendance for september 19, 1976 | CREATE TABLE table_14945881_1 (attendance INTEGER, date VARCHAR) |
SELECT result FROM table_1342370_41 WHERE incumbent = "Finis J. Garrett" | What was the result in the election where the incumbent was Finis J. Garrett? | CREATE TABLE table_1342370_41 (
result VARCHAR,
incumbent VARCHAR
) |
SELECT date_year FROM table_21436373_5 WHERE type_of_record = "Total attendance-Regular season" | For what year is the type of record 'total attendance-regular season? | CREATE TABLE table_21436373_5 (date_year VARCHAR, type_of_record VARCHAR) |
SELECT COUNT(record) FROM table_14945881_1 WHERE attendance = 44023 | Name the number of record when attendance is 44023 | CREATE TABLE table_14945881_1 (record VARCHAR, attendance 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | show me all flights from SAN DIEGO to LOS ANGELES | CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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 flight_leg (
flight_id int,
leg_number int,
leg_flight 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 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 days (
days_code varchar,
day_name 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 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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type 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 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 city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name 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 airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
) |
SELECT type_of_record FROM table_21436373_5 WHERE result_games = "Montreal 31 @ Calgary 32" | What type of record is the result of the game Montreal 31 @ Calgary 32? | CREATE TABLE table_21436373_5 (type_of_record VARCHAR, result_games VARCHAR) |
SELECT MIN(week) FROM table_14945881_1 WHERE date = "September 19, 1976" | Name the least week for september 19, 1976 | CREATE TABLE table_14945881_1 (week INTEGER, date VARCHAR) |
SELECT swimsuit FROM table_15081939_4 WHERE evening_gown = "7.61" | What is the swimsuit score for the item that has 7.61 as evening gown | CREATE TABLE table_15081939_4 (
swimsuit VARCHAR,
evening_gown VARCHAR
) |
SELECT date_year FROM table_21436373_5 WHERE attendance = 45010 | On what date/s has attendance been 45010? | CREATE TABLE table_21436373_5 (date_year VARCHAR, attendance VARCHAR) |
SELECT record FROM table_14945881_1 WHERE attendance = 42827 | Name the record when attendance 42827 | CREATE TABLE table_14945881_1 (record VARCHAR, attendance VARCHAR) |
SELECT friendly FROM table_name_58 WHERE germany = "france" | What is the friendly game for Germany of France? | CREATE TABLE table_name_58 (
friendly VARCHAR,
germany VARCHAR
) |
SELECT COUNT(attendance) FROM table_21436373_6 WHERE type_of_record = "Pre-season game" | What is the number of attendance with the pre-season game as the type of record? | CREATE TABLE table_21436373_6 (attendance VARCHAR, type_of_record VARCHAR) |
SELECT date FROM table_14945881_1 WHERE week = 9 | Name the date when week is 9 | CREATE TABLE table_14945881_1 (date VARCHAR, week VARCHAR) |
SELECT "NBA Draft" FROM table_54586 WHERE "Hometown" = 'washington, dc' | What is the NBA draft result of the player from Washington, DC? | CREATE TABLE table_54586 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) |
SELECT type_of_record FROM table_21436373_6 WHERE result_games = "9 games (57,144 avg.)" | Which type of record has result/games of 9 games (57,144 avg.) | CREATE TABLE table_21436373_6 (type_of_record VARCHAR, result_games VARCHAR) |
SELECT year__ceremony_ FROM table_14975415_1 WHERE hungarian_title = "Taxidermia" | What year was taxidermia nominated? | CREATE TABLE table_14975415_1 (year__ceremony_ VARCHAR, hungarian_title VARCHAR) |
SELECT COUNT(points) FROM table_name_62 WHERE difference = "23" AND drawn < 5 | How many points have a difference of 23, with a drawn less than 5? | CREATE TABLE table_name_62 (
points VARCHAR,
difference VARCHAR,
drawn VARCHAR
) |
SELECT result_games FROM table_21436373_6 WHERE date_year = "Sun 11/28/10" | What is the result/games of Sun 11/28/10 as the date/year? | CREATE TABLE table_21436373_6 (result_games VARCHAR, date_year VARCHAR) |
SELECT director FROM table_14975415_1 WHERE english_title = "Diary for My Loves" | Who is the director for diary for my loves? | CREATE TABLE table_14975415_1 (director VARCHAR, english_title VARCHAR) |
SELECT score FROM table_name_65 WHERE dance = "jive" AND result = "safe" | What was the score of the team that danced a jive and was safe? | CREATE TABLE table_name_65 (
score VARCHAR,
dance VARCHAR,
result VARCHAR
) |
SELECT stadium FROM table_21436373_6 WHERE date_year = "Fri 06/25/82" | Which stadium has the date/year of Fri 06/25/82? | CREATE TABLE table_21436373_6 (stadium VARCHAR, date_year VARCHAR) |
SELECT result FROM table_14975415_1 WHERE english_title = "Diary for My Loves" | Was diary for my loves nominated? | CREATE TABLE table_14975415_1 (result VARCHAR, english_title VARCHAR) |
SELECT "Producer(s)" FROM table_79857 WHERE "Title" = 'fast life' | Who produced 'Fast Life'? | CREATE TABLE table_79857 (
"Title" text,
"Producer(s)" text,
"Artist(s)" text,
"Time" text,
"Team(s)" text
) |
SELECT type_of_record FROM table_21436373_6 WHERE result_games = "B.C. 16 @ Edmonton 22" | Which type of record has result/games of b.c. 16 @ edmonton 22? | CREATE TABLE table_21436373_6 (type_of_record VARCHAR, result_games VARCHAR) |
SELECT director FROM table_14975415_1 WHERE english_title = "The Witman Boys" | Who is the director for the witman boys? | CREATE TABLE table_14975415_1 (director VARCHAR, english_title VARCHAR) |
SELECT player FROM table_2850912_12 WHERE college_junior_club_team = "Brynäs IF (Sweden)" | List the players for team bryn s if (sweden). | CREATE TABLE table_2850912_12 (
player VARCHAR,
college_junior_club_team VARCHAR
) |
SELECT MIN(population__2000_) FROM table_2144436_1 WHERE barangay = "Panlicsian" | What was the populati in 2000 for Panlicsian? | CREATE TABLE table_2144436_1 (population__2000_ INTEGER, barangay VARCHAR) |
SELECT game_site FROM table_14977592_1 WHERE date = "December 12, 1965" | Name the game site for december 12, 1965 | CREATE TABLE table_14977592_1 (game_site VARCHAR, date VARCHAR) |
SELECT frequency FROM table_13869651_3 WHERE part_number_s_ = "ADO520BIAA5DO" | What is the frequency of the model whose part number is ado520biaa5do? | CREATE TABLE table_13869651_3 (
frequency VARCHAR,
part_number_s_ VARCHAR
) |
SELECT MAX(population__2010_) FROM table_2144436_1 WHERE barangay = "Minane" | What was the population in 2010 for Minane | CREATE TABLE table_2144436_1 (population__2010_ INTEGER, barangay VARCHAR) |
SELECT COUNT(game_site) FROM table_14977592_1 WHERE opponent = "Chicago Bears" | Name the total number of game sites for chicago bears | CREATE TABLE table_14977592_1 (game_site VARCHAR, opponent VARCHAR) |
SELECT MAX(attendance) FROM table_14875671_1 WHERE week = 8 | What was the attendance in week 8? | CREATE TABLE table_14875671_1 (
attendance INTEGER,
week VARCHAR
) |
SELECT population__2007_ FROM table_2144436_1 WHERE barangay = "Corazon De Jesus" | What is the 2007 population for Corazon de Jesus? | CREATE TABLE table_2144436_1 (population__2007_ VARCHAR, barangay VARCHAR) |
SELECT result FROM table_14977592_1 WHERE date = "November 14, 1965" | Name the result for november 14, 1965 | CREATE TABLE table_14977592_1 (result VARCHAR, date VARCHAR) |
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC | For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id, could you show X-axis in desc order? | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
) |
SELECT MAX(population__2010_) FROM table_2144436_1 WHERE population__2000_ = 5720 | What is the 2010 population when the 2000 population is 5720? | CREATE TABLE table_2144436_1 (population__2010_ INTEGER, population__2000_ VARCHAR) |
SELECT game_site FROM table_14971788_1 WHERE opponent = "Atlanta Falcons" | Where was the game against Atlanta Falcons held? | CREATE TABLE table_14971788_1 (game_site VARCHAR, opponent VARCHAR) |
SELECT insurgents FROM table_name_75 WHERE civilians = "49" | Name the insurgents for civilians being 49 | CREATE TABLE table_name_75 (
insurgents VARCHAR,
civilians VARCHAR
) |
SELECT rōmaji FROM table_2144389_8 WHERE japanese_translation = "By Your Side ~Hikari's Theme~ (PopUp.Version)" | Name the romaji by your side ~hikari's theme~ (popup.version) | CREATE TABLE table_2144389_8 (rōmaji VARCHAR, japanese_translation VARCHAR) |
SELECT date FROM table_14971788_1 WHERE week = 2 | What date was week 2? | CREATE TABLE table_14971788_1 (date VARCHAR, week VARCHAR) |
SELECT COUNT("Highest Position") FROM table_38374 WHERE "Album Title" = 'talk on corners' AND "Issue Date" > '1' | What is the highest position Talk on Corners, which had an issue date greater than 1, had? | CREATE TABLE table_38374 (
"Issue Date" real,
"Album Title" text,
"Artist" text,
"Sales" real,
"Highest Position" real
) |
SELECT vocalist FROM table_2144389_8 WHERE rōmaji = "Kaze no Messēji (PokaPoka-Version)" | Name the vocalist for kaze no messēji (pokapoka-version) | CREATE TABLE table_2144389_8 (vocalist VARCHAR, rōmaji VARCHAR) |
SELECT place FROM table_14977252_2 WHERE professional_jury = 5 | Name the place of the jury of 5 | CREATE TABLE table_14977252_2 (place VARCHAR, professional_jury VARCHAR) |
SELECT AVG("Points") FROM table_35810 WHERE "Class" = '250cc' AND "Wins" < '0' | What is the average number of points for a team in the 250cc class with fewer than 0 wins? | CREATE TABLE table_35810 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) |
SELECT MIN(_number) FROM table_2144389_8 WHERE japanese_title = "君のそばで~ヒカリのテーマ~(PopUp.Version)" | Name the least number for 君のそばで~ヒカリのテーマ~(popup.version) | CREATE TABLE table_2144389_8 (_number INTEGER, japanese_title VARCHAR) |
SELECT professional_jury FROM table_14977252_2 WHERE points = 10 | Name the jury of 10 points | CREATE TABLE table_14977252_2 (professional_jury VARCHAR, points VARCHAR) |
SELECT club_province FROM table_name_41 WHERE player = "david penalva" | Which Club/province has a Player of david penalva? | CREATE TABLE table_name_41 (
club_province VARCHAR,
player VARCHAR
) |
SELECT COUNT(vocalist) FROM table_2144389_8 WHERE japanese_translation = "Which One ~ Is It?" | Name the number of vocalists for which one ~ is it? | CREATE TABLE table_2144389_8 (vocalist VARCHAR, japanese_translation VARCHAR) |
SELECT artist FROM table_14977252_2 WHERE draw = 2 | Name the artist of 2 draw | CREATE TABLE table_14977252_2 (artist VARCHAR, draw VARCHAR) |
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'bengay' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') | how many prescriptions of bengay until 3 years ago are there? | 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 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 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE 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 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 d_items (
row_id number,
itemid number,
label text,
linksto text
) |
SELECT to_par FROM table_21469545_2 WHERE date = "20 Feb 2005" | Name the to par for 20 feb 2005 | CREATE TABLE table_21469545_2 (to_par VARCHAR, date VARCHAR) |
SELECT MIN(draw) FROM table_14977252_2 WHERE artist = "Elena Dermidjean" | Name the least draw for elena dermidjean | CREATE TABLE table_14977252_2 (draw INTEGER, artist VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "QUIN20" AND lab.fluid = "Other Body Fluid" | what is the number of patients whose drug code is quin20 and lab test fluid is other body fluid? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title 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
) |
SELECT COUNT(no) FROM table_21469545_2 WHERE margin_of_victory = "3 strokes" | Name the number for margin of victory being 3 strokes | CREATE TABLE table_21469545_2 (no VARCHAR, margin_of_victory VARCHAR) |
SELECT womens_doubles FROM table_15001572_1 WHERE mens_doubles = "No competition" | What was the competition when there was no competition for mens doubles? | CREATE TABLE table_15001572_1 (womens_doubles VARCHAR, mens_doubles VARCHAR) |
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) | What are the dates with a maximum temperature higher than 85, and count them by a bar chart, list in asc by the y axis. | CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
) |
SELECT COUNT(winning_score) FROM table_21469545_2 WHERE date = "8 Feb 2009" | Name the winning score for 8 feb 2009 | CREATE TABLE table_21469545_2 (winning_score VARCHAR, date VARCHAR) |
SELECT mixed_doubles FROM table_15001572_1 WHERE year = 1998 | Who won the mixed doubles in 1998? | CREATE TABLE table_15001572_1 (mixed_doubles VARCHAR, year VARCHAR) |
SELECT Class, COUNT(*) FROM race GROUP BY Class | Show the race class and number of races in each class with a bar chart. | CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) |
SELECT publisher FROM table_21458142_1 WHERE genre = "Pet-raising simulator" | Who published the title in the pet-raising simulator genre? | CREATE TABLE table_21458142_1 (publisher VARCHAR, genre VARCHAR) |
SELECT COUNT(college) FROM table_15017024_2 WHERE pick = 57 | How many colleges did the player picked 57 attend? | CREATE TABLE table_15017024_2 (college VARCHAR, pick VARCHAR) |
SELECT "Nation" FROM table_28838 WHERE "for" = '326' | What is the nation when the for is 326? | CREATE TABLE table_28838 (
"Place" real,
"Nation" text,
"played" real,
"won" real,
"drawn" real,
"lost" real,
"for" real,
"against" real,
"difference" real,
"Table points" real
) |
SELECT sales_breakdown FROM table_21458142_1 WHERE publisher = "Nintendo" AND title = "Mario Kart DS" | What's the sales breakdown for Nintendo's Mario Kart DS? | CREATE TABLE table_21458142_1 (sales_breakdown VARCHAR, publisher VARCHAR, title VARCHAR) |
SELECT COUNT(height) FROM table_15017024_2 WHERE player_name = "Chad Henne" | How many heights does chad henne have? | CREATE TABLE table_15017024_2 (height VARCHAR, player_name VARCHAR) |
SELECT "Rowers" FROM table_65543 WHERE "Time" = '5:54.57' | Who are the rowers with the time of 5:54.57? | CREATE TABLE table_65543 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) |
SELECT total_copies_sold FROM table_21458142_1 WHERE release_date = "October 23, 2008" | How many copies were sold of the game released on october 23, 2008? | CREATE TABLE table_21458142_1 (total_copies_sold VARCHAR, release_date VARCHAR) |
SELECT recopa_sudamericana_1992 FROM table_15013825_8 WHERE copa_libertadores_1992 = "Did not qualify" AND copa_conmebol_1992 = "Round of 16" AND team = "Bragantino" | Name the recopa sudamericana 1992 for did not qualify for libertadores 1992 and round of 16 for bragantino | CREATE TABLE table_15013825_8 (recopa_sudamericana_1992 VARCHAR, team VARCHAR, copa_libertadores_1992 VARCHAR, copa_conmebol_1992 VARCHAR) |
SELECT MAX(goal) FROM table_name_39 WHERE result = "2–3" | What is the top goal for the result of 2 3? | CREATE TABLE table_name_39 (
goal INTEGER,
result VARCHAR
) |
SELECT sales_breakdown FROM table_21458142_1 WHERE publisher = "Nintendo" AND release_date = "May 15, 2006" | What's the sales breakdown of the Nintendo game released on May 15, 2006? | CREATE TABLE table_21458142_1 (sales_breakdown VARCHAR, publisher VARCHAR, release_date VARCHAR) |
SELECT copa_libertadores_1992 FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16" AND team = "Fluminense" | Name the copa libertadores 1992 for round of 16 and team of fluminense | CREATE TABLE table_15013825_8 (copa_libertadores_1992 VARCHAR, copa_conmebol_1992 VARCHAR, team VARCHAR) |
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | what kind of airplane goes from BOSTON to SAN FRANCISCO before 1200 | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant 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 month (
month_number int,
month_name 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 class_of_service (
booking_class varchar,
rank int,
class_description 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 time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time 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 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 (
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 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 dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 flight_leg (
flight_id int,
leg_number int,
leg_flight int
) |
SELECT MAX(races) FROM table_21457754_2 | Name the most races | CREATE TABLE table_21457754_2 (races INTEGER) |
SELECT team FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16" | Name the team for copa conmebol 1992 is round of 16 | CREATE TABLE table_15013825_8 (team VARCHAR, copa_conmebol_1992 VARCHAR) |
SELECT "Director(s)" FROM table_67768 WHERE "Date" = '2/3/05' AND "Recipient" = 'sister films' | Who was the director of the film that Sister Films received an award for on 2/3/05? | CREATE TABLE table_67768 (
"Film" text,
"Director(s)" text,
"Producer(s)" text,
"Recipient" text,
"Date" text,
"Award" text
) |
SELECT MAX(rr1_pts) FROM table_21457754_2 | Name the most rr 1 pts | CREATE TABLE table_21457754_2 (rr1_pts INTEGER) |
SELECT league FROM table_15056103_1 WHERE year = 2009 | What league were they in in 2009? | CREATE TABLE table_15056103_1 (league VARCHAR, year 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPHIS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'LONG BEACH' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'MEMPHIS' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id | what is the cheapest flight from LONG BEACH to MEMPHIS | CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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 state (
state_code text,
state_name text,
country_name text
)
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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name 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 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 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 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 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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt 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 time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
) |
SELECT COUNT(total_pts) FROM table_21457754_2 WHERE team_name = "GBR Challenge" | Name the number of total pts for gbr challenge | CREATE TABLE table_21457754_2 (total_pts VARCHAR, team_name VARCHAR) |
SELECT playoffs FROM table_15056103_1 WHERE regular_season = "5th, North" | What was the playoff result when they finished 5th, north in the regular sesason? | CREATE TABLE table_15056103_1 (playoffs VARCHAR, regular_season VARCHAR) |
SELECT "7:00" FROM table_37294 WHERE "8:00" = 'la soirée du hockey' | Which 7:00 has an 8:00 of la soir e du hockey? | CREATE TABLE table_37294 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"10:00" text,
"10:30" text
) |
SELECT COUNT(second_place) FROM table_2146364_2 WHERE city_ & _nation = "Chicago, USA" | What is the total number of second place finishes when the city & nation was Chicago, USA? | CREATE TABLE table_2146364_2 (second_place VARCHAR, city_ VARCHAR, _nation VARCHAR) |
SELECT player FROM table_1506950_9 WHERE pga_ch = "T6" AND masters = "T4" AND us_open = "T8" | Which player's results were T6 in the PGA Ch., T4 in the Masters and T8 at the U.S. Open? | CREATE TABLE table_1506950_9 (player VARCHAR, us_open VARCHAR, pga_ch VARCHAR, masters VARCHAR) |
SELECT SUM(publication.citation_num) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year = 2005 | return me the total citations of papers in the VLDB conference in 2005 . | 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 keyword (
keyword varchar,
kid int
)
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE domain_journal (
did int,
jid int
) |
SELECT MIN(third_place) FROM table_2146364_2 WHERE city_ & _nation = "Vancouver, Canada" | What is the total number of third place finishes when the city & nation was Vancouver, Canada? | CREATE TABLE table_2146364_2 (third_place INTEGER, city_ VARCHAR, _nation VARCHAR) |
SELECT masters FROM table_1506950_9 WHERE pga_ch = "R16" | What is the result at the Masters for the player who finished R16 at the PGA Ch.? | CREATE TABLE table_1506950_9 (masters VARCHAR, pga_ch VARCHAR) |
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC | Bar chart x axis nationality y axis how many nationality, and list in descending by the Y-axis. | CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
) |
SELECT MIN(third_place) FROM table_2146364_2 | What is the smallest third place finish? | CREATE TABLE table_2146364_2 (third_place INTEGER) |
SELECT us_open FROM table_1506950_9 WHERE open_ch = "6th" | What was the player's result at the U.S. Open of the player who finished 6th at the Open Ch? | CREATE TABLE table_1506950_9 (us_open VARCHAR, open_ch VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.