table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_51 (
eruptions VARCHAR,
country VARCHAR,
location VARCHAR,
volcanic_explosivity_index VARCHAR
) | Which Eruptions have a Location of pacific ring of fire, and a Volcanic Explosivity Index of 6, and a Country of peru? | SELECT eruptions FROM table_name_51 WHERE location = "pacific ring of fire" AND volcanic_explosivity_index = "6" AND country = "peru" |
CREATE TABLE climber (
Country VARCHAR
) | How many distinct countries are the climbers from? | SELECT COUNT(DISTINCT Country) FROM climber |
CREATE TABLE table_204_944 (
id number,
"mine" text,
"province" text,
"coordinates" text,
"town" text,
"dates" text,
"comments" text
) | what province is the town of temagami ? | SELECT "province" FROM table_204_944 WHERE "town" = 'temagami' |
CREATE TABLE table_20684390_1 (
mccain_percentage VARCHAR,
county VARCHAR
) | What is the McCain vote percentage in Jerome county? | SELECT mccain_percentage FROM table_20684390_1 WHERE county = "Jerome" |
CREATE TABLE table_name_25 (
rank VARCHAR,
games VARCHAR
) | What is the rank that shows 276 games? | SELECT rank FROM table_name_25 WHERE games = "276" |
CREATE TABLE table_41381 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | What was the result for the Outstanding director of a musical category? | SELECT "Result" FROM table_41381 WHERE "Category" = 'outstanding director of a musical' |
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 primary disease is s/p hanging and admission year is less than 2133? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.admityear < "2133" |
CREATE TABLE table_203_675 (
id number,
"match" number,
"date" text,
"round" text,
"home/away" text,
"opponent team" text,
"score" text,
"scorers" text
) | what number of games did both teams score no points ? | SELECT COUNT(*) FROM table_203_675 WHERE "score" = 0 AND "score" = 0 |
CREATE TABLE table_57568 (
"Coach" text,
"Season" text,
"Record" text,
"Home" text,
"Away" text,
"Win %" real,
"Average (Total) Home Attendance" text
) | What was the lowest win% with an away score of 3-2 in 2011 season? | SELECT MIN("Win %") FROM table_57568 WHERE "Away" = '3-2' AND "Season" = '2011' |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | Number of questions that would be automatically protected. Enter Query Description | SELECT COUNT(Id) FROM Posts AS q WHERE PostTypeId = 1 AND DATEDIFF(m, q.CreationDate, GETDATE()) >= 6 AND AnswerCount >= 1 AND ViewCount >= 1000 |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, could you rank by the X-axis in ascending? | SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
CREATE TABLE table_24330912_1 (
money_list_rank INTEGER
) | What is the lowest overall money list rank? | SELECT MIN(money_list_rank) FROM table_24330912_1 |
CREATE TABLE table_name_37 (
surface VARCHAR,
opponent VARCHAR
) | What is the surface of the tournament with Sascha Kloer as the opponent? | SELECT surface FROM table_name_37 WHERE opponent = "sascha kloer" |
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
nam... | Find the total checkins in Sunday | SELECT SUM(count) FROM checkin WHERE day = 'Sunday' |
CREATE TABLE table_name_61 (
drawn INTEGER,
games INTEGER
) | How many Drawn is which has a Games smaller than 6? | SELECT SUM(drawn) FROM table_name_61 WHERE games < 6 |
CREATE TABLE table_name_61 (
catalog VARCHAR,
region VARCHAR,
format VARCHAR
) | Which Catalog has a Region of Canada and a Format of cd/dvd? | SELECT catalog FROM table_name_61 WHERE region = "canada" AND format = "cd/dvd" |
CREATE TABLE table_name_19 (
location VARCHAR,
record VARCHAR
) | Which location held the bout that led to a 4-3 record? | SELECT location FROM table_name_19 WHERE record = "4-3" |
CREATE TABLE table_21132404_1 (
_percentage_2006 VARCHAR,
political_parties VARCHAR
) | How many time was the political party the social democratic party of germany? | SELECT COUNT(_percentage_2006) FROM table_21132404_1 WHERE political_parties = "Social Democratic Party of Germany" |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | Is Prof. Yves Atchade the head professor for 525 next semester ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 525 AND instructor.name LIKE '%Yves Atchade%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_in... |
CREATE TABLE table_train_40 (
"id" int,
"bone_marrow_transplant" bool,
"organ_transplantation" bool,
"systolic_blood_pressure_sbp" int,
"do_not_resuscitate_dnr" bool,
"autoimmune_disease" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"hematologic_disease"... | established do not resuscitate orders prior to enrollment | SELECT * FROM table_train_40 WHERE do_not_resuscitate_dnr = 1 |
CREATE TABLE table_name_80 (
points VARCHAR,
rank VARCHAR,
games VARCHAR
) | How many points are there for rank 5 with more than 34 games? | SELECT COUNT(points) FROM table_name_80 WHERE rank = 5 AND games > 34 |
CREATE TABLE table_60015 (
"Name" text,
"Region" text,
"Programming" text,
"Type" text,
"Encryption" text
) | What is the region for tv uskana? | SELECT "Region" FROM table_60015 WHERE "Name" = 'tv uskana' |
CREATE TABLE table_16976 (
"Total No." real,
"Celebrity" text,
"Director" text,
"Original air date" text,
"Viewers" text
) | If the Original Air Date is 10January2008, what directors released on that date? | SELECT "Director" FROM table_16976 WHERE "Original air date" = '10January2008' |
CREATE TABLE table_name_73 (
home_team VARCHAR,
away_team VARCHAR
) | What was the home team that played Collingwood? | SELECT home_team FROM table_name_73 WHERE away_team = "collingwood" |
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
) | Show different publishers together with the number of publications they have Plot them as bar chart, and could you list by the total number from high to low? | SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher ORDER BY COUNT(*) DESC |
CREATE TABLE table_63789 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the highest rank for a 6:52.70 time and notes of sa/b? | SELECT MAX("Rank") FROM table_63789 WHERE "Notes" = 'sa/b' AND "Time" = '6:52.70' |
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,... | what is the number of patients whose marital status is single? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" |
CREATE TABLE table_53048 (
"Raion (district) or City" text,
"Total" text,
"Ukrainians" text,
"Moldovans" text,
"Bessarabian Bulgarians" text,
"Russians" text,
"Gagauzians" text,
"Other ethnic groups\u00b2" text
) | What city or Raion (district) has 8,600 Bessarabian Bulgarians? | SELECT "Raion (district) or City" FROM table_53048 WHERE "Bessarabian Bulgarians" = '8,600' |
CREATE TABLE table_4823 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team's score when south melbourne is the away team? | SELECT "Away team score" FROM table_4823 WHERE "Away team" = 'south melbourne' |
CREATE TABLE table_name_64 (
date INTEGER,
cores_per_die___dies_per_module VARCHAR,
clock VARCHAR
) | What is the latest date with Cores per die / Dies per module of 2 / 1, and a Clock of 1.4-1.6ghz? | SELECT MAX(date) FROM table_name_64 WHERE cores_per_die___dies_per_module = "2 / 1" AND clock = "1.4-1.6ghz" |
CREATE TABLE table_20500097_1 (
points VARCHAR,
poles INTEGER
) | How many points did he win in the race with more than 1.0 poles? | SELECT points FROM table_20500097_1 WHERE poles > 1.0 |
CREATE TABLE table_64207 (
"Frequency" text,
"Station" text,
"Operator" text,
"Country of origin" text,
"Transmitter location" text,
"Format" text
) | Which station has a frequency of 873khz? | SELECT "Station" FROM table_64207 WHERE "Frequency" = '873khz' |
CREATE TABLE table_60853 (
"Position" real,
"Club" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Points" real,
"Goal Difference" real
) | Can you tell me the average Wins that has the Goal Difference larger than -24, and the Draws larger than 7? | SELECT AVG("Wins") FROM table_60853 WHERE "Goal Difference" > '-24' AND "Draws" > '7' |
CREATE TABLE table_name_1 (
song VARCHAR,
year VARCHAR,
us_hot_100 VARCHAR
) | Which Song has a Year smaller than 1979, and a US Hot 100 of 8? | SELECT song FROM table_name_1 WHERE year < 1979 AND us_hot_100 = "8" |
CREATE TABLE table_33865 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
) | Which Frequency has a Website of , and a Webcast of in san antonio? | SELECT AVG("Frequency") FROM table_33865 WHERE "Website" = '•' AND "Webcast" = '•' AND "City of License" = 'san antonio' |
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
... | What are the names of all clubs that do not have any players? | SELECT name FROM club WHERE NOT club_id IN (SELECT club_id FROM player) |
CREATE TABLE table_70048 (
"Rank" real,
"Mountain Peak" text,
"Province" text,
"Mountain Range" text,
"Location" text
) | Name the mountain peak with location of 46.7000 n 60.5992 w | SELECT "Mountain Peak" FROM table_70048 WHERE "Location" = '46.7000°n 60.5992°w' |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name te... | Popular MongoDB Queries by ViewCount. | SELECT Score, ViewCount, CreationDate, DATEDIFF(DAY, CreationDate, GETDATE()) AS "DaysOpen", (ViewCount / DATEDIFF(DAY, CreationDate, GETDATE())) AS "NewScore", LastActivityDate, Title, Id, Tags FROM Posts WHERE Title LIKE '%mongodb%' OR Tags LIKE '%mongodb%' ORDER BY NewScore DESC |
CREATE TABLE table_8168 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Date" text,
"Crowd" real
) | What date was the away team from Adelaide? | SELECT "Date" FROM table_8168 WHERE "Away team" = 'adelaide' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | count the number of people who were prescribed tamsulosin hcl 0.4 mg po caps within 2 months following a diagnosis of chest pain until 2104. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, med... |
CREATE TABLE table_name_28 (
title VARCHAR,
rank VARCHAR
) | Which title had rank 9? | SELECT title FROM table_name_28 WHERE rank = 9 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose year of birth is less than 2043 and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Urine" |
CREATE TABLE table_2006661_1 (
date VARCHAR,
value VARCHAR
) | Name the date for value 55c | SELECT date FROM table_2006661_1 WHERE value = "55c" |
CREATE TABLE vocals (
TYPE VARCHAR
) | Find all the vocal types. | SELECT DISTINCT TYPE FROM vocals |
CREATE TABLE festival_detail (
Festival_Name VARCHAR,
YEAR VARCHAR
) | Show the names of the three most recent festivals. | SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3 |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | Top 300 users by Reputation in Iran. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 300 |
CREATE TABLE table_name_90 (
power VARCHAR,
class VARCHAR,
identifier VARCHAR
) | What is the power that belongs to Class A with an Identifier of CBOC-FM? | SELECT power FROM table_name_90 WHERE class = "a" AND identifier = "cboc-fm" |
CREATE TABLE table_14805 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Name the date with margin of victory of 1 stroke and tournament of legend financial group classic | SELECT "Date" FROM table_14805 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'legend financial group classic' |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
) | Return a scatter chart about the correlation between People_ID and Total . | SELECT People_ID, Total FROM body_builder |
CREATE TABLE table_name_84 (
outcome VARCHAR,
score_in_final VARCHAR
) | What was the outcome for the match that ended in a score of 5 7, 6 4, [10 7]? | SELECT outcome FROM table_name_84 WHERE score_in_final = "5–7, 6–4, [10–7]" |
CREATE TABLE table_name_36 (
slalom VARCHAR,
downhill VARCHAR
) | Which Slalom has a Downhill of 4? | SELECT slalom FROM table_name_36 WHERE downhill = "4" |
CREATE TABLE table_58142 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the nationality of the guard who plays at Utah? | SELECT "Nationality" FROM table_58142 WHERE "Position" = 'guard' AND "School/Club Team" = 'utah' |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | how many patients were prescribed with acetaminophen 650 mg re supp within 2 months after the diagnosis of hepatorenal syndrome,? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatorenal syndrome') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN p... |
CREATE TABLE table_50139 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real,
"Name origin" text
) | COunt the sum of Diameter (km) which has a Latitude of 62.7n? | SELECT SUM("Diameter (km)") FROM table_50139 WHERE "Latitude" = '62.7n' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | is there any microbiological test result for patient 031-23605's blood, venipuncture the previous year? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME(microla... |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is the number of patients prescribed sulfameth/trimethoprim ds who were admitted via physician referral/normal delivery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Sulfameth/Trimethoprim DS" |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | What is the proportion of the teams in elimination? Display by a pie chart. | SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, a line chart shows the change of employee_id over hire_date, and could you sort by the X in ascending? | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE |
CREATE TABLE table_name_86 (
network VARCHAR,
title VARCHAR
) | What is the Network, when Title is 'Epik High's Love And Delusion'? | SELECT network FROM table_name_86 WHERE title = "epik high's love and delusion" |
CREATE TABLE table_71814 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the score of the Blue Jays game when their record was 75-68 and the attendance was larger than 33,736? | SELECT "Score" FROM table_71814 WHERE "Attendance" > '33,736' AND "Record" = '75-68' |
CREATE TABLE operate_company (
id number,
name text,
type text,
principal_activities text,
incorporated_in text,
group_equity_shareholding number
)
CREATE TABLE flight (
id number,
vehicle_flight_number text,
date text,
pilot text,
velocity number,
altitude number,
a... | What is the velocity of the pilot named 'Thompson'? | SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' |
CREATE TABLE table_29218221_2 (
rider VARCHAR,
fri_3_june VARCHAR
) | Who was the rider with a Fri 3 June time of 18' 19.68 123.516mph? | SELECT rider FROM table_29218221_2 WHERE fri_3_june = "18' 19.68 123.516mph" |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | CV Most Interesting Users - Only Counting 'immediate' votes. | SELECT COUNT(*) AS score, p.Id, p.OwnerUserId FROM Votes AS v, Posts AS p, Posts AS p2 WHERE v.VoteTypeId = 2 AND v.PostId = p.Id AND p.ParentId = p2.Id AND v.CreationDate - p2.CreationDate < 14 GROUP BY p.Id, p.OwnerUserId HAVING COUNT(*) > 10 |
CREATE TABLE table_name_50 (
away_team VARCHAR
) | What was South Melbourne's score as the away team? | SELECT away_team AS score FROM table_name_50 WHERE away_team = "south melbourne" |
CREATE TABLE table_name_64 (
entrant VARCHAR,
year VARCHAR
) | What is the entrant in 1999? | SELECT entrant FROM table_name_64 WHERE year = 1999 |
CREATE TABLE table_6328 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What Tournament on October 24, 1982 had Alycia Moulton as the Partner? | SELECT "Tournament" FROM table_6328 WHERE "Date" = 'october 24, 1982' AND "Partner" = 'alycia moulton' |
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 me the number of patients whose diagnoses icd9 code is 42831 and lab test fluid is other body fluid? | 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 = "42831" AND lab.fluid = "Other Body Fluid" |
CREATE TABLE table_17683 (
"Series Ep #" real,
"Season 3 Ep #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Airdate" text,
"Production Code" real
) | What is the title of season 3 ep# 12? | SELECT "Title" FROM table_17683 WHERE "Season 3 Ep #" = '12' |
CREATE TABLE table_42202 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Country had a Score of 71-67=138? | SELECT "Country" FROM table_42202 WHERE "Score" = '71-67=138' |
CREATE TABLE table_name_45 (
surface VARCHAR,
score VARCHAR
) | Which has a Score of 6 1, 3 0 ret.? | SELECT surface FROM table_name_45 WHERE score = "6–1, 3–0 ret." |
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_... | what are the ids and names of all start stations that were the beginning of at least 200 trips?, and could you rank bars in ascending order? | SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | For my graduation is LHC 750 essential ? | SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'LHC' AND course.number = 750 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id |
CREATE TABLE table_57613 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score of the home team when the opposing team had a score of 9.11 (65)? | SELECT "Home team score" FROM table_57613 WHERE "Away team score" = '9.11 (65)' |
CREATE TABLE table_17879 (
"Week" real,
"Date" text,
"Kickoff ( ET )" text,
"TV" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text
) | What is the opponent of the veterans stadium | SELECT "Opponent" FROM table_17879 WHERE "Game Site" = 'Veterans Stadium' |
CREATE TABLE table_65026 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the rank of Israel? | SELECT MAX("Rank") FROM table_65026 WHERE "Country" = 'israel' |
CREATE TABLE table_name_53 (
opponent VARCHAR,
location_attendance VARCHAR
) | Who was the opponent when they played at the Skydome? | SELECT opponent FROM table_name_53 WHERE location_attendance = "skydome" |
CREATE TABLE table_name_27 (
player VARCHAR,
score VARCHAR
) | With a score of 70, this player's name is listed as what? | SELECT player FROM table_name_27 WHERE score = 70 |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id num... | the number of patients in careunit micu in the last year? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) |
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... | find the number of patients born before 2156 who had endoscopic retrograde cholangiography. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2156" AND procedures.short_title = "Endosc retro cholangiopa" |
CREATE TABLE table_67579 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
) | what last performance has past status, ballet as style and tommy batchelor? | SELECT "Last Performance" FROM table_67579 WHERE "Status" = 'past' AND "Style" = 'ballet' AND "Name" = 'tommy batchelor' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | how many days have passed since patient 016-9636 received his first -monos lab test on the current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospit... |
CREATE TABLE table_58693 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What are the lowest lost has 111 as the goals against? | SELECT MIN("Lost") FROM table_58693 WHERE "Goals Against" = '111' |
CREATE TABLE table_11545282_19 (
no INTEGER,
school_club_team VARCHAR
) | What is the number of school/club teams held by BYU? | SELECT MIN(no) FROM table_11545282_19 WHERE school_club_team = "BYU" |
CREATE TABLE table_2468961_2 (
title VARCHAR,
written_by VARCHAR
) | What is the name of the episode written by Ross Brown? | SELECT title FROM table_2468961_2 WHERE written_by = "Ross Brown" |
CREATE TABLE table_name_25 (
label VARCHAR,
media VARCHAR,
release_date VARCHAR
) | What is the label for a CD released in 2004? | SELECT label FROM table_name_25 WHERE media = "cd" AND release_date = 2004 |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
dire... | i want to fly from DENVER to SAN FRANCISCO | 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 = 'SAN FRA... |
CREATE TABLE table_53254 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What school does John Crotty play for? | SELECT "School/Club Team" FROM table_53254 WHERE "Player" = 'john crotty' |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate ti... | how many days have pass since the last time patient 31854 stayed in careunit ccu during the current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime DESC LIMIT 1 |
CREATE TABLE table_204_867 (
id number,
"number" number,
"date" text,
"name" text,
"age\n(at execution)" number,
"age\n(at offense)" number,
"race" text,
"state" text,
"method" text
) | who was the next consecutive woman to be executed after lynda lyon block ? | SELECT "name" FROM table_204_867 WHERE "number" = (SELECT "number" FROM table_204_867 WHERE "name" = 'lynda lyon block') + 1 |
CREATE TABLE table_10968 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Tell me the fastest lapf or jim clark being the winning driver for prince george | SELECT "Fastest lap" FROM table_10968 WHERE "Winning driver" = 'jim clark' AND "Circuit" = 'prince george' |
CREATE TABLE table_7114 (
"Year" real,
"Conventional plans" text,
"HMOs" text,
"PPOs" text,
"POS plans" text
) | Which HMO has a conventional plan of 3% in 2005? | SELECT "HMOs" FROM table_7114 WHERE "Conventional plans" = '3%' AND "Year" = '2005' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | number of times patient 016-26884 was prescribed insulin aspart 100 unit/ml sc soln since 2102. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-26884')) AND medication.drugname = 'insulin aspart 100 unit/ml sc soln' AN... |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | For all employees who have the letters D or S in their first name, draw a line chart about the change of commission_pct over hire_date , and list in descending by the x-axis please. | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC |
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
sequence_identity_to_human_protein text,
Institution_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
... | Please give me a bar chart showing institution types, along with the total enrollment for each type, and show Y-axis from low to high order. | SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY SUM(Enrollment) |
CREATE TABLE table_name_22 (
attendance INTEGER,
date VARCHAR,
week VARCHAR
) | before week 12 what was the attendance on 1983-11-21? | SELECT SUM(attendance) FROM table_name_22 WHERE date = "1983-11-21" AND week < 12 |
CREATE TABLE table_10062 (
"Railway" text,
"Builder" text,
"Built" text,
"Wheels" text,
"Location" text,
"ObjectNumber" text
) | Which railway was built in 1920? | SELECT "Railway" FROM table_10062 WHERE "Built" = '1920' |
CREATE TABLE table_name_42 (
level INTEGER,
example_name VARCHAR,
number_of_hus__approximate_ VARCHAR
) | What is the mean level number when the example name is lower snake and the approximate number is hus is less than 370? | SELECT AVG(level) FROM table_name_42 WHERE example_name = "lower snake" AND number_of_hus__approximate_ < 370 |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined b... | Posts with given word in some of the past revision but not in the current one. | SELECT DISTINCT p.Id AS "post_link", p.OwnerUserId AS "user_link", p.LastActivityDate, p.CreationDate, url = 'site://posts/' + CAST(p.Id AS TEXT) + '/revisions' FROM Posts AS p JOIN PostHistory AS ph ON (ph.PostId = p.Id) WHERE (ph.Text LIKE '%##word?Chebychev##%') AND NOT (p.Body LIKE '%##word##%') ORDER BY p.LastActi... |
CREATE TABLE table_73154 (
"#" real,
"Episode" text,
"UK air date" text,
"Timeslot" text,
"Viewers (millions)" text,
"Audience share in timeslot" text
) | name the total number of timeslot for number 1 | SELECT COUNT("Timeslot") FROM table_73154 WHERE "#" = '1' |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what were the marital status of patient 40967 in their last hospital visit? | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 40967 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.