table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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 ... | when was first time that patient 20000 had the minimum calculated total co2 value since 102 months ago? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TI... |
CREATE TABLE table_58358 (
"Position" text,
"Game 1" text,
"Game 2" text,
"Game 3" text,
"Game 4" text
) | During which Game 4, did Brett Kenny play Game 2? | SELECT "Game 4" FROM table_58358 WHERE "Game 2" = 'brett kenny' |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | Draw a bar chart for what is the average account balance of customers with credit score below 50 for the different account types?, could you list by the X-axis in ascending? | SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type |
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 t... | count the number of patients admitted before 2194 who were diagnosed with hypopotassemia. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.long_title = "Hypopotassemia" |
CREATE TABLE table_28491 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What was Katie's order number when the theme was The Rolling Stones? | SELECT "Order #" FROM table_28491 WHERE "Theme" = 'The Rolling Stones' |
CREATE TABLE table_39458 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Rank" text,
"Wins" real
) | How many years have 78 for points? | SELECT COUNT("Year") FROM table_39458 WHERE "Points" = '78' |
CREATE TABLE table_56891 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Date" real
) | What was the event for vinny magalh es? | SELECT "Event" FROM table_56891 WHERE "Opponent" = 'vinny magalhães' |
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
... | A bar chart about the number of faults for different fault status of all the faults recoreded in the logs, sort by the Y-axis in desc. | SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_status ORDER BY COUNT(fault_status) DESC |
CREATE TABLE table_name_57 (
built VARCHAR,
cr_no VARCHAR,
lms_no VARCHAR
) | What's the built date when the CR number is more than 940 and the LMS number is 14760? | SELECT built FROM table_name_57 WHERE cr_no > 940 AND lms_no = 14760 |
CREATE TABLE table_name_9 (
built VARCHAR,
location VARCHAR
) | When was la vista built? | SELECT built FROM table_name_9 WHERE location = "la vista" |
CREATE TABLE table_44527 (
"Team" text,
"Average" real,
"Points" real,
"Played" real,
"1991-92" text,
"1992-93" text,
"1993-94" real
) | Total points with 114 played and average of 0.982? | SELECT SUM("Points") FROM table_44527 WHERE "Played" = '114' AND "Average" = '0.982' |
CREATE TABLE table_7901 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | What round was jerry corcoran drafted in as pick number 114? | SELECT MAX("Round") FROM table_7901 WHERE "Pick" > '114' AND "Player" = 'jerry corcoran' |
CREATE TABLE table_57045 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | Which Tournament has Pat Cash as a runner-up? | SELECT "Tournament" FROM table_57045 WHERE "Runner-up" = 'pat cash' |
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 te... | what is drug type of drug name enalaprilat? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Enalaprilat" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose death status is 0 and admission location is emergency room admit? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" |
CREATE TABLE table_name_66 (
round VARCHAR,
college VARCHAR,
overall VARCHAR
) | In what Round with an Overall greater than 306 was the pick from the College of Virginia Tech? | SELECT COUNT(round) FROM table_name_66 WHERE college = "virginia tech" AND overall > 306 |
CREATE TABLE table_74753 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Sweet Sixteen" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
) | What Sweet Sixteen team is in the Colonial conference? | SELECT "Sweet Sixteen" FROM table_74753 WHERE "Conference" = 'colonial' |
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | Return a pie chart on what are the memories and carriers of phones? | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier |
CREATE TABLE table_name_80 (
home_team VARCHAR,
tie_no VARCHAR
) | Who was the Home team in Tie #23? | SELECT home_team FROM table_name_80 WHERE tie_no = 23 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | provide the number of patients whose admission year is less than 2158 and diagnoses long title is benign neoplasm of spinal meninges? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Benign neoplasm of spinal meninges" |
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
... | What are the cities that have a branch that opened in 2001 and a branch with more than 100 members? | SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100 |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Compare the total number of different ranks using a bar graph, could you order X in desc order? | SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank DESC |
CREATE TABLE table_2889810_2 (
moto2_250cc VARCHAR,
country VARCHAR
) | how many total number of moto2/250cc when country is united states | SELECT COUNT(moto2_250cc) FROM table_2889810_2 WHERE country = "United States" |
CREATE TABLE table_name_9 (
original_title VARCHAR,
english_title VARCHAR
) | English title of mal na had what original title? | SELECT original_title FROM table_name_9 WHERE english_title = "malèna" |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTME... | Visualize a scatter chart on what are total salaries and department id for each department that has more than 2 employees? | SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID |
CREATE TABLE table_25695027_1 (
number_built VARCHAR,
valve_gear VARCHAR,
cylinder_size VARCHAR,
firebox VARCHAR
) | How many engines were built with a cylinder size of 20 x 26 , firebox is belpaire and valve gear is from Stephenson? | SELECT number_built FROM table_25695027_1 WHERE cylinder_size = "20 ½” x 26”" AND firebox = "Belpaire" AND valve_gear = "Stephenson" |
CREATE TABLE table_name_17 (
name VARCHAR,
country VARCHAR
) | What is the name of the player from NGA? | SELECT name FROM table_name_17 WHERE country = "nga" |
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 varch... | Does Prof. Gabriel Horowitz teach INSTHUM 611 with a lab ? | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'INST... |
CREATE TABLE table_name_34 (
bike VARCHAR,
rider VARCHAR,
grid VARCHAR,
laps VARCHAR
) | Which bike did Jiri Drazdak ride when he had a grid number larger than 14 and less than 22 laps? | SELECT bike FROM table_name_34 WHERE grid > 14 AND laps < 22 AND rider = "jiri drazdak" |
CREATE TABLE table_20539826_1 (
mccain_percentage VARCHAR,
county VARCHAR
) | How many percent of the votes in Debaca did McCain get? | SELECT mccain_percentage FROM table_20539826_1 WHERE county = "DeBaca" |
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... | i would like to travel from BOSTON to DENVER early in the morning | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER... |
CREATE TABLE table_57842 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What week number saw a w 31-16 result? | SELECT MIN("Week") FROM table_57842 WHERE "Result" = 'w 31-16' |
CREATE TABLE table_10463 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text,
"Boxscore" text
) | Which box score has an Attendance of 54,773? | SELECT "Boxscore" FROM table_10463 WHERE "Attendance" = '54,773' |
CREATE TABLE table_14716 (
"Year" real,
"Category" text,
"Film" text,
"Winner/Nominee(s)" text,
"Result" text
) | What year did the movie Rango come out? | SELECT AVG("Year") FROM table_14716 WHERE "Film" = 'rango' |
CREATE TABLE table_80085 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Who was in 1963? | SELECT "Entrant" FROM table_80085 WHERE "Year" = '1963' |
CREATE TABLE table_61865 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"Hometown/School" text
) | WHAT TEAM HAS A PICK LARGER THAN 29? | SELECT "Team" FROM table_61865 WHERE "Pick" > '29' |
CREATE TABLE journal (
journal_id number,
date text,
theme text,
sales number
)
CREATE TABLE journal_committee (
editor_id number,
journal_id number,
work_type text
)
CREATE TABLE editor (
editor_id number,
name text,
age number
) | List the names of editors in ascending order of age. | SELECT name FROM editor ORDER BY age |
CREATE TABLE table_20065425_1 (
title VARCHAR,
termination_of_mission VARCHAR
) | How many different titles does the representative whose mission was terminated on August 5, 1984 have? | SELECT COUNT(title) FROM table_20065425_1 WHERE termination_of_mission = "August 5, 1984" |
CREATE TABLE table_name_57 (
venue VARCHAR,
home_team VARCHAR
) | What is the venue where the home team is Footscray? | SELECT venue FROM table_name_57 WHERE home_team = "footscray" |
CREATE TABLE table_name_41 (
loss INTEGER,
long INTEGER
) | What is the lowest Loss, when Long is less than 0? | SELECT MIN(loss) FROM table_name_41 WHERE long < 0 |
CREATE TABLE table_1213511_6 (
nationality VARCHAR,
nhl_team VARCHAR
) | What is the nationality of the player from the Detroit Red Wings? | SELECT nationality FROM table_1213511_6 WHERE nhl_team = "Detroit Red Wings" |
CREATE TABLE table_name_76 (
since INTEGER,
transfer_fee VARCHAR,
ends VARCHAR
) | What is the lowest year in since that had a transfer fee of 14m and ended after 2011? | SELECT MIN(since) FROM table_name_76 WHERE transfer_fee = "€ 14m" AND ends > 2011 |
CREATE TABLE table_name_79 (
record VARCHAR,
date VARCHAR
) | What was the record on march 26? | SELECT record FROM table_name_79 WHERE date = "march 26" |
CREATE TABLE table_name_80 (
year VARCHAR,
first_publisher VARCHAR,
english_title VARCHAR
) | What is the Year of Kodansha Novels' Tokyo Nightmare? | SELECT year FROM table_name_80 WHERE first_publisher = "kodansha novels" AND english_title = "tokyo nightmare" |
CREATE TABLE table_65004 (
"Municipality" text,
"FIPS code" real,
"Founded" real,
"Population (2010)" real,
"Area" text
) | What is the FIPS code for the municipality that has an area of 114.76 sq mi (297.23 sq km) and had a 2010 population of less than 166,327? | SELECT AVG("FIPS code") FROM table_65004 WHERE "Area" = '114.76 sq mi (297.23 sq km)' AND "Population (2010)" < '166,327' |
CREATE TABLE table_name_17 (
class VARCHAR,
power VARCHAR
) | what is the class when the power is 22500 watts? | SELECT class FROM table_name_17 WHERE power = "22500 watts" |
CREATE TABLE table_60259 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Name the Place which has a Score of 67-71=138, united states? | SELECT "Place" FROM table_60259 WHERE "Country" = 'united states' AND "Score" = '67-71=138' |
CREATE TABLE table_63271 (
"Name" text,
"Games" text,
"A-League" text,
"Finals" text,
"Goals" real,
"Assists" real,
"Years" text
) | What is the lowest number of goals of the player with 9 (0) games and less than 0 assists? | SELECT MIN("Goals") FROM table_63271 WHERE "Games" = '9 (0)' AND "Assists" < '0' |
CREATE TABLE table_name_21 (
home_team VARCHAR,
crowd INTEGER
) | Who played as the home team when the attendance was more than 30,080? | SELECT home_team FROM table_name_21 WHERE crowd > 30 OFFSET 080 |
CREATE TABLE table_name_81 (
set_2 VARCHAR,
total VARCHAR
) | What is Set 2, when Total is '52:44'? | SELECT set_2 FROM table_name_81 WHERE total = "52:44" |
CREATE TABLE table_name_85 (
college_junior_club_team VARCHAR,
round INTEGER
) | What is the college club that plays before round 3? | SELECT college_junior_club_team FROM table_name_85 WHERE round < 3 |
CREATE TABLE table_8048 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
) | What is the report for Challenge Stadium? | SELECT "Report" FROM table_8048 WHERE "Venue" = 'challenge stadium' |
CREATE TABLE table_330 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What height was the player that played for the Rockets between 1992-93? | SELECT "Height in Ft." FROM table_330 WHERE "Years for Rockets" = '1992-93' |
CREATE TABLE table_name_94 (
total VARCHAR,
sports VARCHAR,
silver VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | What is the Total medals the Year Yugoslavia had 1 Sport and won 0 Gold, Bronze or Silver? | SELECT total FROM table_name_94 WHERE gold = "0" AND bronze = "0" AND silver = "0" AND sports = "1" |
CREATE TABLE table_26847237_3 (
score VARCHAR,
opposition VARCHAR
) | What is the score when the opposition is mid canterbury? | SELECT score FROM table_26847237_3 WHERE opposition = "Mid Canterbury" |
CREATE TABLE table_name_11 (
round VARCHAR,
club VARCHAR
) | Which round did Dundee United end in? | SELECT round FROM table_name_11 WHERE club = "dundee united" |
CREATE TABLE stadium (
id number,
name text,
home_games number,
average_attendance number,
total_attendance number,
capacity_percentage number
)
CREATE TABLE injury_accident (
game_id number,
id number,
player text,
injury text,
number_of_matches text,
source text
)
CRE... | How many different kinds of information sources are there for injury accidents? | SELECT COUNT(DISTINCT source) FROM injury_accident |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose discharge location is home health care and age is less than 31? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "31" |
CREATE TABLE table_dev_34 (
"id" int,
"gender" string,
"heart_disease" bool,
"body_weight" float,
"hematocrit_hct" float,
"fasting_blood_glucose_fbg" float,
"hyperlipidemia" bool,
"systemic_illness" bool,
"angina" bool,
"serum_ldl" int,
"clinically_significant_atherosclerotic... | hematocrit of less than 36 % for male , less than 32 % for female . | SELECT * FROM table_dev_34 WHERE (hematocrit_hct < 36 AND gender = 'male') OR (hematocrit_hct < 32 AND gender = 'female') |
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,... | can you give me the latest flight from ATLANTA to DENVER on 7 7 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 7 AND date_day.month_number = 7 AND da... |
CREATE TABLE table_204_110 (
id number,
"year" number,
"champion" text,
"city" text,
"llws" text,
"record" text
) | who came in first place in 1966 ? | SELECT "champion" FROM table_204_110 WHERE "year" = 1966 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is minimum age of patients whose admission type is emergency and year of death is less than 2158? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2158.0" |
CREATE TABLE table_name_4 (
club VARCHAR,
goals VARCHAR
) | What club had 0 goals? | SELECT club FROM table_name_4 WHERE goals = 0 |
CREATE TABLE table_name_52 (
rank INTEGER,
games INTEGER
) | What is the smallest rank when there are more than 2 games? | SELECT MIN(rank) FROM table_name_52 WHERE games > 2 |
CREATE TABLE table_203_466 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the difference in medals between cuba and mexico ? | SELECT (SELECT "total" FROM table_203_466 WHERE "nation" = 'cuba') - (SELECT "total" FROM table_203_466 WHERE "nation" = 'mexico') |
CREATE TABLE table_77693 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did North Melbourne play as the home team? | SELECT "Venue" FROM table_77693 WHERE "Home team" = 'north melbourne' |
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions... | List the name for storms and the number of affected regions for each storm. | SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id |
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 numb... | count the number of patients for whom prednisone 50 mg po tabs was prescribed in the same hospital visit after having been diagnosed with pneumonia. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttim... |
CREATE TABLE table_12306 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Away team when Arsenal is the Home team? | SELECT "Away team" FROM table_12306 WHERE "Home team" = 'arsenal' |
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_pre... | Show the number of stations installed change over the installation date of in station table using a line chart, order in ascending by the installation_date. | SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_date |
CREATE TABLE table_2601 (
"Episode #" real,
"US Air Date" text,
"Rating" text,
"Share" real,
"Rating/Share (18-49)" text,
"Viewers (millions)" text
) | How many episodes have episode #11? | SELECT COUNT("US Air Date") FROM table_2601 WHERE "Episode #" = '11' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose procedure long title is creation of conduit between left ventricle and aorta and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Creation of conduit between left ventricle and aorta" AND lab.fluid = "Pleural" |
CREATE TABLE table_name_98 (
animal_name VARCHAR,
tv_series VARCHAR,
species VARCHAR
) | What animal was yes for tv series and was a terrapins? | SELECT animal_name FROM table_name_98 WHERE tv_series = "yes" AND species = "terrapins" |
CREATE TABLE table_12512 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Raiders points" real,
"Opponents" real,
"First Downs" real,
"Record" text,
"Streak" text,
"Attendance" real
) | What day did the Raiders score 17? | SELECT "Date" FROM table_12512 WHERE "Raiders points" = '17' |
CREATE TABLE table_67863 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
) | What females speak Romanian? | SELECT "females" FROM table_67863 WHERE "Language" = 'romanian' |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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_re... | please give me information on a flight on 4 17 from PHILADELPHIA to BOSTON as early as possible | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 17 AND date_day.month_number = 4 AND d... |
CREATE TABLE table_10706961_2 (
winning_team VARCHAR,
winning_driver VARCHAR
) | Which teams won when Bobby Rahal was their winning driver? | SELECT winning_team FROM table_10706961_2 WHERE winning_driver = "Bobby Rahal" |
CREATE TABLE table_name_38 (
song_choice VARCHAR,
result VARCHAR,
week VARCHAR
) | Which song garnered an advanced result during top 20 week ? | SELECT song_choice FROM table_name_38 WHERE result = "advanced" AND week = "top 20" |
CREATE TABLE table_name_50 (
week_11_nov_16 VARCHAR,
week_13_nov_30 VARCHAR
) | What is the week 11 nov 16 standing with wisconsin (10-1) on week 13 Nov 30? | SELECT week_11_nov_16 FROM table_name_50 WHERE week_13_nov_30 = "wisconsin (10-1)" |
CREATE TABLE table_name_22 (
score VARCHAR,
date VARCHAR
) | Can you tell me the Score that has the Date of april 8? | SELECT score FROM table_name_22 WHERE date = "april 8" |
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_inte... | i would like the least expensive airfare flight on sunday to PITTSBURGH from SAN FRANCISCO | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, date_day AS DATE... |
CREATE TABLE table_name_14 (
tyres VARCHAR,
year VARCHAR,
laps VARCHAR
) | Which tyre was before 1995 with 142 laps? | SELECT tyres FROM table_name_14 WHERE year < 1995 AND laps = 142 |
CREATE TABLE table_25438110_5 (
casinos VARCHAR,
fy09_$millions VARCHAR
) | How many casinos are associated with a FY2009 $mil value of exactly $279? | SELECT COUNT(casinos) FROM table_25438110_5 WHERE fy09_$millions = "$279" |
CREATE TABLE table_name_5 (
nationality VARCHAR,
title VARCHAR
) | What is the Nationality of the Deacon of S. Maria in Via Lata? | SELECT nationality FROM table_name_5 WHERE title = "deacon of s. maria in via lata" |
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 t... | count the number of patients whose ethnicity is black/cape verdean and primary disease is st elevated myocardial infarction\cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" |
CREATE TABLE table_203_543 (
id number,
"year" text,
"show" text,
"role" text,
"channel" text,
"extra" text
) | what was the name of the last television show between 2004 and february , 2013 in which mauli dave played herself ? | SELECT "show" FROM table_203_543 WHERE "role" = 'herself' |
CREATE TABLE table_5144 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the average grid with a number of laps smaller than 8? | SELECT AVG("Grid") FROM table_5144 WHERE "Laps" < '8' |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and salary , and list in desc by the Y. | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC |
CREATE TABLE table_22625 (
"Country" text,
"TV Network(s)" text,
"Series Premiere" text,
"Weekly Schedule" text,
"Status" text
) | What is every status with a weekly schedule of Monday to Thursday @ 11:00 pm? | SELECT "Status" FROM table_22625 WHERE "Weekly Schedule" = 'Monday to Thursday @ 11:00 pm' |
CREATE TABLE table_name_27 (
date VARCHAR,
tournament VARCHAR
) | What is the date of the Los Angeles open? | SELECT date FROM table_name_27 WHERE tournament = "los angeles open" |
CREATE TABLE table_66165 (
"Rank:" real,
"Premier:" text,
"Party:" text,
"Assumed Office:" text,
"Left Office:" text,
"TOTAL Time in Office:" text
) | what is the rank when the assumed office is 9 april 1903? | SELECT SUM("Rank:") FROM table_66165 WHERE "Assumed Office:" = '9 april 1903' |
CREATE TABLE table_78713 (
"Model" text,
"First Year" real,
"Distribution" text,
"Engine" text,
"Displacement cc" real,
"Power hp (kW)" text
) | What is the total number of First Year, when Displacement CC is greater than 4719, when Engine is V8, when Power HP (kW) is '335 (246)', and when Model is 'Ghibli SS'? | SELECT COUNT("First Year") FROM table_78713 WHERE "Displacement cc" > '4719' AND "Engine" = 'v8' AND "Power hp (kW)" = '335 (246)' AND "Model" = 'ghibli ss' |
CREATE TABLE table_204_414 (
id number,
"name" text,
"armenian" text,
"location" text,
"# of prisoners designed for" number,
"notes" text
) | name the location used the most number of times in the table . | SELECT "location" FROM table_204_414 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_1473672_4 (
college_junior_club_team VARCHAR,
nhl_team VARCHAR
) | Name the number of teams for college/junior club for philadelphia flyers | SELECT COUNT(college_junior_club_team) FROM table_1473672_4 WHERE nhl_team = "Philadelphia Flyers" |
CREATE TABLE table_name_77 (
team__number2 VARCHAR
) | What was the 2nd leg score in the matchup with a team 2 of KK Borac? | SELECT 2 AS nd_leg FROM table_name_77 WHERE team__number2 = "kk borac" |
CREATE TABLE table_name_88 (
week VARCHAR,
result VARCHAR
) | What week's game had a result of l 35 37? | SELECT week FROM table_name_88 WHERE result = "l 35–37" |
CREATE TABLE table_51312 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was fitzroy the away team? | SELECT "Date" FROM table_51312 WHERE "Away team" = 'fitzroy' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | when did patient 002-19168 receive a prescription since 54 months ago for the last time? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-19168')) AND DATETIME(medication.drugstarttime) >= DATETIM... |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | show me all FIRST class fares from NEW YORK to MIAMI leaving on a TUESDAY | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_... |
CREATE TABLE table_name_93 (
tournament VARCHAR,
outcome VARCHAR,
opponent VARCHAR
) | Which tournament has an Outcome of runner-up, and an Opponent of ma a zec pe kiri ? | SELECT tournament FROM table_name_93 WHERE outcome = "runner-up" AND opponent = "maša zec peškirič" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.