table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
) | What are the names of the climbers, ordered by points descending? | SELECT name FROM climber ORDER BY points DESC |
CREATE TABLE table_name_67 (
country VARCHAR,
event VARCHAR
) | What is Country, when Event is Rip Curl Women's Pro? | SELECT country FROM table_name_67 WHERE event = "rip curl women's pro" |
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... | give me the number of patients whose admission year is less than 2178 and drug route is neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2178" AND prescriptions.route = "NEB" |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
) | Count the number of climbers. | SELECT COUNT(*) FROM climber |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Which professor is teaching ULCS classes next Winter ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... |
CREATE TABLE table_name_87 (
season VARCHAR,
player_of_the_year VARCHAR
) | For which season is Tim Mikkelson player of the year? | SELECT season FROM table_name_87 WHERE player_of_the_year = "tim mikkelson" |
CREATE TABLE table_61545 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
) | What is the Position, when Player is 'Magnus Nygren'? | SELECT "Position" FROM table_61545 WHERE "Player" = 'magnus nygren' |
CREATE TABLE table_203_387 (
id number,
"parish est" number,
"church" text,
"city" text,
"current bldg begun" number,
"weekly collections" text,
"notes" number
) | how many different cities are the listed churches in ? | SELECT COUNT(DISTINCT "city") FROM table_203_387 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is the number of patients less than 82 years who underwent procedure with short title endosc destruc esoph les? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "82" AND procedures.short_title = "Endosc destruc esoph les" |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | What are the number of the titles of all movies that have rating star is between 3 and 5?, could you rank y-axis in ascending order? | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY COUNT(title) |
CREATE TABLE table_1134091_4 (
vacator VARCHAR,
date_successor_seated VARCHAR
) | Who was the vacator when the date successor seated was august 21, 1973? | SELECT vacator FROM table_1134091_4 WHERE date_successor_seated = "August 21, 1973" |
CREATE TABLE table_65272 (
"Position" text,
"Name" text,
"Year at CU" text,
"Experience" real,
"Alma Mater" text
) | What year at CU is the person in video services with an experience less than 1? | SELECT "Year at CU" FROM table_65272 WHERE "Experience" < '1' AND "Position" = 'video services' |
CREATE TABLE table_75363 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many Points have a January of 18? | SELECT COUNT("Points") FROM table_75363 WHERE "January" = '18' |
CREATE TABLE table_42645 (
"Date" text,
"Location" text,
"Country" text,
"Event" text,
"Winner" text,
"Runner-up" text
) | Who was the Winner of the French Polynesia Billabong Pro Event? | SELECT "Winner" FROM table_42645 WHERE "Event" = 'billabong pro' AND "Country" = 'french polynesia' |
CREATE TABLE table_27616 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | On what game sites are there where the team record is 0 5? | SELECT "Game site" FROM table_27616 WHERE "Team record" = '0–5' |
CREATE TABLE table_44926 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was the Score for T9 United States Player Kirk Triplett? | SELECT "Score" FROM table_44926 WHERE "Place" = 't9' AND "Country" = 'united states' AND "Player" = 'kirk triplett' |
CREATE TABLE detention (
detention_id number,
detention_type_code text,
teacher_id number,
datetime_detention_start time,
datetime_detention_end time,
detention_summary text,
other_details text
)
CREATE TABLE ref_detention_type (
detention_type_code text,
detention_type_description ... | What is the incident type description for the incident type with code 'VIOLENCE'? | SELECT incident_type_description FROM ref_incident_type WHERE incident_type_code = "VIOLENCE" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | has patient 016-6009 received any medication during the previous month? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009')) AND DATETIME(medication.drugstarttime, 'start of month') = DAT... |
CREATE TABLE table_name_4 (
rebounds INTEGER,
minutes_played VARCHAR,
games_played VARCHAR
) | What is the average Rebounds, when Minutes Played is '113', and when Games Played is greater than '18'? | SELECT AVG(rebounds) FROM table_name_4 WHERE minutes_played = 113 AND games_played > 18 |
CREATE TABLE table_name_19 (
school_year VARCHAR,
cross_country VARCHAR
) | What is School Year, when Cross Country is Wooster? | SELECT school_year FROM table_name_19 WHERE cross_country = "wooster" |
CREATE TABLE table_name_23 (
losses INTEGER,
goals_for INTEGER
) | What is the average losses for 22 goals? | SELECT AVG(losses) FROM table_name_23 WHERE goals_for > 22 |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | Simple search for answers that may have useful comments. | SELECT a.Id AS "post_link", a.Score, COUNT(c.Id) AS "comment_count" FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags ON Tags.Id = pt.TagId INNER JOIN Posts AS a ON q.Id = a.ParentId INNER JOIN Comments AS c ON c.PostId = a.Id WHERE Tags.TagName LIKE '##tag:string##' AND a.Score > 1 AND c.Sc... |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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),
... | Group and count the job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN for visualizing a bar chart. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY < (SELECT MIN(SALARY) FROM employees WHERE JOB_ID = 'MK_MAN') GROUP BY JOB_ID |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | i'd like to see flights from BALTIMORE to ATLANTA | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLA... |
CREATE TABLE table_name_19 (
gold INTEGER,
bronze VARCHAR,
total VARCHAR,
nation VARCHAR
) | What is the average number of gold medals won by Brazil for entries with more than 1 bronze medal but a total smaller than 4? | SELECT AVG(gold) FROM table_name_19 WHERE total < 4 AND nation = "brazil" AND bronze > 1 |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | Bin the installation date into Year interval, and then you can draw a bar chart to tell me how many stations each year. | SELECT installation_date, COUNT(installation_date) FROM station |
CREATE TABLE table_12709 (
"Year" real,
"Championship" text,
"Partnering" text,
"Opponents in Final" text,
"Score in Final" text
) | What was the score when the Shingo Kunieda Satoshi Saida were the opponents? | SELECT "Score in Final" FROM table_12709 WHERE "Opponents in Final" = 'shingo kunieda satoshi saida' |
CREATE TABLE table_31380 (
"Value" text,
"Dimensions" text,
"Main Color" text,
"Obverse" text,
"Reverse" text,
"Watermark" text,
"Date of issue" text
) | What are the dimensions of the coin worth 200? | SELECT "Dimensions" FROM table_31380 WHERE "Value" = '₩200' |
CREATE TABLE table_2553 (
"Team" text,
"Outgoing manager(s)" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Replaced by" text,
"Date of appointment" text
) | What was the date of appointment for the 10th person in position? | SELECT "Date of appointment" FROM table_2553 WHERE "Position in table" = '10th' |
CREATE TABLE table_200_0 (
id number,
"year" number,
"title" text,
"chart-positions\nuk" number,
"chart-positions\nus" number,
"chart-positions\nnl" number,
"comments" text
) | what was the earliest album ? | SELECT "title" FROM table_200_0 ORDER BY "year" LIMIT 1 |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Show me the total number by grape in a histogram | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape |
CREATE TABLE table_name_34 (
total INTEGER,
rank VARCHAR,
gold VARCHAR
) | What is the lowest total when the rank is 14 and the gold medals is larger than 0? | SELECT MIN(total) FROM table_name_34 WHERE rank = "14" AND gold > 0 |
CREATE TABLE table_29162856_1 (
fastest_lap VARCHAR,
round VARCHAR
) | Who had the fastest lap in round 1? | SELECT fastest_lap FROM table_29162856_1 WHERE round = 1 |
CREATE TABLE table_name_8 (
bronze VARCHAR,
gold INTEGER
) | How many bronze medals for the nation with over 9 golds? | SELECT COUNT(bronze) FROM table_name_8 WHERE gold > 9 |
CREATE TABLE table_30020 (
"Series #" real,
"Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What is the title of episode number 9-10? | SELECT "Title" FROM table_30020 WHERE "Episode #" = '9-10' |
CREATE TABLE table_34492 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the highest round of Tommy Allman, who had a pick less than 40? | SELECT MAX("Round") FROM table_34492 WHERE "Player" = 'tommy allman' AND "Pick" < '40' |
CREATE TABLE table_54017 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where does Carlton play? | SELECT "Venue" FROM table_54017 WHERE "Home team" = 'carlton' |
CREATE TABLE table_18207285_2 (
opponents INTEGER,
result VARCHAR,
game VARCHAR
) | How many opponents played 1 game with a result win? | SELECT MAX(opponents) FROM table_18207285_2 WHERE result = "Win" AND game = 1 |
CREATE TABLE table_64651 (
"Rank" real,
"Name" text,
"Status" text,
"City" text,
"Floors" real
) | What is the lowest number of floors for the number 2 ranked Joyus Housing? | SELECT MIN("Floors") FROM table_64651 WHERE "Name" = 'joyus housing' AND "Rank" < '2' |
CREATE TABLE table_63835 (
"Model" text,
"Engine" text,
"Displacement" text,
"Valvetrain" text,
"Fuel system" text,
"Max. power at rpm" text,
"Max. torque at rpm" text,
"Years" text
) | What fuel system does the diesel engines model have? | SELECT "Fuel system" FROM table_63835 WHERE "Model" = 'diesel engines' |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | Create a bar chart showing the total number across party, sort bars in descending order. | SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY Party DESC |
CREATE TABLE table_43925 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest bronze value with silvers over 2, golds under 16, and in Cycling? | SELECT MAX("Bronze") FROM table_43925 WHERE "Silver" > '2' AND "Sport" = 'cycling' AND "Gold" < '16' |
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 employees (
EMPLO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the average of salary bin hire_date by time in a bar chart, display by the y-axis in ascending. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) |
CREATE TABLE table_1342379_41 (
district VARCHAR,
incumbent VARCHAR
) | What district does edward everett eslick represent? | SELECT district FROM table_1342379_41 WHERE incumbent = "Edward Everett Eslick" |
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 demographic (... | give me the number of patients whose gender is f and days of hospital stay is greater than 5? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "5" |
CREATE TABLE table_name_31 (
country VARCHAR,
player VARCHAR
) | What is the Country that has a Player of Scott Hoch? | SELECT country FROM table_name_31 WHERE player = "scott hoch" |
CREATE TABLE table_77050 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
) | What is the stadium of the NK Zagreb? | SELECT "Stadium" FROM table_77050 WHERE "Team" = 'nk zagreb' |
CREATE TABLE table_name_89 (
segment_a VARCHAR,
netflix VARCHAR
) | Name the segment A for netflix of s05e01 | SELECT segment_a FROM table_name_89 WHERE netflix = "s05e01" |
CREATE TABLE table_203_222 (
id number,
"category" text,
"#" number,
"name" text,
"hanzi" text,
"hanyu pinyin" text,
"population (2010 census)" number,
"area (km2)" number,
"density (/km2)" number
) | which area is the least dense ? | SELECT "name" FROM table_203_222 ORDER BY "density (/km2)" LIMIT 1 |
CREATE TABLE table_73283 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | How many episodes have Valerie? | SELECT COUNT("Episode Summary") FROM table_73283 WHERE "Coach" = 'Valerie' |
CREATE TABLE table_55892 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | What is the date of the game played at rich stadium? | SELECT "Date" FROM table_55892 WHERE "Game site" = 'rich stadium' |
CREATE TABLE table_51060 (
"Year" real,
"Beer Name" text,
"Prize" text,
"Category" text,
"Competition" text
) | What beer won a silver medal at the camra reading branch beer festival in 2008? | SELECT "Beer Name" FROM table_51060 WHERE "Prize" = 'silver medal' AND "Competition" = 'camra reading branch beer festival' AND "Year" = '2008' |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
... | did patient 26793 have 0.9% sodium chloride prescribed in 2105? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26793) AND prescriptions.drug = '0.9% sodium chloride' AND STRFTIME('%y', prescriptions.startdate) = '2105' |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | Top 50 users from Dehradun. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%dehradun%' OR UPPER(Location) LIKE '%DEHRADUN' ORDER BY Reputation DESC LIMIT 50 |
CREATE TABLE table_8466 (
"Name" text,
"Type" text,
"Nationality" text,
"Date" text,
"Displacement" text
) | what is the name when the displacement is 8,305 t? | SELECT "Name" FROM table_8466 WHERE "Displacement" = '8,305 t' |
CREATE TABLE table_name_38 (
alternate VARCHAR,
second VARCHAR
) | Who is the alternate for Magnus Swartling as Second? | SELECT alternate FROM table_name_38 WHERE second = "magnus swartling" |
CREATE TABLE table_32802 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the largest crowd for a Melbourne away team? | SELECT MAX("Crowd") FROM table_32802 WHERE "Away team" = 'melbourne' |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst t... | which pesticides are most used? | SELECT pestcode FROM resultsdata15 GROUP BY pestcode ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_name_47 (
nationality VARCHAR,
position VARCHAR,
school_club_team VARCHAR
) | What is the nationality for the guard position from Bowling Green? | SELECT nationality FROM table_name_47 WHERE position = "guard" AND school_club_team = "bowling green" |
CREATE TABLE table_43700 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Mark Begich" text,
"Republican: Ted Stevens" text,
"Lead Maragin" real
) | What was the average lead maragin for the dates administered of october 6, 2008? | SELECT AVG("Lead Maragin") FROM table_43700 WHERE "Dates administered" = 'october 6, 2008' |
CREATE TABLE table_name_59 (
co_drivers VARCHAR,
team VARCHAR,
year VARCHAR
) | Who was the co-driver for Toyota Racing after the year 2012? | SELECT co_drivers FROM table_name_59 WHERE team = "toyota racing" AND year > 2012 |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | When my Suggested Edit decisions were reversed. | SELECT SE.PostId AS "post_link", V.Name AS "vote_type", SE.ApprovalDate, SE.RejectionDate FROM SuggestedEditVotes AS SEV INNER JOIN SuggestedEdits AS SE ON SEV.SuggestedEditId = SE.Id INNER JOIN VoteTypes AS V ON V.Id = SEV.VoteTypeId WHERE SEV.UserId = @UserId AND ((SEV.VoteTypeId = 2 AND NOT RejectionDate IS NULL) OR... |
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 gender of subject name estrella carroll? | SELECT demographic.gender FROM demographic WHERE demographic.name = "Estrella Carroll" |
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 treatment (
treat... | how many hours have passed since patient 006-158338 stayed in the current hospital visit in the ward 413 for the first time? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-158338' AND patient.wardid = 413 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
CREATE TABLE table_26335424_86 (
semifinals VARCHAR,
round_of_16 VARCHAR
) | If the round of 16 was yulius fernando ( ina ) l pts 5-6, what was the semifinals? | SELECT semifinals FROM table_26335424_86 WHERE round_of_16 = "Yulius Fernando ( INA ) L PTS 5-6" |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight_fare ... | give me flights from DENVER to BALTIMORE | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | I'm trying to find a specific answer. | SELECT Id AS "post_link" FROM Posts WHERE Score = -3 AND Body LIKE '%handle%xml%' AND PostTypeId = 2 ORDER BY Id DESC |
CREATE TABLE table_2394927_1 (
power___dbm__ VARCHAR,
profile VARCHAR
) | List all dbm's when profiles are 8a. | SELECT power___dbm__ FROM table_2394927_1 WHERE profile = "8a" |
CREATE TABLE table_203_430 (
id number,
"draw" number,
"artist" text,
"song" text,
"jury" number,
"televote" number,
"total" number,
"place" number
) | who had the most televotes on the eurovision song contest 2008 ? | SELECT "artist" FROM table_203_430 ORDER BY "televote" DESC LIMIT 1 |
CREATE TABLE table_47963 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which Notre Dame position has a pick lower than 5 and round 7? | SELECT "Position" FROM table_47963 WHERE "Pick" < '5' AND "College" = 'notre dame' AND "Round" = '7' |
CREATE TABLE store_product (
Store_ID int,
Product_ID int
)
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE store (
Store_ID ... | How many stores are headquarted in each city Plot them as bar chart, and show in descending by the y axis please. | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY COUNT(*) DESC |
CREATE TABLE table_3989 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What episode number in the series is 'the drum major'? | SELECT "No. in series" FROM table_3989 WHERE "Title" = 'The Drum Major' |
CREATE TABLE table_15024 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Name the women's doubles for mixed doubles of no competition | SELECT "Women's doubles" FROM table_15024 WHERE "Mixed doubles" = 'no competition' |
CREATE TABLE table_name_94 (
engine VARCHAR,
driver VARCHAR,
team VARCHAR,
chassis VARCHAR
) | What type of engine does the BF Racing Marron Excavations have that also has Monaco as chassis and Lee Filliponi as the driver? | SELECT engine FROM table_name_94 WHERE team = "bf racing marron excavations" AND chassis = "monaco" AND driver = "lee filliponi" |
CREATE TABLE table_46976 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | In what Year was the Result of the game 16-14? | SELECT MAX("Year") FROM table_46976 WHERE "Result" = '16-14' |
CREATE TABLE procedures (
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
)
... | how many patients are diagnosed with complete heart block and are born beforre 2200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dob_year < "2200" |
CREATE TABLE table_47174 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What To par was won in 1982? | SELECT "To par" FROM table_47174 WHERE "Year(s) won" = '1982' |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
... | what is the seating capacity of an M80 | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' |
CREATE TABLE table_10484 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the grid total for alain prost with over 14 laps? | SELECT SUM("Grid") FROM table_10484 WHERE "Laps" > '14' AND "Driver" = 'alain prost' |
CREATE TABLE table_24906653_5 (
steals VARCHAR,
blocks VARCHAR
) | List the number of takeaways with 1 rejection. | SELECT COUNT(steals) FROM table_24906653_5 WHERE blocks = 1 |
CREATE TABLE table_20916 (
"Central Forest Reserve" text,
"Size in km\u00b2" real,
"Total plant species" real,
"Tree species" real,
"Endemic" real,
"Threatened (CR,VU,EN)" real
) | How many tree species are in the kitechura reserve? | SELECT "Tree species" FROM table_20916 WHERE "Central Forest Reserve" = 'Kitechura' |
CREATE TABLE table_6035 (
"Year" real,
"Group" text,
"Award" text,
"Film/Series" text,
"Result" text
) | What is the highest year that Kim was nominated for Over the Rainbow? | SELECT MAX("Year") FROM table_6035 WHERE "Film/Series" = 'over the rainbow' |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | have patient 10855 been tested for absolute cd4 count since 2105? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute cd4 count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND STRFTIME('%y', labevents.charttime) >= '2105' |
CREATE TABLE head (
age VARCHAR,
head_id VARCHAR
)
CREATE TABLE management (
head_id VARCHAR,
temporary_acting VARCHAR
) | What are the distinct ages of the heads who are acting? | SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes' |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | How many 3k users there are. | SELECT COUNT(Id) FROM Users WHERE Reputation > 15 AND Reputation < 3000 |
CREATE TABLE table_25594271_2 (
loa__metres_ VARCHAR,
yacht VARCHAR
) | What were the LOA metres for the yacht ichi ban? | SELECT loa__metres_ FROM table_25594271_2 WHERE yacht = "Ichi Ban" |
CREATE TABLE table_19897896_7 (
class VARCHAR,
university VARCHAR
) | in which class was the ohio state university | SELECT class FROM table_19897896_7 WHERE university = "Ohio state" |
CREATE TABLE procedures (
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
)
... | give me the number of patients with diagnoses icd9 code 59654 who were hospitalized for more than 6 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "6" AND diagnoses.icd9_code = "59654" |
CREATE TABLE table_18677 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result of the election in the Arkansas 2 district? | SELECT "Result" FROM table_18677 WHERE "District" = 'Arkansas 2' |
CREATE TABLE table_60673 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the T4 Place Player with a Score of 71-74-66=211? | SELECT "Player" FROM table_60673 WHERE "Place" = 't4' AND "Score" = '71-74-66=211' |
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,
... | what is the number of patients whose marital status is divorced and ethnicity is black/haitian? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "BLACK/HAITIAN" |
CREATE TABLE table_name_86 (
method VARCHAR,
time VARCHAR,
round VARCHAR
) | What is the method when the time was 5:00, and the round higher than 4? | SELECT method FROM table_name_86 WHERE time = "5:00" AND round > 4 |
CREATE TABLE participants_in_Events (
participant_id VARCHAR
) | What are all the distinct participant ids who attended any events? | SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events |
CREATE TABLE table_22034 (
"Romanised name" text,
"Chinese name" text,
"age at appointment" real,
"Foreign nationality" text,
"Portfolio attachment" text,
"Prior occupation" text,
"Govt salary" text
) | The name cheung, raymond man-to is listed as a romanised name is cheung, raymond man-to? | SELECT "Foreign nationality" FROM table_22034 WHERE "Romanised name" = 'Cheung, Raymond Man-to' |
CREATE TABLE table_56185 (
"Book title" text,
"Author" text,
"Edition/Publisher" text,
"Page count" text,
"Page size" text,
"Language" text
) | Which author wrote Sironia, Texas in English? | SELECT "Author" FROM table_56185 WHERE "Language" = 'english' AND "Book title" = 'sironia, texas' |
CREATE TABLE table_18555 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What party does the incumbent from the Ohio 7 district belong to? | SELECT "Party" FROM table_18555 WHERE "District" = 'Ohio 7' |
CREATE TABLE cinema (
name VARCHAR,
openning_year VARCHAR
) | Show all the cinema names and opening years in descending order of opening year. | SELECT name, openning_year FROM cinema ORDER BY openning_year DESC |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time, and sort by the y axis in descending. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC |
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 diagnoses (
... | count the number of patients whose ethnicity is american indian/alaska native and age is less than 67? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.age < "67" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | what did patient 8098 have to pay for the hospital stay? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8098) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.