table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_203_762 (
id number,
"#" number,
"date" text,
"film" text,
"gross" text,
"notes" text
) | what was the previous film to air before collateral damage ? | SELECT "film" FROM table_203_762 WHERE "date" < (SELECT "date" FROM table_203_762 WHERE "film" = 'collateral damage') ORDER BY "date" DESC LIMIT 1 |
CREATE TABLE table_name_18 (
release_date VARCHAR,
publisher VARCHAR,
title VARCHAR
) | When Did Microsoft Game Studios release Amped: Freestyle Snowboarding? | SELECT release_date FROM table_name_18 WHERE publisher = "microsoft game studios" AND title = "amped: freestyle snowboarding" |
CREATE TABLE table_29839 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the record for w 101 93 (ot) | SELECT "Record" FROM table_29839 WHERE "Score" = 'W 101–93 (OT)' |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of job_id and manager_id . | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperat... | A bar graph listing the services and how many services provided by all stations. | SELECT services, COUNT(services) FROM station GROUP BY services |
CREATE TABLE table_18138132_2 (
function VARCHAR,
version VARCHAR,
title VARCHAR
) | What is the function of 1.4 version of Windows live messenger? | SELECT function FROM table_18138132_2 WHERE version = "1.4" AND title = "Windows Live Messenger" |
CREATE TABLE table_51857 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the home team scored 12.21 (93), what was the average crowd size? | SELECT AVG("Crowd") FROM table_51857 WHERE "Home team score" = '12.21 (93)' |
CREATE TABLE table_name_97 (
visitor VARCHAR,
leading_scorer VARCHAR
) | Who is the visitor team of the game with Andrew Bogut (21) as the leading scorer? | SELECT visitor FROM table_name_97 WHERE leading_scorer = "andrew bogut (21)" |
CREATE TABLE table_11622562_1 (
location VARCHAR
) | What was the minimal amount ($) of the 1st prize in the tournaments in New Mexico? | SELECT MIN(1 AS st_prize__) AS $__ FROM table_11622562_1 WHERE location = "New Mexico" |
CREATE TABLE table_58205 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which competition with a result of 3-1? | SELECT "Competition" FROM table_58205 WHERE "Result" = '3-1' |
CREATE TABLE table_name_71 (
wrestlers VARCHAR,
event VARCHAR
) | What wrestlers have summer brawl 2006 as the event? | SELECT wrestlers FROM table_name_71 WHERE event = "summer brawl 2006" |
CREATE TABLE table_52737 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Name the record when the visitor is st. louis | SELECT "Record" FROM table_52737 WHERE "Visitor" = 'st. louis' |
CREATE TABLE table_23274514_7 (
high_rebounds VARCHAR,
record VARCHAR
) | Name the high rebounds for 17-33 | SELECT high_rebounds FROM table_23274514_7 WHERE record = "17-33" |
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year ... | How many churches open each year? Convert the year into the weekday interval and visualize with a bar chart, and display in ascending by the Y-axis. | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_Date) |
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,
... | count the number of patients whose diagnosis icd9 code is 3079 and lab test fluid is cerebrospinal fluid (csf). | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "3079" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | Find the average age of members of the club 'Hopkins Student Enterprises'. | SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" |
CREATE TABLE table_2610582_7 (
branding VARCHAR,
callsign VARCHAR
) | What bran is the callsign dytc-fm? | SELECT branding FROM table_2610582_7 WHERE callsign = "DYTC-FM" |
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... | What have I voted by tag?. | SELECT DISTINCT Posts.Title, Posts.Body, Posts.Id, Posts.Score, Posts.OwnerDisplayName, Posts.Tags, TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE TagName = 'backbone.js' AND Scor... |
CREATE TABLE table_40755 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Gold has a Rank of 15, and a Total smaller than 2? | SELECT AVG("Gold") FROM table_40755 WHERE "Rank" = '15' AND "Total" < '2' |
CREATE TABLE table_name_17 (
driver VARCHAR,
laps VARCHAR
) | Which driver has 62 laps? | SELECT driver FROM table_name_17 WHERE laps = 62 |
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
)
... | what is the number of patients aged less than 62 years who had hyperglycemia; hyponatremia primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND demographic.age < "62" |
CREATE TABLE table_58589 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What time did the ferrari car that finished 62 laps have? | SELECT "Time/Retired" FROM table_58589 WHERE "Laps" < '62' AND "Constructor" = 'ferrari' |
CREATE TABLE table_20540 (
"Species" text,
"Indole" text,
"Methyl Red" text,
"Voges-Proskauer" text,
"Citrate" text
) | What is the result for salmonella spp. if you use citrate? | SELECT COUNT("Citrate") FROM table_20540 WHERE "Species" = 'Salmonella spp.' |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | show me fares from BALTIMORE to PHILADELPHIA | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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.ci... |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | count the number of patients who during this year had been admitted to the hospital. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | show all airlines with flights between DENVER and DALLAS | SELECT DISTINCT airline.airline_code FROM airline, 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_na... |
CREATE TABLE table_12399 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is the score when the to par was 5, for Peter Jacobsen? | SELECT SUM("Score") FROM table_12399 WHERE "To par" = '–5' AND "Player" = 'peter jacobsen' |
CREATE TABLE table_name_48 (
attendance INTEGER,
week VARCHAR
) | What was the lowest attendance for week 1? | SELECT MIN(attendance) FROM table_name_48 WHERE week = 1 |
CREATE TABLE table_58258 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team is Lake Oval home to? | SELECT "Home team" FROM table_58258 WHERE "Venue" = 'lake oval' |
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... | get me both the short title and long title of diagnoses for patient roxanna weaver. | SELECT diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Roxanna Weaver" |
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... | provide the number of patients whose diagnoses short title is skin disorders nec 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 = "Skin disorders NEC" AND prescriptions.drug_type = "ADDITIVE" |
CREATE TABLE table_52201 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | How many rebounds occurred in a rank 4 game? | SELECT "Rebounds" FROM table_52201 WHERE "Rank" = '4' |
CREATE TABLE table_204_614 (
id number,
"date announced" text,
"plant name" text,
"location" text,
"date of closing" text,
"products" text,
"employees" number
) | what is the top company that has the most employees ? | SELECT "plant name" FROM table_204_614 ORDER BY "employees" DESC LIMIT 1 |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE writes (
paperid int,
aut... | How many papers does james fogarty have ? | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'james fogarty' AND writes.authorid = author.authorid |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
... | A bar chart for giveing me the number of the dates when the max temperature was higher than 85, sort Y in asc order. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) |
CREATE TABLE table_74163 (
"Warrior" text,
"Close ranged weapons" text,
"Mid ranged weapons" text,
"Long ranged weapons" text,
"Armor" text,
"Special weapon" text
) | If the special weapon is the Grenado, what is the armor? | SELECT "Armor" FROM table_74163 WHERE "Special weapon" = 'Grenado' |
CREATE TABLE table_name_34 (
record VARCHAR,
date VARCHAR
) | Which record happened on the date of May 7? | SELECT record FROM table_name_34 WHERE date = "may 7" |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | Top 'R' and 'Machine-Learning' Vote Getters with A Website. | SELECT Users.DisplayName, Users.Id, sub.totalVotes, Users.WebsiteUrl FROM (SELECT Users.Id, Tags.TagName, COUNT(*) AS totalVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND Votes.VoteTypeId = 2 INNER JOIN ... |
CREATE TABLE table_5837 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | Who was the opponent that also has a save of Smith (26)? | SELECT "Opponent" FROM table_5837 WHERE "Save" = 'smith (26)' |
CREATE TABLE table_32863 (
"Club" text,
"Played" real,
"Lost" real,
"Drawn" real,
"Against" real,
"Diff." real,
"Points" real
) | What is the maximum number of draws when the diff is smaller than 186, points are fewer than 12 and games played fewer than 6? | SELECT MAX("Drawn") FROM table_32863 WHERE "Diff." < '186' AND "Points" < '12' AND "Played" < '6' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, and could you rank in asc by the sum employee id? | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) |
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 aircraft (
... | hello i would like to plan a flight from BOSTON to DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'... |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | tell me the sex of patient 027-94756. | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '027-94756' |
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 course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | Are 15 credits the only option for upper-level classes ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 15 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
CREATE TABLE table_name_67 (
year INTEGER,
rider VARCHAR,
final_position___giro VARCHAR,
final_position___tour VARCHAR,
final_position___vuelta VARCHAR
) | What is the earliest year of Valdimir Poelnikov, who has a final position-tour bigger than 72, a final position-vuelta less than 77, and a final position-giro less than 57? | SELECT MIN(year) FROM table_name_67 WHERE final_position___tour > 72 AND final_position___vuelta < 77 AND final_position___giro < 57 AND rider = "valdimir poelnikov" |
CREATE TABLE table_32281 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team when Footscray was the away team? | SELECT "Home team" FROM table_32281 WHERE "Away team" = 'footscray' |
CREATE TABLE table_name_98 (
date VARCHAR,
winning_score VARCHAR
) | Which Date has a Winning score of 15 (71-69-68-65=273)? | SELECT date FROM table_name_98 WHERE winning_score = −15(71 - 69 - 68 - 65 = 273) |
CREATE TABLE table_19011 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2008/2009" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight ( Metric Tonnes )" real
) | What is the rank of the airport with freight ( metric tonnes ) of 255121? | SELECT "Rank" FROM table_19011 WHERE "Freight ( Metric Tonnes )" = '255121' |
CREATE TABLE table_name_44 (
events VARCHAR,
top_25 INTEGER
) | What is the total number of events with a top-25 less than 0? | SELECT COUNT(events) FROM table_name_44 WHERE top_25 < 0 |
CREATE TABLE table_79285 (
"TV Station (Operator)" text,
"2005" real,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011 1H" real
) | How many 2011 1H values have a 2006 of 27.4 and 2007 over 27.7? | SELECT COUNT("2011 1H") FROM table_79285 WHERE "2006" = '27.4' AND "2007" > '27.7' |
CREATE TABLE table_name_33 (
total INTEGER,
name VARCHAR,
vuelta VARCHAR
) | What is the total for miguel indur in with a Vuelta larger than 1? | SELECT MIN(total) FROM table_name_33 WHERE name = "miguel induráin" AND vuelta > 1 |
CREATE TABLE table_17323092_5 (
team VARCHAR,
score VARCHAR
) | Whic teams scored l 97 107 (ot) | SELECT team FROM table_17323092_5 WHERE score = "L 97–107 (OT)" |
CREATE TABLE table_36029 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2001" text
) | what is the venue of belshina | SELECT "Venue" FROM table_36029 WHERE "Team" = 'belshina' |
CREATE TABLE table_49731 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Which player has fewer than 3 rounds and the position of (g)? | SELECT "Player" FROM table_49731 WHERE "Round" < '3' AND "Position" = '(g)' |
CREATE TABLE table_12995531_3 (
total_viewers INTEGER,
date_of_first_broadcast VARCHAR,
episode_number VARCHAR
) | what is the total viewers where the date of first broadcast is 28 january 2010 and the episode number is 1? | SELECT MIN(total_viewers) FROM table_12995531_3 WHERE date_of_first_broadcast = "28 January 2010" AND episode_number = 1 |
CREATE TABLE table_54645 (
"Event" text,
"Data" text,
"Athlete" text,
"Date" text,
"Place" text
) | What day did Chris Maddocks compete in the 35000 m? | SELECT "Date" FROM table_54645 WHERE "Athlete" = 'chris maddocks' AND "Event" = '35000 m' |
CREATE TABLE table_78780 (
"Edition" text,
"Date" text,
"Winner" text,
"Country" text,
"Time ( h : m : s )" text
) | Who was the winner of the 23rd Edition? | SELECT "Winner" FROM table_78780 WHERE "Edition" = '23rd' |
CREATE TABLE table_71127 (
"Year" real,
"Entrant" text,
"Class" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Rank" text,
"Points" real
) | What Chassis ranked 18th? | SELECT "Chassis" FROM table_71127 WHERE "Rank" = '18th' |
CREATE TABLE Trained_In (
Physician INTEGER,
Treatment INTEGER,
CertificationDate DATETIME,
CertificationExpires DATETIME
)
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30... | A pie chart for listing the number of the names of patients who have made appointments. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name |
CREATE TABLE table_7967 (
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
) | What is the sum for the Scottish cup that has player Damon Gray, and more than 1 league? | SELECT SUM("Scottish Cup") FROM table_7967 WHERE "Player" = 'damon gray' AND "League" > '1' |
CREATE TABLE table_73145 (
"Tournament" text,
"Also currently known as" text,
"City" text,
"Country" text,
"Court surface" text,
"Defending champion" text
) | What tournament is in katowice? | SELECT "Tournament" FROM table_73145 WHERE "City" = 'Katowice' |
CREATE TABLE table_name_37 (
driver VARCHAR,
season VARCHAR,
tuner VARCHAR,
governing_body VARCHAR
) | Who is the driver in season 2003 with a tuner of N. Leelakrishnan and a Mai governing body? | SELECT driver FROM table_name_37 WHERE tuner = "n. leelakrishnan" AND governing_body = "mai" AND season = 2003 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients on additive type drug prescription who have been diagnosed with long-term (current) use of anticoagulants. | 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.long_title = "Long-term (current) use of anticoagulants" AND prescriptions.drug_type = "ADDITIVE" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevent... | how many patients have been treated with pros rep atrial def-opn in a year before? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'pros rep atrial def-opn') AND DATETIME(procedures_ic... |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many patients had been released until 4 years ago from the hospital? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-4 year') |
CREATE TABLE table_name_44 (
home_team VARCHAR,
tie_no VARCHAR,
attendance VARCHAR
) | What is Home Team, when Tie No is Replay, and when Attendance is 2,048? | SELECT home_team FROM table_name_44 WHERE tie_no = "replay" AND attendance = "2,048" |
CREATE TABLE table_28688 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | How many different production codes are there for the episode with 4.69 million US viewers? | SELECT COUNT("Production code") FROM table_28688 WHERE "U.S. viewers (millions)" = '4.69' |
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,... | give the number of patients whose drug code is mida100 and lab test fluid is joint fluid. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MIDA100" AND lab.fluid = "Joint Fluid" |
CREATE TABLE table_12113888_1 (
built VARCHAR,
name_as_rebuilt VARCHAR
) | What was the built data for Knocklayd rebuild? | SELECT built FROM table_12113888_1 WHERE name_as_rebuilt = "Knocklayd" |
CREATE TABLE address (
district VARCHAR
) | Which districts have at least two addresses? | SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2 |
CREATE TABLE table_73247 (
"Barangay" text,
"Population (2004)" real,
"Population (2010)" real,
"Area (km 2 )" text,
"District" text
) | what is the area where barangay is guadalupe viejo? | SELECT "Area (km 2 )" FROM table_73247 WHERE "Barangay" = 'Guadalupe Viejo' |
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... | Give me a pie to show the number of acc road from different acc road. | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road |
CREATE TABLE table_38001 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
) | Which round has the scorer of Di Matteo? | SELECT "Round" FROM table_38001 WHERE "Scorers" = 'di matteo' |
CREATE TABLE table_name_28 (
language VARCHAR,
network VARCHAR
) | What is the Language for Network PTC Punjabi? | SELECT language FROM table_name_28 WHERE network = "ptc punjabi" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | get me the number of patients with blood lab test who have the diagnoses of dementia in conditions classifed elsewhere without behavioral disturbance. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Dementia in conditions classified elsewhere without behavioral disturbance" AND lab.fluid = "Blood" |
CREATE TABLE table_name_52 (
time_elapsed VARCHAR,
launched VARCHAR,
closest_approach VARCHAR
) | What Time elapsed has both the Launched of 15 October 1997 and the Closest approach of 24 June 1999? | SELECT time_elapsed FROM table_name_52 WHERE launched = "15 october 1997" AND closest_approach = "24 june 1999" |
CREATE TABLE table_name_88 (
record VARCHAR,
score VARCHAR
) | What was the record of the game that went 3-5? | SELECT record FROM table_name_88 WHERE score = "3-5" |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)... | Show me a bar chart for what are the different budget type codes, and how many documents are there for each?, list x-axis in descending order. | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code DESC |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | what are the flights from BOSTON to SAN FRANCISCO leaving tomorrow | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 20 AND date_day.month_number = 1... |
CREATE TABLE table_name_52 (
points INTEGER,
games VARCHAR,
rank VARCHAR
) | What is the highest value for Points, when Games is 21, and when Rank is greater than 2? | SELECT MAX(points) FROM table_name_52 WHERE games = 21 AND rank > 2 |
CREATE TABLE table_1900 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
) | Name the least ansi code for 609 population 2010 | SELECT MIN("ANSI code") FROM table_1900 WHERE "Pop. (2010)" = '609' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is lab test name and lab test fluid of subject name shawn green? | SELECT lab.label, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Shawn Green" |
CREATE TABLE table_name_63 (
formula VARCHAR,
refractive_index_es__5893nm VARCHAR
) | Which formula has a refractive index 589.3 at 1.97? | SELECT formula FROM table_name_63 WHERE refractive_index_es__5893nm = "1.97" |
CREATE TABLE table_16710971_2 (
result VARCHAR,
record VARCHAR
) | What was the result of the 1978 Atlanta Falcons season when the record was 1-2? | SELECT result FROM table_16710971_2 WHERE record = "1-2" |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE T... | return me the papers by ' H. V. Jagadish ' after 2000 . | SELECT publication.title FROM author, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid |
CREATE TABLE table_name_33 (
failures INTEGER,
orbital_regime VARCHAR,
launches VARCHAR
) | What is the total failures of heliocentric orbit orbital regimes and launches less than 1? | SELECT SUM(failures) FROM table_name_33 WHERE orbital_regime = "heliocentric orbit" AND launches < 1 |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Da... | Return a trend line with sorting the payment day in ascending order to show the total amount of payment by each payment day. | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments GROUP BY Date_Payment_Made ORDER BY Date_Payment_Made |
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... | What is the relationship between People_ID and Weight , and group by attribute Sex? | SELECT People_ID, Weight FROM people GROUP BY Sex |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | Getting the number questions asked by a given user(OwnerUserId). | SELECT Posts.OwnerUserId FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id GROUP BY OwnerUserId HAVING COUNT(ParentId) = 1 |
CREATE TABLE phone (
Company_name text,
Hardware_Model_name text,
Accreditation_type text,
Accreditation_level text,
Date text,
chip_model text,
screen_mode text
)
CREATE TABLE chip_model (
Model_name text,
Launch_year real,
RAM_MiB real,
ROM_MiB real,
Slots text,
Wi... | Compute the total number of chips of different company names for all the phones that were launched in year 2002 or have RAM size greater than 32, and could you show by the bar in asc? | SELECT Company_name, COUNT(Company_name) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32 GROUP BY Company_name ORDER BY Company_name |
CREATE TABLE table_22330 (
"Serial No." real,
"District" text,
"Headquartered City" text,
"City Population (2009)" real,
"City Area(km 2 )" real
) | What is the smallest city area? | SELECT MIN("City Area(km 2 )") FROM table_22330 |
CREATE TABLE table_77253 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | what is the winning score when the tournament is safeco classic? | SELECT "Winning score" FROM table_77253 WHERE "Tournament" = 'safeco classic' |
CREATE TABLE table_203_855 (
id number,
"date" text,
"city" text,
"venue" text,
"member" text,
"performance" text,
"notes" text
) | were the matinee and evening performances held earlier than the 8th anniversary ? | SELECT (SELECT "date" FROM table_203_855 WHERE "notes" = 'matinee and evening performances') > (SELECT "date" FROM table_203_855 WHERE "notes" = '8th anniversary') |
CREATE TABLE table_name_76 (
lost INTEGER,
position VARCHAR,
drawn VARCHAR
) | Which Lost has a Position of 3, and a Drawn larger than 3? | SELECT SUM(lost) FROM table_name_76 WHERE position = 3 AND drawn > 3 |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | did patient 64292 ever underwent any oth intraop mag res imag procedure since 2104? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth intraop mag res imag') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64292) AND STRFTIME('%... |
CREATE TABLE table_51099 (
"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 most rebounds on January 3? | SELECT "High rebounds" FROM table_51099 WHERE "Date" = 'january 3' |
CREATE TABLE table_39154 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many games have Points smaller than 4, and an October smaller than 5? | SELECT COUNT("Game") FROM table_39154 WHERE "Points" < '4' AND "October" < '5' |
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text,
support_rep_id number
)
CREATE TABLE playlists (
id number,
name text
)
... | How many customers does Steve Johnson support? | SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson" |
CREATE TABLE table_name_32 (
entered_service VARCHAR,
delivered_as VARCHAR
) | What is the Entered service date of the T413? | SELECT entered_service FROM table_name_32 WHERE delivered_as = "t413" |
CREATE TABLE table_40229 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Podiums" real,
"Points" real,
"Position" text
) | What is the points sum of the series with less than 0 poles? | SELECT SUM("Points") FROM table_40229 WHERE "Poles" < '0' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.