table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_74 (
round INTEGER,
selection VARCHAR
) | How many rounds had a selection of 165? | SELECT SUM(round) FROM table_name_74 WHERE selection = 165 |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | until 2102 what were the four most common lab tests? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) <= '2102' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 4) |
CREATE TABLE flight_fare (
flight_id int,
fare_id 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_required varchar
)
CREA... | i would like information on flights from SAN FRANCISCO to PITTSBURGH leaving after 2000 monday night | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... |
CREATE TABLE table_1473672_6 (
nationality VARCHAR,
player VARCHAR
) | What country did Derek Black come from? | SELECT nationality FROM table_1473672_6 WHERE player = "Derek Black" |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airli... | what is the ground transportation from BOS airport to BOSTON downtown | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor... |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 regions (
REGION_... | Does it have something interesting about the manager id and the salary? Show me a scatter chart first. | SELECT T1.SALARY, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID |
CREATE TABLE table_40442 (
"Year" real,
"Series" text,
"Winning team" text,
"Losing team" text,
"Score" text,
"Site" text
) | Where was the series that the Kansas City Royals lost? | SELECT "Site" FROM table_40442 WHERE "Winning team" = 'kansas city royals' |
CREATE TABLE table_name_78 (
rank INTEGER,
grid VARCHAR,
time_retired VARCHAR,
laps VARCHAR,
qual VARCHAR
) | What was the rank of the car who had more than 182 laps, gris less than 3, with a qual time of more than 134.14 and a time/retired of +14:21.72? | SELECT MIN(rank) FROM table_name_78 WHERE laps > 182 AND qual > 134.14 AND time_retired = "+14:21.72" AND grid < 3 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose diagnoses short title is hx of bladder malignancy and drug type is additive? | 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.short_title = "Hx of bladder malignancy" AND prescriptions.drug_type = "ADDITIVE" |
CREATE TABLE table_11792 (
"Name" text,
"Appointed/Elected" text,
"Term expires" text,
"Appointing Governor" text,
"Governor's Party Affiliation" text
) | Who has a term that expires on December 31, 2020 and Terry Branstad for an appointing governor? | SELECT "Name" FROM table_11792 WHERE "Term expires" = 'december 31, 2020' AND "Appointing Governor" = 'terry branstad' |
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_numb... | What are the different dorm amenity names in alphabetical order? | SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name |
CREATE TABLE table_14118521_1 (
edo_flight VARCHAR,
duration VARCHAR
) | what's the edo flight with duration being 17 days, 15 hours, 53 minutes, 18 seconds | SELECT edo_flight FROM table_14118521_1 WHERE duration = "17 days, 15 hours, 53 minutes, 18 seconds" |
CREATE TABLE table_15058 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
) | What school did Conor Jackson attend? | SELECT "School" FROM table_15058 WHERE "Player" = 'conor jackson' |
CREATE TABLE table_40203 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was the time for the bout against Amanda Lavoy, which went under 3 rounds? | SELECT "Time" FROM table_40203 WHERE "Round" < '3' AND "Opponent" = 'amanda lavoy' |
CREATE TABLE table_20594 (
"Western Title" text,
"Chinese Title" text,
"Pinyin" text,
"Released Date" text,
"Genre" text,
"Game Modes" text
) | What are the game modes for the game released in 2007? | SELECT "Game Modes" FROM table_20594 WHERE "Released Date" = '2007' |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | Median accept-rate excluding 0 and 100.. | WITH ByUser AS (SELECT OwnerUserId, CAST(COUNT(AcceptedAnswerId) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS AcceptRate FROM Posts AS p WHERE p.PostTypeId = 1 AND CommunityOwnedDate IS NULL AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = p.Id) GROUP BY OwnerUserId HAVING COUNT(*) >= 4), FirstStep AS (SELECT AcceptRate, ROW_... |
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
) | How many papers are written by authors from the institution 'University of Pennsylvania'? | SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania" |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
la... | A bar chart about how many songs were released for each format?, and list X in ascending order. | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats |
CREATE TABLE table_12441518_1 (
recurring_cast_seasons VARCHAR,
character VARCHAR
) | Kevin lucas appears in which seasons? | SELECT recurring_cast_seasons FROM table_12441518_1 WHERE character = "Kevin Lucas" |
CREATE TABLE table_8550 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Which Club has a Drawn of 0, and Points of 26? | SELECT "Club" FROM table_8550 WHERE "Drawn" = '0' AND "Points" = '26' |
CREATE TABLE table_10383 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | Name the record for bobcats | SELECT "Record" FROM table_10383 WHERE "Home" = 'bobcats' |
CREATE TABLE table_38322 (
"Event" text,
"Round" text,
"Result" text,
"Opponent" text,
"Score" text
) | The round that had the final, what was the result? | SELECT "Result" FROM table_38322 WHERE "Round" = 'final' |
CREATE TABLE table_71915 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is the winning total from 1976? | SELECT MAX("Total") FROM table_71915 WHERE "Year(s) won" = '1976' |
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 prescriptions... | give me the number of white-russian ethnic background patients who have base type drug prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug_type = "BASE" |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | Jon Ericson's 'voting currency' equation. https://hermeneutics.meta.stackexchange.com/questions/132/what-does-a-vote-mean-on-the-biblical-hermeneutics-stack-exchange#comment423_181
It seems to me that (very roughly) if you have reputation > 10*votes you are getting more 'voting currency' from the system than you are... | SELECT Id AS "user_link", Reputation, (10 * UpVotes) AS "10 * UpVotesCast", CAST(10 * UpVotes AS FLOAT) / Reputation AS ratio FROM Users WHERE Reputation > 1 ORDER BY ratio DESC LIMIT 200000000 |
CREATE TABLE table_22049 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1988-89" text,
"1989-90" text,
"1990-1991" real
) | What was the average if the game played during 1990-91 is 40 and the points are less than 121.0? | SELECT "Average" FROM table_22049 WHERE "1990-1991" = '40' AND "Points" < '121.0' |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
... | how many hours have been elapsed since patient 27172 was admitted to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL |
CREATE TABLE table_28436909_4 (
canadian_chapters VARCHAR,
founding_date VARCHAR
) | When 1872-10-10 is the founding date what are the canadian chapters? | SELECT canadian_chapters FROM table_28436909_4 WHERE founding_date = "1872-10-10" |
CREATE TABLE table_67466 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points Classification" text,
"Team Classification" text
) | Name the stgae with winner of robbie mcewen | SELECT "Stage" FROM table_67466 WHERE "Winner" = 'robbie mcewen' |
CREATE TABLE table_29570 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real,
"Decision" text
) | How many times did they play the pittsburgh penguins? | SELECT COUNT("March") FROM table_29570 WHERE "Opponent" = 'Pittsburgh Penguins' |
CREATE TABLE table_36949 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | How many Weeks are on september 8, 1980 and Attendances larger than 55,045? Question 4 | SELECT COUNT("Week") FROM table_36949 WHERE "Date" = 'september 8, 1980' AND "Attendance" > '55,045' |
CREATE TABLE table_name_52 (
network VARCHAR,
call_sign VARCHAR,
virtual_channel VARCHAR
) | Call sign of k33ln-ld, and a Virtual channel of 33.5 is what network? | SELECT network FROM table_name_52 WHERE call_sign = "k33ln-ld" AND virtual_channel = "33.5" |
CREATE TABLE table_name_62 (
round VARCHAR,
player VARCHAR,
pick VARCHAR
) | What is the total number of rounds that had draft pick 97, duncan mccoll? | SELECT COUNT(round) FROM table_name_62 WHERE player = "duncan mccoll" AND pick < 97 |
CREATE TABLE table_11839306_2 (
track VARCHAR,
rōmaji_title VARCHAR
) | How many tracks are titled M Sukoshi T ku? | SELECT COUNT(track) FROM table_11839306_2 WHERE rōmaji_title = "Mō Sukoshi Tōku" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | provide the number of patients whose days of hospital stay is greater than 16 and drug name is sw? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.drug = "SW" |
CREATE TABLE table_name_3 (
fleet_size INTEGER,
type VARCHAR,
introduced VARCHAR
) | What is the average fleet size for the Shunter type introduced in 1959? | SELECT AVG(fleet_size) FROM table_name_3 WHERE type = "shunter" AND introduced = "1959" |
CREATE TABLE table_17402 (
"Vendor and type" text,
"Models" text,
"NetFlow Version" text,
"Implementation" text,
"Comments" text
) | How many netflow version are there when the vendor and type is enterasys switches? | SELECT COUNT("NetFlow Version") FROM table_17402 WHERE "Vendor and type" = 'Enterasys Switches' |
CREATE TABLE table_16456 (
"Team" text,
"Location" text,
"Joined" real,
"Conference" text,
"Division" text,
"Previous Conference" text
) | What conference was the churchill chargers team in? | SELECT "Conference" FROM table_16456 WHERE "Team" = 'Churchill Chargers' |
CREATE TABLE table_1220125_4 (
pennant VARCHAR,
laid_down VARCHAR
) | What is the pennant for 4 may 1943? | SELECT pennant FROM table_1220125_4 WHERE laid_down = "4 May 1943" |
CREATE TABLE table_27723228_12 (
score VARCHAR,
team VARCHAR
) | Name the score for indiana | SELECT score FROM table_27723228_12 WHERE team = "Indiana" |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | all the questions with jira in the title and tag. | SELECT Id AS "post_link", Title, Body, Tags FROM Posts WHERE Tags LIKE '%jira%' OR Title LIKE '%JIRA%' |
CREATE TABLE table_name_95 (
county VARCHAR,
size VARCHAR,
mascot VARCHAR
) | Which County has a Size larger than 258, and a Mascot of commodores? | SELECT county FROM table_name_95 WHERE size > 258 AND mascot = "commodores" |
CREATE TABLE table_name_93 (
record VARCHAR,
opponent VARCHAR
) | Which Record has an Opponent of milwaukee bucks? | SELECT record FROM table_name_93 WHERE opponent = "milwaukee bucks" |
CREATE TABLE table_204_13 (
id number,
"finished" text,
"post" number,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | what is the name of the trainer of the first place horse ? | SELECT "trainer" FROM table_204_13 WHERE "finished" = 1 |
CREATE TABLE table_name_15 (
Id VARCHAR
) | Who attended the school in 2008, that Deandria Hill attended in 2005? | SELECT 2008 FROM table_name_15 WHERE 2005 = "deandria hill" |
CREATE TABLE table_13762472_4 (
high_rebounds VARCHAR,
score VARCHAR
) | who had high rebounds when score is w 111 92 (ot) | SELECT high_rebounds FROM table_13762472_4 WHERE score = "W 111–92 (OT)" |
CREATE TABLE table_name_92 (
played INTEGER,
against VARCHAR,
points VARCHAR
) | Which Played is the highest one that has an Against smaller than 18, and Points smaller than 10? | SELECT MAX(played) FROM table_name_92 WHERE against < 18 AND points < 10 |
CREATE TABLE table_58529 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team when the venue was Lake Oval? | SELECT "Away team" FROM table_58529 WHERE "Venue" = 'lake oval' |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the five most frequent output event during a year before? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS... |
CREATE TABLE table_60771 (
"Date" text,
"Nationality / Opponent" text,
"Ground" text,
"Result" text,
"Competition" text
) | Name the Date has a Competition of welsh rugby union challenge trophy and a Result of 34-34? Question 1 | SELECT "Date" FROM table_60771 WHERE "Competition" = 'welsh rugby union challenge trophy' AND "Result" = '34-34' |
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Customer_Event_Notes (
Customer_Event_Note_ID INTEGER,
Customer_Event_ID INTEGER,
service_type_code CHAR(15),
resident_id INTEGER,
property_id INTEGER,
... | What are the distinct move in dates of the residents, and count them by a bar chart, and list by the Y in desc. | SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) DESC |
CREATE TABLE table_name_99 (
netflix VARCHAR,
segment_b VARCHAR
) | Segment B of aerospace fuel lines is what netflix episode? | SELECT netflix FROM table_name_99 WHERE segment_b = "aerospace fuel lines" |
CREATE TABLE table_46241 (
"School" text,
"Location" text,
"Founded" real,
"Enrollment" real,
"Nickname" text
) | What is the most recent year founded that has a nickname of bruins? | SELECT MAX("Founded") FROM table_46241 WHERE "Nickname" = 'bruins' |
CREATE TABLE table_51760 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | what is the year that the position was 1st in paris? | SELECT "Year" FROM table_51760 WHERE "Position" = '1st' AND "Venue" = 'paris' |
CREATE TABLE table_40842 (
"Western Title" text,
"Chinese Title" text,
"Pinyin" text,
"Released Date" text,
"Genre" text,
"Game Modes" text
) | What is the release date for the Chinese title ? | SELECT "Released Date" FROM table_40842 WHERE "Chinese Title" = '摸摸瓦力欧制造' |
CREATE TABLE table_name_2 (
score VARCHAR,
date VARCHAR
) | What was the score on March 23? | SELECT score FROM table_name_2 WHERE date = "march 23" |
CREATE TABLE table_67252 (
"Institution" text,
"Location" text,
"Nickname" text,
"Current Conference" text,
"Classification" text
) | The River Hawks belonged to what current conference? | SELECT "Current Conference" FROM table_67252 WHERE "Nickname" = 'river hawks' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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,
insuranc... | what was the first id of patient 1457's ward the last year? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1457) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime LIMIT 1 |
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 the number of patients whose days of hospital stay is greater than 16 and procedure long title is continuous intra-arterial blood gas monitoring? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "16" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring" |
CREATE TABLE table_9372 (
"Year" text,
"Starts" real,
"Wins" real,
"Top Fives" real,
"Top Tens" real,
"Poles" real,
"Rank" text
) | What is the total number of top fives when casey mears had more than 1 poles and top tens less than 9? | SELECT SUM("Top Fives") FROM table_9372 WHERE "Poles" > '1' AND "Top Tens" < '9' |
CREATE TABLE table_8599 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
) | What club had a points difference of -24? | SELECT "Club" FROM table_8599 WHERE "Points difference" = '-24' |
CREATE TABLE table_18048 (
"Incumbent" text,
"Reason for Vacancy" text,
"Appointed Successor" text,
"Date of Appointment" text,
"Elected Successor" text,
"Date of Election" text
) | What was the election date for H. Brent Coles? | SELECT "Date of Election" FROM table_18048 WHERE "Appointed Successor" = 'H. Brent Coles' |
CREATE TABLE table_name_63 (
eliminated_by VARCHAR,
wrestler VARCHAR
) | Who Eliminated Kane? | SELECT eliminated_by FROM table_name_63 WHERE wrestler = "kane" |
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,... | Show how many courses in 2008 for every instructor with a bar chart, display Y-axis from high to low order. | SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY COUNT(name) DESC |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_cours... | In the Fall can I take SOC 370 ? | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... |
CREATE TABLE table_name_35 (
years VARCHAR,
displacement VARCHAR
) | what is the years for the displacement 4.0l (242cid)? | SELECT years FROM table_name_35 WHERE displacement = "4.0l (242cid)" |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | had patient 016-27397 had any chest tube output: mediastinal l anterior output during this hospital encounter? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397' AND patient.hospitaldischargetime IS NULL)) AND intakeoutpu... |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what is the minimum number of yearly diagnosed cases of abdom aortic aneurysm? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abdom aortic aneurysm') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1 |
CREATE TABLE table_200_1 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | what year was the film polio water released ? | SELECT "year" FROM table_200_1 WHERE "title" = 'polio water' |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TAB... | Selecting closed opinion-based questions on SO. | SELECT p.Id AS "post_link", p.Score FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id INNER JOIN CloseReasonTypes AS crt ON crt.Id = CAST(ph.Comment AS INT) INNER JOIN PostTags ON PostTags.PostId = p.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('elm') AND ph.PostHistoryTypeId = 1... |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
... | Find the number of students who is older than 20 in each dorm. | SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name |
CREATE TABLE table_33519 (
"Year" real,
"Player" text,
"Nationality" text,
"Position" text,
"Team" text
) | What nationality has a year larger than 2009 with a position of power forward? | SELECT "Nationality" FROM table_33519 WHERE "Year" > '2009' AND "Position" = 'power forward' |
CREATE TABLE table_name_10 (
crowd VARCHAR,
home_team VARCHAR
) | How large was the crowd at Carlton's home game? | SELECT COUNT(crowd) FROM table_name_10 WHERE home_team = "carlton" |
CREATE TABLE table_52278 (
"Years" text,
"Winners" text,
"Runners-Up" text,
"Score" text,
"Third" text
) | Who was the winner in the competition in which the runner-up was Rosenborg? | SELECT "Winners" FROM table_52278 WHERE "Runners-Up" = 'rosenborg' |
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers real,
Domestic_Passengers real,
Transit_Passengers real,
Aircraft_Movements real,
Freight_Metric_Tonnes real
)
CREATE TABLE aircraft (
Aircraft_ID int(11... | For each aircraft that has won an award, what is its name and how many time has it won Plot them as bar chart, show in desc by the X-axis please. | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft DESC |
CREATE TABLE table_1939214_1 (
year VARCHAR,
league VARCHAR,
regular_season VARCHAR
) | In what year did the team compete in the 2nd, Northeast season of the USL PDL League? | SELECT year FROM table_1939214_1 WHERE league = "USL PDL" AND regular_season = "2nd, Northeast" |
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... | how many patients whose gender is f and diagnoses long title is acute diastolic heart failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Acute diastolic heart failure" |
CREATE TABLE table_name_47 (
player VARCHAR,
to_par VARCHAR
) | What is the Player that has a To standard of 7? | SELECT player FROM table_name_47 WHERE to_par = "–7" |
CREATE TABLE table_18294 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the party with dbeingtrict being massachusetts 3 | SELECT "Party" FROM table_18294 WHERE "District" = 'Massachusetts 3' |
CREATE TABLE table_64109 (
"Date Released" text,
"Polling institute" text,
"Socialist" text,
"Social Democratic" text,
"Green-Communist" text,
"People's Party" text,
"Left Bloc" text,
"Lead" text
) | What is the social democrat released on October 10, 1999? | SELECT "Social Democratic" FROM table_64109 WHERE "Date Released" = 'october 10, 1999' |
CREATE TABLE table_24307 (
"Competition" text,
"Round" text,
"Opponent" text,
"Result" text,
"Score" text,
"Home/Away" text,
"Venue" text,
"Attendance" text,
"Date" text
) | What is the result of the qf round? | SELECT "Result" FROM table_24307 WHERE "Round" = 'QF' |
CREATE TABLE table_name_40 (
year INTEGER,
position VARCHAR,
event VARCHAR
) | Name the sum of year for 2nd position for junior race | SELECT SUM(year) FROM table_name_40 WHERE position = "2nd" AND event = "junior race" |
CREATE TABLE table_45767 (
"Rank" real,
"Name" text,
"Country" text,
"Wins" real,
"Years" text
) | Which Country has Wins larger than 2, and a Rank of 2, and a Name of federico bahamontes? | SELECT "Country" FROM table_45767 WHERE "Wins" > '2' AND "Rank" = '2' AND "Name" = 'federico bahamontes' |
CREATE TABLE table_11265 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | with a record of 66-78 what was the loss? | SELECT "Loss" FROM table_11265 WHERE "Record" = '66-78' |
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),
... | For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, and display by the the average of manager id in asc please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) |
CREATE TABLE table_70153 (
"Surface" text,
"Event" text,
"Time ( h : m : s )" text,
"Date" text,
"Place" text
) | What is the Date that has 1:01:42? | SELECT "Date" FROM table_70153 WHERE "Time ( h : m : s )" = '1:01:42' |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | what are the five most frequently performed procedures for a patient who was previously diagnosed with enterostomy status nec in the same month until 2101? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... |
CREATE TABLE table_64291 (
"Year" real,
"Political Rights" real,
"Civil Liberties" real,
"Status" text,
"President" text
) | When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties? | SELECT SUM("Civil Liberties") FROM table_64291 WHERE "Political Rights" = '6' AND "President" = 'yoweri museveni' AND "Year" = '1993' |
CREATE TABLE table_46965 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high rebounds in Philips Arena 12,088? | SELECT "High rebounds" FROM table_46965 WHERE "Location Attendance" = 'philips arena 12,088' |
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
category text,
result text
)
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_... | What are the titles, years, and directors of all movies, ordered by budget in millions? | SELECT title, year, director FROM movie ORDER BY budget_million |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
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,... | on 04/22/2105 the heart rate of patient 6580 was ever less than 86.0? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6580)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_... |
CREATE TABLE table_name_6 (
round INTEGER,
location VARCHAR,
method VARCHAR
) | Can you tell me the lowest Round that has the Location of indiana, united states, and the Method of submission (guillotine choke)? | SELECT MIN(round) FROM table_name_6 WHERE location = "indiana, united states" AND method = "submission (guillotine choke)" |
CREATE TABLE table_11734041_2 (
years_for_rockets VARCHAR,
school_club_team_country VARCHAR
) | What years did the player from LaSalle play for the Rockets? | SELECT years_for_rockets FROM table_11734041_2 WHERE school_club_team_country = "LaSalle" |
CREATE TABLE table_26132 (
"Election Year" real,
"Assembly" text,
"Winning Party/Coalition" text,
"Chief Minister" text,
"Speaker" text
) | If the assembly is the sixth assembly, what is the maximum election year? | SELECT MAX("Election Year") FROM table_26132 WHERE "Assembly" = 'Sixth Assembly' |
CREATE TABLE table_68205 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2? | SELECT MIN("Lane") FROM table_68205 WHERE "Heat" > '2' AND "Time" = '1:10.57' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what is the monthly average emesis output that patient 015-23047 has had since 12/27/2105? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.celllabel = 'emesi... |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
... | Find the number of courses offered by Psychology department in each building with a bar chart, could you sort from high to low by the names? | SELECT building, COUNT(building) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY building ORDER BY building DESC |
CREATE TABLE table_name_47 (
loss VARCHAR,
opponent VARCHAR,
date VARCHAR
) | Which loss has an Opponent of @ angels, and a Date of august 1? | SELECT loss FROM table_name_47 WHERE opponent = "@ angels" AND date = "august 1" |
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,... | count the number of times in which patient 18866 had had a pe 24 fs po intake today. | SELECT COUNT(*) 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 = 18866)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pe 24 fs po'... |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_I... | Give me the number of the descriptions of the service types that cost more than 100. | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.