table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_519 (
"Series Ep #" real,
"Season 2 Ep #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Airdate" text,
"Production Code" real
) | What is the number of the original airdate with the production code 208. | SELECT COUNT("Original Airdate") FROM table_519 WHERE "Production Code" = '208' |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number... | when did patient 16088 have the d5w intake since 931 days ago for the first time? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16088)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... |
CREATE TABLE table_32460 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team's score when the away team is south melbourne? | SELECT "Home team score" FROM table_32460 WHERE "Away team" = 'south melbourne' |
CREATE TABLE table_9333 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | who is the opponent after march 21 and the game is 75? | SELECT "Opponent" FROM table_9333 WHERE "March" > '21' AND "Game" = '75' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Posts by New users per day. This counts how many posts there have been by users on their first day. Broken down for easy graphing. | SELECT DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)), COUNT(*) FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId INNER JOIN Votes AS v ON v.PostId = p.Id WHERE p.PostTypeId = 1 AND DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)) > '2015-07-31 00:00:00' AND v.VoteTypeId = 3 GROUP BY DATEADD(d, 0, DATEDIFF(d, 0, Cr... |
CREATE TABLE table_25064 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | How many reasons for change were listed when Edward Hempstead was the successor? | SELECT COUNT("Reason for change") FROM table_25064 WHERE "Successor" = 'Edward Hempstead' |
CREATE TABLE table_name_21 (
points VARCHAR,
home VARCHAR
) | How many points were scored in the Detroit Home? | SELECT points FROM table_name_21 WHERE home = "detroit" |
CREATE TABLE table_60664 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Who has a finish of t66? | SELECT "Player" FROM table_60664 WHERE "Finish" = 't66' |
CREATE TABLE table_18018214_3 (
points INTEGER,
goals_scored VARCHAR
) | HOw many points where there when the number of goals scored was 47? | SELECT MAX(points) FROM table_18018214_3 WHERE goals_scored = 47 |
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
)
... | Show id from each meter 500 | SELECT meter_500, ID FROM swimmer |
CREATE TABLE table_name_2 (
driving_force_gt VARCHAR,
g27_racing_wheel VARCHAR,
gt_force VARCHAR,
driving_force_pro VARCHAR
) | GT Force of no, and a Driving Force Pro of no, and a G27 Racing Wheel of no has what driving force gt? | SELECT driving_force_gt FROM table_name_2 WHERE gt_force = "no" AND driving_force_pro = "no" AND g27_racing_wheel = "no" |
CREATE TABLE table_name_8 (
date VARCHAR,
location VARCHAR
) | What date was the game played when it was located at bells beach? | SELECT date FROM table_name_8 WHERE location = "bells beach" |
CREATE TABLE table_62131 (
"Manager" text,
"Mexico career" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Win %" real
) | What is the highes win % that manager juan carlos ch vez's team had when they lost less than 4 times? | SELECT MAX("Win %") FROM table_62131 WHERE "Manager" = 'juan carlos chávez' AND "Lost" < '4' |
CREATE TABLE table_3007 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | What was the reason for change when the successor was William Milnes, Jr. (C)? | SELECT "Reason for change" FROM table_3007 WHERE "Successor" = 'William Milnes, Jr. (C)' |
CREATE TABLE table_44189 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
) | what is the highest lane number for johan wissman when the react is less than 0.242? | SELECT MAX("Lane") FROM table_44189 WHERE "Name" = 'johan wissman' AND "React" < '0.242' |
CREATE TABLE table_73645 (
"WEEK" real,
"Sydney" real,
"Melbourne" real,
"Brisbane" real,
"Adelaide" real,
"Perth" real,
"TOTAL" real,
"WEEKLY RANK" real
) | How many episodes aired in Sydney in Week 3? | SELECT COUNT("Sydney") FROM table_73645 WHERE "WEEK" = '3' |
CREATE TABLE table_name_88 (
density INTEGER,
province VARCHAR,
area VARCHAR
) | What is the highest Density for the independencia province, with an area smaller than 2,007.4? | SELECT MAX(density) FROM table_name_88 WHERE province = "independencia" AND area < 2 OFFSET 007.4 |
CREATE TABLE table_204_500 (
id number,
"year" number,
"title" text,
"peak chart positions\nus country" number,
"peak chart positions\nus" number,
"album" text
) | what is the number of top ten hits kitty wells had in 1953 alone ? | SELECT COUNT(*) FROM table_204_500 WHERE "peak chart positions\nus country" <= 10 AND "year" = 1953 |
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... | count the number of patients whose admission type is newborn and ethnicity is hispanic/latino - puerto rican? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" |
CREATE TABLE table_32218 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was South Melbourne's score as the home team? | SELECT "Home team score" FROM table_32218 WHERE "Home team" = 'south melbourne' |
CREATE TABLE table_name_96 (
name VARCHAR,
spread VARCHAR
) | What name has a spread of 69? | SELECT name FROM table_name_96 WHERE spread = 69 |
CREATE TABLE table_name_83 (
points INTEGER,
engine VARCHAR,
year VARCHAR
) | What are the highest points that have a Mugen V8 engine and happened in 1991? | SELECT MAX(points) FROM table_name_83 WHERE engine = "mugen v8" AND year = 1991 |
CREATE TABLE table_6798 (
"Episode" text,
"VII Season" text,
"VIII Season" text,
"XII Season" text,
"XIII Season" text
) | What is XIII Season, when VIII Season is 4 780 743 (2 november 2008)? | SELECT "XIII Season" FROM table_6798 WHERE "VIII Season" = '4 780 743 (2 november 2008)' |
CREATE TABLE table_34756 (
"Rank" real,
"Centre" text,
"Country" text,
"Rating" real,
"Change" real
) | Which Centre has a Rank of 42? | SELECT "Centre" FROM table_34756 WHERE "Rank" = '42' |
CREATE TABLE table_name_16 (
away_team VARCHAR,
tie_no VARCHAR
) | What is Away Team, when Tie No is 4? | SELECT away_team FROM table_name_16 WHERE tie_no = "4" |
CREATE TABLE table_16714 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | what's the report with rnd being 4 | SELECT "Report" FROM table_16714 WHERE "Rnd" = '4' |
CREATE TABLE table_10781 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" text,
"FCC info" text
) | Name the frequency mhz for fcc and ERP W of 9 watts | SELECT "Frequency MHz" FROM table_10781 WHERE "FCC info" = 'fcc' AND "ERP W" = '9 watts' |
CREATE TABLE table_name_71 (
decision VARCHAR,
visitor VARCHAR,
home VARCHAR
) | Who had the decision when the visitor was Detroit and the home team was Ottawa? | SELECT decision FROM table_name_71 WHERE visitor = "detroit" AND home = "ottawa" |
CREATE TABLE table_name_63 (
record VARCHAR,
date VARCHAR
) | What was the record on April 7? | SELECT record FROM table_name_63 WHERE date = "april 7" |
CREATE TABLE table_22877 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | what is the surface of the final which had score 6-2, 6-3 | SELECT "Surface" FROM table_22877 WHERE "Score in the final" = '6-2, 6-3' |
CREATE TABLE table_61612 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Who won the event against U.S.A.? | SELECT "Status" FROM table_61612 WHERE "Opposing Teams" = 'u.s.a.' |
CREATE TABLE table_name_83 (
founded INTEGER,
type VARCHAR,
nickname VARCHAR
) | Which of the private colleges is the oldest, and whose nickname is the Mountaineers? | SELECT MIN(founded) FROM table_name_83 WHERE type = "private" AND nickname = "mountaineers" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | at what time was the patient with patient id 18480 discharged? | SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "18480" |
CREATE TABLE table_62456 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is the Weight of the Spandau 04 Player with a Height of m (ft 5in)? | SELECT "Weight" FROM table_62456 WHERE "Club" = 'spandau 04' AND "Height" = 'm (ft 5in)' |
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id nu... | What are the ids of stations that have latitude above 37.4 and never had bike availability below 7? | SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING MIN(bikes_available) < 7 |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
... | What are the Other classes for EECS majors ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id |
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... | what is maximum age of patients whose primary disease is gangrene and admission year is greater than or equal to 2103? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "GANGRENE" AND demographic.admityear >= "2103" |
CREATE TABLE table_17516967_1 (
swimsuit VARCHAR,
state VARCHAR
) | Name the swuinsuit for oregon | SELECT swimsuit FROM table_17516967_1 WHERE state = "Oregon" |
CREATE TABLE table_name_41 (
region VARCHAR,
format VARCHAR,
date VARCHAR
) | In what region was Degeneration released in digital format on 19 July 2008? | SELECT region FROM table_name_41 WHERE format = "digital" AND date = "19 july 2008" |
CREATE TABLE table_name_49 (
save VARCHAR,
opponent VARCHAR
) | What is the save of the game with rice as the opponent? | SELECT save FROM table_name_49 WHERE opponent = "rice" |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | until 1 year ago, patient 003-39724 had any allergies? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-39724')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-1 y... |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | tell me the top three drugs that are most frequently prescribed for patients in the 40s until 1 year ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GR... |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Give me the comparison about Weight over the Date_of_Birth , list from high to low by the bar. | SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth DESC |
CREATE TABLE table_10643 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the largest Grid with a Driver of piers courage? | SELECT MAX("Grid") FROM table_10643 WHERE "Driver" = 'piers courage' |
CREATE TABLE table_68913 (
"Round" text,
"Name" text,
"Song" text,
"Score" real,
"Status" text
) | What round has this song: - / - ? | SELECT "Round" FROM table_68913 WHERE "Song" = '陶喆、蔡依林 - 今天你要嫁给我/曹格 - 世界唯一的你' |
CREATE TABLE table_12708 (
"Year" real,
"Championship" text,
"Partnering" text,
"Opponents in Final" text,
"Score in Final" text
) | What was the championship before 2012 that had Stephane Houdet Michael Jeremiasz as opponents? | SELECT "Championship" FROM table_12708 WHERE "Year" < '2012' AND "Opponents in Final" = 'stephane houdet michael jeremiasz' |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Addresses (
address_id INTEGE... | Show the number of addrens history for each customer in a bar chart. | SELECT T2.customer_name, COUNT(T2.customer_name) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T2.customer_name |
CREATE TABLE table_name_22 (
frequency_mhz VARCHAR,
erp_w VARCHAR,
call_sign VARCHAR
) | Name the total number of frequency Mhz for when it has ERP W of 1 and call sign of w215bj | SELECT COUNT(frequency_mhz) FROM table_name_22 WHERE erp_w = 1 AND call_sign = "w215bj" |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,... | Question count by the number of answers per question. | SELECT q.Cnt AS AnswerCount, COUNT(*) AS QuestionCount, COUNT(*) * 100.0 / MIN(TotalQuestions) AS "Percent" FROM (SELECT (SELECT COUNT(*) FROM Posts AS a WHERE a.PostTypeId = 1) AS TotalQuestions, (SELECT COUNT(*) FROM Posts AS a WHERE a.ParentId = q.Id AND a.PostTypeId = 2) AS Cnt FROM Posts AS q WHERE q.PostTypeId = ... |
CREATE TABLE table_49365 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the Rider, when Grid is less than 16, when Manufacturer is Aprilia, and when Time is +28.288? | SELECT "Rider" FROM table_49365 WHERE "Grid" < '16' AND "Manufacturer" = 'aprilia' AND "Time" = '+28.288' |
CREATE TABLE table_3002894_4 (
nupowr_167 VARCHAR,
model VARCHAR
) | When maker is the model what is the nupowr 167? | SELECT nupowr_167 FROM table_3002894_4 WHERE model = "Maker" |
CREATE TABLE table_name_87 (
date VARCHAR,
partner VARCHAR
) | What Date had a Partner of urszula radwa ska? | SELECT date FROM table_name_87 WHERE partner = "urszula radwańska" |
CREATE TABLE table_train_73 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"in_another_study" bool,
"systolic_blood_pressure_sbp" int,
"skin_mottling_score" int,
"glasgow_come_score_gcs" int,
"mr_scanning" bool,
"age" float,
"NOUSE" float
) | age > 18 years either sex | SELECT * FROM table_train_73 WHERE (gender = 'male' OR gender = 'female') AND age > 18 |
CREATE TABLE table_name_46 (
historical_photos VARCHAR,
location VARCHAR
) | Which Historical Photos were taken at prospect 43 prospect ave? | SELECT historical_photos FROM table_name_46 WHERE location = "prospect 43 prospect ave" |
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob... | Find the last name and hire date of the professor who is in office DRE 102. | SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102' |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varch... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, I want to list by the bars from low to high. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID |
CREATE TABLE table_67616 (
"Classification" text,
"Fastest time (s)" real,
"Athlete" text,
"Country" text,
"Date" text,
"Location" text
) | Which athlete has the fastest time of 15.82? | SELECT "Athlete" FROM table_67616 WHERE "Fastest time (s)" = '15.82' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
... | when was the last time patient 76637 was discharged since 2102? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 76637 AND STRFTIME('%y', admissions.dischtime) >= '2102' ORDER BY admissions.dischtime DESC LIMIT 1 |
CREATE TABLE table_name_30 (
winners VARCHAR
) | Who came in 3rd when Matej agar won? | SELECT 3 AS rd_place FROM table_name_30 WHERE winners = "matej žagar" |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
... | may i have a listing of flights from LONG BEACH to COLUMBUS OHIO on tuesday | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'COLUMBUS' AND date_day.day_number = 22 AND date_day.month_number =... |
CREATE TABLE table_name_10 (
catalog VARCHAR,
format VARCHAR
) | What catalog uses the stereo compact cassette format? | SELECT catalog FROM table_name_10 WHERE format = "stereo compact cassette" |
CREATE TABLE table_70067 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which average bronze had a silver greater than 2 and a gold larger than 7? | SELECT AVG("Bronze") FROM table_70067 WHERE "Silver" > '2' AND "Gold" > '7' |
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 ... | tell me the price for reticulocyte count, manual? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reticulocyte count, manual')) |
CREATE TABLE table_12153 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the highest number of losses of club cf calvo sotelo, which has more than 31 goals against, 38 goals for, and less than 30 played? | SELECT MAX("Losses") FROM table_12153 WHERE "Goals against" > '31' AND "Goals for" = '38' AND "Club" = 'cf calvo sotelo' AND "Played" < '30' |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
) | A pie chart for returning the number of the countries of the mountains that have a height larger than 5000. | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country |
CREATE TABLE table_47919 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What is the date of appointment of the manager who was replaced by markus babbel? | SELECT "Date of appointment" FROM table_47919 WHERE "Replaced by" = 'markus babbel' |
CREATE TABLE table_name_42 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | What is the Original title of Children of Sarajevo? | SELECT original_title FROM table_name_42 WHERE film_title_used_in_nomination = "children of sarajevo" |
CREATE TABLE diagnoses_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,
... | get me the top four most frequently prescribed drugs for patients 60 or above during this year? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0... |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
... | count the number of people who were prescribed potassium phosphate 3 mmol/ml15 ml inj in the same month following a diagnosis of anemia - anemia of renal disease in 2101. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia - anemia of renal disease' AND STRFTIME('%y', diagnosis.diagnosistime) = '2101') AS t1 JOIN (SELECT p... |
CREATE TABLE table_name_72 (
total INTEGER,
date VARCHAR,
greater_doubles VARCHAR
) | Which Total has a Date of 1602, and Greater Doubles smaller than 16? | SELECT MAX(total) FROM table_name_72 WHERE date = 1602 AND greater_doubles < 16 |
CREATE TABLE table_54315 (
"PRR Class" text,
"Builder\u2019s Model" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Service" text,
"Power output" text
) | What is the build date of the model with PRR Class brs24? | SELECT "Build date" FROM table_54315 WHERE "PRR Class" = 'brs24' |
CREATE TABLE table_43162 (
"Year" text,
"Champion" text,
"Country" text,
"To par" text,
"Margin of victory" text,
"Winner's share ( $ )" text
) | what is to par for the Winner's share 450,000 | SELECT "To par" FROM table_43162 WHERE "Winner's share ( $ )" = '450,000' |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | How many people have participated for a decade?. | SELECT COUNT(*) AS result FROM (SELECT COUNT(*) AS numPosts FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Users.CreationDate < DATEADD(year, -10, GETDATE()) GROUP BY Users.Id) AS x WHERE x.numPosts >= 10 |
CREATE TABLE game (
stadium_id number,
id number,
season number,
date text,
home_team text,
away_team text,
score text,
competition text
)
CREATE TABLE injury_accident (
game_id number,
id number,
player text,
injury text,
number_of_matches text,
source text
)
C... | What are the id and name of the stadium where the most injury accidents happened? | SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_853 (
"Rnd" real,
"Circuit" text,
"GTP Winning Team" text,
"Lights Winning Team" text,
"GTO Winning Team" text,
"GTU Winning Team" text,
"Results" text
) | Name the results for steve millen | SELECT "Results" FROM table_853 WHERE "GTO Winning Team" = 'Steve Millen' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients on iv drip route of drug administration who have diagnoses icd9 code v4983. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V4983" AND prescriptions.route = "IV DRIP" |
CREATE TABLE table_name_85 (
original_air_date VARCHAR,
series__number VARCHAR,
written_by VARCHAR
) | What was the original air date of a series number after 78, written by Jenee V. Giles? | SELECT original_air_date FROM table_name_85 WHERE series__number > 78 AND written_by = "jenee v. giles" |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | What is the number of counties for all appellations? | SELECT County, COUNT(County) FROM appellations GROUP BY County |
CREATE TABLE table_27790 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Young Rider Classification" text,
"Team Classification" text,
"Aggressive Rider" text
) | What was the stage when the winner was luis le n s nchez? | SELECT "Stage" FROM table_27790 WHERE "Winner" = 'Luis León Sánchez' |
CREATE TABLE table_22753245_1 (
constituency VARCHAR,
runner_up_a VARCHAR
) | Who is the constituency when the runner-up was d. Venugopal? | SELECT constituency FROM table_22753245_1 WHERE runner_up_a = "D. Venugopal" |
CREATE TABLE table_name_95 (
money___ INTEGER,
score VARCHAR
) | Which Money ($) has a Score of 70-66-73-69=278? | SELECT AVG(money___) AS $__ FROM table_name_95 WHERE score = 70 - 66 - 73 - 69 = 278 |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | during the last hospital encounter, when was the last time patient 8773 was prescribed pantoprazole? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8773 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'pantoprazole' ORDER BY prescriptions.startdate DESC LI... |
CREATE TABLE table_48860 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Country is United States, and when Player is 'Arnold Palmer'? | SELECT "Score" FROM table_48860 WHERE "Country" = 'united states' AND "Player" = 'arnold palmer' |
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,
war... | when were patient 3918 first prescribed for vancomycin and ketorolac at the same time in 07/this year? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vancomycin' AND admissions.subject_id = 3918 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'sta... |
CREATE TABLE table_22269839_1 (
written_by VARCHAR,
production_code VARCHAR
) | Who wrote the title with production code 7acx14? | SELECT written_by FROM table_22269839_1 WHERE production_code = "7ACX14" |
CREATE TABLE table_17246160_1 (
season INTEGER,
points VARCHAR,
position VARCHAR
) | Which season did he have 0 points and 31st position? | SELECT MAX(season) FROM table_17246160_1 WHERE points = 0 AND position = "31st" |
CREATE TABLE table_name_61 (
attendance VARCHAR,
record VARCHAR
) | What is the total attendance for games when the record was 23-23? | SELECT COUNT(attendance) FROM table_name_61 WHERE record = "23-23" |
CREATE TABLE table_58082 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | If collingwood was the Home team, what Date did they play? | SELECT "Date" FROM table_58082 WHERE "Home team" = 'collingwood' |
CREATE TABLE table_204_891 (
id number,
"name" text,
"hanzi" text,
"population (2005)" number,
"area (km2)" number
) | what is the total population in 2005 of qingxi , ruyi , and daping combined ? | SELECT SUM("population (2005)") FROM table_204_891 WHERE "name" IN ('qingxi', 'ruyi', 'daping') |
CREATE TABLE table_1277 (
"Mission name" text,
"Lunar lander" text,
"Lunar landing date" text,
"Lunar blastoff date" text,
"Lunar landing site" text,
"Duration on lunar surface" text,
"Crew" text,
"Number of s EVA" real,
"Total EVA Time (HH:MM)" text
) | Name the most number of s eva | SELECT MAX("Number of s EVA") FROM table_1277 |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a scatter chart about the correlation between Team_ID and ACC_Percent , and group by attribute All_Road. | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road |
CREATE TABLE table_name_66 (
runner_up VARCHAR,
champion VARCHAR,
year VARCHAR
) | Who was the runner-up, when the champion was Bj rn Borg after 1978? | SELECT runner_up FROM table_name_66 WHERE champion = "björn borg" AND year > 1978 |
CREATE TABLE stores (
store_id text,
address_id number,
marketing_region_code text,
store_name text,
store_phone text,
store_email_address text,
other_details text
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
workshop_group_id text,
status_code text,
... | What are the distinct payment method codes in all the invoices? | SELECT DISTINCT payment_method_code FROM invoices |
CREATE TABLE table_name_88 (
office VARCHAR,
democratic_ticket VARCHAR
) | Which Office has a Democratic ticket of herbert h. lehman? | SELECT office FROM table_name_88 WHERE democratic_ticket = "herbert h. lehman" |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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,
had... | tell me the top five most common diagnoses in patients in the age of 60 or above this year? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | Which class would be the easiest class for me to take to meet the ULCS requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... |
CREATE TABLE table_name_52 (
fcc_info VARCHAR,
facility_id VARCHAR,
frequency_mhz VARCHAR,
erp_w VARCHAR
) | What is the FCC info for the call sign with a frequency MHz of 101.3, a ERP W over 10, and a Facility ID smaller than 87027? | SELECT fcc_info FROM table_name_52 WHERE frequency_mhz = 101.3 AND erp_w > 10 AND facility_id < 87027 |
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
)
C... | count the number of patients whose year of birth is less than 2180 and procedure long title is arteriography of femoral and other lower extremity arteries? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2180" AND procedures.long_title = "Arteriography of femoral and other lower extremity arteries" |
CREATE TABLE table_66502 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." real,
"Release date" text
) | How many production numbers have a Title of bosko in dutch? | SELECT SUM("Production Num.") FROM table_66502 WHERE "Title" = 'bosko in dutch' |
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,
... | how many of the patients aged below 31 were treated with ns100? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.formulary_drug_cd = "NS100" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.