table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_15493 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points" text
) | How many matches played are associated with 20 losses? | SELECT "Played" FROM table_15493 WHERE "Lost" = '20' |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | what's the yearly maximum dose of pe 20 fs po for patient 4718 until 48 months ago? | SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4718)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... |
CREATE TABLE table_name_40 (
date VARCHAR,
surface VARCHAR,
opponent VARCHAR
) | What date was the surface hard and Eva Hrdinov was the opponent? | SELECT date FROM table_name_40 WHERE surface = "hard" AND opponent = "eva hrdinová" |
CREATE TABLE table_13602 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
) | Which Inhabitants have a Party of democratic party, and a Municipality of florence, and an Election smaller than 2009? | SELECT MIN("Inhabitants") FROM table_13602 WHERE "Party" = 'democratic party' AND "Municipality" = 'florence' AND "Election" < '2009' |
CREATE TABLE table_name_84 (
competition VARCHAR,
date VARCHAR
) | What was the competition on 7 June 1999? | SELECT competition FROM table_name_84 WHERE date = "7 june 1999" |
CREATE TABLE table_name_68 (
no_7 VARCHAR,
no_6 VARCHAR,
no_10 VARCHAR,
no_1 VARCHAR,
no_9 VARCHAR
) | What name was number 7 when Mason was number 1, Owen was number 6, Jackson was number 9, and Logan was number 10? | SELECT no_7 FROM table_name_68 WHERE no_1 = "mason" AND no_9 = "jackson" AND no_10 = "logan" AND no_6 = "owen" |
CREATE TABLE table_name_90 (
away_team VARCHAR,
venue VARCHAR
) | Which away team had a venue of mcg? | SELECT away_team FROM table_name_90 WHERE venue = "mcg" |
CREATE TABLE table_name_95 (
top_25 VARCHAR,
top_10 VARCHAR,
cuts_made VARCHAR
) | What is the total number of top-25 that has a top-10 smaller than 4 with 0 cuts? | SELECT COUNT(top_25) FROM table_name_95 WHERE top_10 < 4 AND cuts_made > 0 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients aged below 58 years had the procedure icd9 code 3612? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "58" AND procedures.icd9_code = "3612" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many patients who had the lab test named alveolar-arterial gradient had abnormal lab test results? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Alveolar-arterial Gradient" |
CREATE TABLE table_66059 (
"Currency" text,
"Code" text,
"Entry ERM II" text,
"Central rate" text,
"Official target date" text
) | What code is used to represent the currency of Croatian Kuna? | SELECT "Code" FROM table_66059 WHERE "Currency" = 'croatian kuna' |
CREATE TABLE table_61199 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | What shows at 7:30 am when 3:30 pm is Big Guy and Rusty the Boy Robot? | SELECT "7:30 am" FROM table_61199 WHERE "3:30 pm" = 'big guy and rusty the boy robot' |
CREATE TABLE table_name_25 (
date VARCHAR,
race_title VARCHAR
) | What date was the race at Oran Park ran? | SELECT date FROM table_name_25 WHERE race_title = "oran park" |
CREATE TABLE farm_competition (
competition_id number,
year number,
theme text,
host_city_id number,
hosts text
)
CREATE TABLE city (
city_id number,
official_name text,
status text,
area_km_2 number,
population number,
census_ranking text
)
CREATE TABLE competition_record ... | Return the themes of farm competitions, sorted by year ascending. | SELECT theme FROM farm_competition ORDER BY year |
CREATE TABLE table_name_82 (
home_team VARCHAR,
venue VARCHAR
) | Which team was the home team at Glenferrie Oval? | SELECT home_team FROM table_name_82 WHERE venue = "glenferrie oval" |
CREATE TABLE table_35970 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Who had the lowest field goals but had 10 points and more than 2 touchdowns? | SELECT MIN("Field goals") FROM table_35970 WHERE "Points" = '10' AND "Touchdowns" > '2' |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
... | Show the customer id and number of accounts with most accounts. | SELECT customer_id, COUNT(*) FROM accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
)
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
) | Please show the nominee who has been nominated the greatest number of times. | SELECT nominee FROM musical GROUP BY nominee ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | My posts which were last edited by someone else. | SELECT Id AS "post_link", LastEditDate, Body FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != OwnerUserId ORDER BY LastEditDate DESC |
CREATE TABLE table_204_107 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which is the other nation with the second highest sliver medal | SELECT "nation" FROM table_204_107 WHERE "silver" < (SELECT MAX("silver") FROM table_204_107) ORDER BY "silver" DESC LIMIT 1 |
CREATE TABLE table_16958 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | How many tournaments recorded a score of 206 (-7)? | SELECT COUNT("Tournament") FROM table_16958 WHERE "Score" = '206 (-7)' |
CREATE TABLE table_6498 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponent" text,
"Score" text
) | Name the date with winner outcome and opponent of noppawan lertcheewakarn jessica moore | SELECT "Date" FROM table_6498 WHERE "Outcome" = 'winner' AND "Opponent" = 'noppawan lertcheewakarn jessica moore' |
CREATE TABLE table_80247 (
"Representative" text,
"Title" text,
"Presentation of Credentials" text,
"Termination of Mission" text,
"Appointed by" text
) | Who appointed the representative that had a Presentation of Credentials on March 25, 1976? | SELECT "Appointed by" FROM table_80247 WHERE "Presentation of Credentials" = 'march 25, 1976' |
CREATE TABLE table_49083 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Which Date has a Record of 36 11 7? | SELECT "Date" FROM table_49083 WHERE "Record" = '36–11–7' |
CREATE TABLE table_35239 (
"Firm" text,
"Revenues" text,
"Employees" real,
"Fiscal Year" real,
"Headquarters" text
) | What is the average Fiscal Year of the firm Headquartered in noida, with less than 85,335 employees? | SELECT AVG("Fiscal Year") FROM table_35239 WHERE "Headquarters" = 'noida' AND "Employees" < '85,335' |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of manufacturer , and group by attribute name. | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name |
CREATE TABLE table_name_37 (
call_sign VARCHAR,
tail_code VARCHAR,
weapon_systems_officer VARCHAR
) | Which Call Sign that has a Tail Code of oy belong to Weapon Systems Officer Capt Charles B. Debellevue? | SELECT call_sign FROM table_name_37 WHERE tail_code = "oy" AND weapon_systems_officer = "capt charles b. debellevue" |
CREATE TABLE table_1057262_2 (
new_south_wales VARCHAR,
crop__kilotonnes_ VARCHAR
) | what's the new south wales with crop (kilotonnes) being canola | SELECT new_south_wales FROM table_1057262_2 WHERE crop__kilotonnes_ = "Canola" |
CREATE TABLE department (
dept_name text,
building text,
budget number
)
CREATE TABLE instructor (
id text,
name text,
dept_name text,
salary number
)
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE student (
id text,
name text,
dept_name text,
... | What are the names and average salaries for departments with average salary higher than 42000? | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000 |
CREATE TABLE table_20598 (
"Country" text,
"Donor payment" text,
"Children per donor" text,
"Donor anonymity" text,
"Allowed recipients" text
) | What is the status of donor payment in the country where there are 6 children per donor and no data on allowed recipients? | SELECT "Donor payment" FROM table_20598 WHERE "Children per donor" = '6 children' AND "Allowed recipients" = 'no data' |
CREATE TABLE table_name_61 (
drawn VARCHAR,
lost VARCHAR
) | Which Drawn has a Lost of 19? | SELECT drawn FROM table_name_61 WHERE lost = "19" |
CREATE TABLE table_name_7 (
opponent VARCHAR,
venue VARCHAR
) | Who is the opponent of the match at cua stadium? | SELECT opponent FROM table_name_7 WHERE venue = "cua stadium" |
CREATE TABLE table_13507 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | What is Dominik Meichtry's Time in Heat 7 or lower? | SELECT COUNT("Time") FROM table_13507 WHERE "Name" = 'dominik meichtry' AND "Heat" < '7' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose admission location is emergency room admit and drug code is esmobase? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "ESMOBASE" |
CREATE TABLE table_38563 (
"Season" text,
"Winner" text,
"Result" text,
"Runner-up" text,
"Final venue" text
) | What was the Result in Green Lane with Kirkburton as the Runner-up? | SELECT "Result" FROM table_38563 WHERE "Runner-up" = 'kirkburton' AND "Final venue" = 'green lane' |
CREATE TABLE table_8375 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | which Record has a Home of ottawa senators on Date of december 21? | SELECT "Record" FROM table_8375 WHERE "Home" = 'ottawa senators' AND "Date" = 'december 21' |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | when in 05/this year was patient 3939's last test for po2? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3939) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME... |
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroy... | I want to see trend of the number of date in locaton to by date in locaton to, sort by the x axis in desc. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations ORDER BY Date_in_Locaton_To DESC |
CREATE TABLE table_name_53 (
game VARCHAR,
date VARCHAR
) | What is the game number on December 21? | SELECT COUNT(game) FROM table_name_53 WHERE date = "december 21" |
CREATE TABLE table_name_98 (
events INTEGER,
cuts_made VARCHAR,
top_10 VARCHAR,
wins VARCHAR
) | What is the average number of events having 1 top-10, fewer than 4 cuts made, and 0 wins? | SELECT AVG(events) FROM table_name_98 WHERE top_10 = 1 AND wins > 0 AND cuts_made < 4 |
CREATE TABLE table_name_19 (
home_team VARCHAR,
away_team VARCHAR
) | What home team did South Melbourne play as the away team? | SELECT home_team FROM table_name_19 WHERE away_team = "south melbourne" |
CREATE TABLE College (
enr INTEGER
) | How many colleges has more than 15000 students? | SELECT COUNT(*) FROM College WHERE enr > 15000 |
CREATE TABLE table_76819 (
"Model Number" text,
"Frequency" text,
"L2-Cache" text,
"Front Side Bus" text,
"Multiplier" text,
"Voltage" text,
"Socket" text,
"Release Date" text
) | What is the Front Side Bus for Model Number c7 1.5? | SELECT "Front Side Bus" FROM table_76819 WHERE "Model Number" = 'c7 1.5' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
... | what is the length of patient 55843's stay at the first intensive care unit stay? | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55843) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1 |
CREATE TABLE table_name_60 (
points INTEGER,
year VARCHAR,
rank VARCHAR
) | What is the average points with a year higher than 1989, and a rank of 7th? | SELECT AVG(points) FROM table_name_60 WHERE year > 1989 AND rank = "7th" |
CREATE TABLE table_name_73 (
game INTEGER,
points INTEGER
) | What is the mean game number when the points scored were more than 99? | SELECT AVG(game) FROM table_name_73 WHERE points > 99 |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those products with a price between 60 and 120, return a bar chart about the distribution of name and price . | SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | count the number of patients less than 70 years who prefer haitian language. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "HAIT" AND demographic.age < "70" |
CREATE TABLE table_name_10 (
rank INTEGER,
time VARCHAR
) | What is the highest rank for the team that raced a time of 6:50.40? | SELECT MAX(rank) FROM table_name_10 WHERE time = "6:50.40" |
CREATE TABLE table_name_99 (
time__seconds_ INTEGER,
nation___athlete_s_ VARCHAR
) | What is the longest Time (seconds), when the Nation - athlete(s) is Sylke Otto - Germany? | SELECT MAX(time__seconds_) FROM table_name_99 WHERE nation___athlete_s_ = "sylke otto - germany" |
CREATE TABLE table_29542147_2 (
w INTEGER,
l VARCHAR
) | What is the highest W of the 0 L? | SELECT MAX(w) FROM table_29542147_2 WHERE l = 0 |
CREATE TABLE table_1876825_5 (
title VARCHAR,
production_code VARCHAR
) | What is title of episode 06-02-407? | SELECT title FROM table_1876825_5 WHERE production_code = "06-02-407" |
CREATE TABLE table_46825 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the format in the region of Europe with an XLCD369 and a label of XL? | SELECT "Format" FROM table_46825 WHERE "Label" = 'xl' AND "Catalog" = 'xlcd369' AND "Region" = 'europe' |
CREATE TABLE table_27704187_11 (
game INTEGER,
date VARCHAR
) | What game number was played on april 8? | SELECT MIN(game) FROM table_27704187_11 WHERE date = "April 8" |
CREATE TABLE table_2857352_3 (
network VARCHAR,
virtual_channel VARCHAR
) | How many networks run on virtual channel 23.4? | SELECT COUNT(network) FROM table_2857352_3 WHERE virtual_channel = "23.4" |
CREATE TABLE table_name_53 (
date VARCHAR,
team VARCHAR,
game VARCHAR
) | Tell me the date for detroit and game more than 3 | SELECT date FROM table_name_53 WHERE team = "detroit" AND game > 3 |
CREATE TABLE table_27187 (
"#" real,
"Episode" text,
"Air Date" text,
"Timeslot (EST)" text,
"Rating" text,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" text,
"Weekly Rank (#)" real
) | What is the timeslot for the episode 'In which Addison finds the magic'? | SELECT "Timeslot (EST)" FROM table_27187 WHERE "Episode" = 'In Which Addison Finds the Magic' |
CREATE TABLE table_42270 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the Catalog with a Date that is march 13, 2002? | SELECT "Catalog" FROM table_42270 WHERE "Date" = 'march 13, 2002' |
CREATE TABLE table_name_14 (
team VARCHAR,
year VARCHAR
) | What is the Team, when the Year is 2011? | SELECT team FROM table_name_14 WHERE year = "2011" |
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... | when is the last time patient 010-9767 visited the hospital in 2105? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '010-9767' AND STRFTIME('%y', patient.hospitaladmittime) = '2105' ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE table_203_496 (
id number,
"pos" number,
"country" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which country comes in first place ? | SELECT "country" FROM table_203_496 WHERE "pos" = 1 |
CREATE TABLE table_23670057_7 (
current_club VARCHAR,
player VARCHAR
) | How many current clubs have the player Aigars Vitols? | SELECT COUNT(current_club) FROM table_23670057_7 WHERE player = "Aigars Vitols" |
CREATE TABLE table_name_56 (
score VARCHAR,
country VARCHAR,
to_par VARCHAR
) | What is Score, when Country is 'United States', and when To Par is '+4'? | SELECT score FROM table_name_56 WHERE country = "united states" AND to_par = "+4" |
CREATE TABLE table_name_3 (
laps VARCHAR,
time_retired VARCHAR,
driver VARCHAR
) | How many laps have a Time/Retired of + 4 laps, and a Driver of graham hill? | SELECT laps FROM table_name_3 WHERE time_retired = "+ 4 laps" AND driver = "graham hill" |
CREATE TABLE table_59233 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | What team lost with 30 tries against? | SELECT "Lost" FROM table_59233 WHERE "Tries against" = '30' |
CREATE TABLE table_21702 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | In what class does the verb with part 4 gelopen belong to? | SELECT "Class" FROM table_21702 WHERE "Part 4" = 'gelopen' |
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... | how many patients were diagnosised as cardiac arrest by long title and had delta lab test results? | 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 = "Cardiac arrest" AND lab.flag = "delta" |
CREATE TABLE table_37072 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
) | What engine class is associated with a year after 1985 and over 0 wins? | SELECT "Class" FROM table_37072 WHERE "Year" > '1985' AND "Wins" > '0' |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilege... | View and Answer count for Habib. | SELECT DISTINCT (p1.Id) AS "Answer Id", p2.ViewCount FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.OwnerUserId = 961113 AND (p1.LastEditDate >= '2016-04-01' OR p1.CreationDate > '2016-04-01') |
CREATE TABLE table_203_74 (
id number,
"rank" number,
"urban area" text,
"population\n(2001 census)" number,
"area (km2)" number,
"density (people/km2)" number,
"major subdivisions" text,
"metropolitan area" text
) | how many urban areas have a density below 2,500 ? | SELECT COUNT("urban area") FROM table_203_74 WHERE "density (people/km2)" < 2500 |
CREATE TABLE table_name_57 (
director VARCHAR,
title VARCHAR,
result VARCHAR
) | Who is the director with the Min Dally Nseek title, and won? | SELECT director FROM table_name_57 WHERE title = "min dally nseek" AND result = "won" |
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 countains that no climber has climbed? | SELECT name FROM mountain WHERE NOT mountain_id IN (SELECT mountain_id FROM climber) |
CREATE TABLE table_49472 (
"Tongan" text,
"Niuean" text,
"S\u0101moan" text,
"Takuu" text,
"Tahitian" text,
"Rarotongan" text,
"M\u0101ori" text,
"North Marquesan" text,
"South Marquesan" text,
"Hawai'ian" text,
"Mangarevan" text
) | Which Tongan has a North Marquesan of /ha e/? | SELECT "Tongan" FROM table_49472 WHERE "North Marquesan" = '/haʔe/' |
CREATE TABLE table_2536 (
"Dateca" text,
"Event #" text,
"Event" text,
"Winner" text,
"Prize" text,
"Entries" text,
"Prize Pool" text,
"Elapsed Time" text
) | Who is the winner with an elapsed time of 12 h 42 min? | SELECT "Winner" FROM table_2536 WHERE "Elapsed Time" = '12 h 42 min' |
CREATE TABLE table_58851 (
"Drug" text,
"Mean" real,
"Pleasure" real,
"Psychological dependence" real,
"Physical dependence" real
) | What is the highest Psychological Dependence, when Pleasure is less than 2.3, when Drug is 'Cannabis', and when Physical Dependence is less than 0.8? | SELECT MAX("Psychological dependence") FROM table_58851 WHERE "Pleasure" < '2.3' AND "Drug" = 'cannabis' AND "Physical dependence" < '0.8' |
CREATE TABLE table_2241841_1 (
manufacturer VARCHAR,
date VARCHAR
) | Who made the car that won the race on May 21? | SELECT manufacturer FROM table_2241841_1 WHERE date = "May 21" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | what were the top four most frequent procedures that patients took within 2 months after receiving prone position in 2105? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prone position' AND STRFTIME('%y', treat... |
CREATE TABLE table_name_4 (
year INTEGER,
rank INTEGER
) | What is the sum of Year, when Rank is less than 19? | SELECT SUM(year) FROM table_name_4 WHERE rank < 19 |
CREATE TABLE table_11111116_6 (
no_in_series INTEGER,
us_viewers__million_ VARCHAR
) | Which episode in the series drew 3.6 million U.S. viewers? | SELECT MIN(no_in_series) FROM table_11111116_6 WHERE us_viewers__million_ = "3.6" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | whats the cost to get a iatrogenc hypotnsion nec diagnosis. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'iatrogenc hypotnsion nec')) |
CREATE TABLE table_55430 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What is the record for the game with an attendance of 35,305? | SELECT "Record" FROM table_55430 WHERE "Attendance" = '35,305' |
CREATE TABLE table_55865 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | On what date was Stauffer Chemical Company (Lemoyne Plant), which was listed on 09/21/1984, deleted? | SELECT "Deleted" FROM table_55865 WHERE "Listed" = '09/21/1984' AND "Name" = 'stauffer chemical company (lemoyne plant)' |
CREATE TABLE table_55752 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | For Jo Siffert, what was the highest grid with the number of laps above 12? | SELECT MAX("Grid") FROM table_55752 WHERE "Driver" = 'jo siffert' AND "Laps" > '12' |
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 TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | flight from DENVER to SALT LAKE CITY | 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 = 'SALT LA... |
CREATE TABLE table_204_455 (
id number,
"rd." number,
"grand prix" text,
"date" text,
"location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"constructor" text,
"report" text
) | how many races occurred before alain prost won a pole position ? | SELECT COUNT(*) FROM table_204_455 WHERE "rd." < (SELECT "rd." FROM table_204_455 WHERE "pole position" = 'alain prost' ORDER BY "rd." LIMIT 1) |
CREATE TABLE table_2527063_3 (
rank INTEGER
) | Name the least rank | SELECT MIN(rank) FROM table_2527063_3 |
CREATE TABLE table_26561 (
"DVD Name" text,
"Ep #" text,
"Region 1 (US)" text,
"Region 1 (CAN)" text,
"Region 2 (UK)" text,
"Region 2 (Germany)" text,
"Region 4 (Australia)" text
) | How many region 4 dates are associated with a region 2 date of July 9, 2007? | SELECT COUNT("Region 4 (Australia)") FROM table_26561 WHERE "Region 2 (UK)" = 'July 9, 2007' |
CREATE TABLE table_name_69 (
game VARCHAR,
opponent VARCHAR,
january VARCHAR
) | What is the total number of games of the team against the Los Angeles Kings after January 5? | SELECT COUNT(game) FROM table_name_69 WHERE opponent = "los angeles kings" AND january > 5 |
CREATE TABLE table_name_30 (
diameter__km_ VARCHAR,
name VARCHAR
) | What's the diameter of kaiwan fluctus? | SELECT diameter__km_ FROM table_name_30 WHERE name = "kaiwan fluctus" |
CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which country came in first with 7 gold medals ? | SELECT "nation" FROM table_204_775 WHERE "gold" = 7 |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | Of the classes , which are available this Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | what does the cost of efavirenz be? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'efavirenz') |
CREATE TABLE table_204_111 (
id number,
"name" text,
"animal type" text,
"introduced" number,
"reintroduced" text,
"retired" number,
"beanie baby resembled" text
) | what is the name of the last pillow pal on this chart ? | SELECT "name" FROM table_204_111 ORDER BY id DESC LIMIT 1 |
CREATE TABLE table_78527 (
"Superlative" text,
"Actor" text,
"Record Set" text,
"Year" text,
"Notes" text
) | What are the notes in 1981? | SELECT "Notes" FROM table_78527 WHERE "Year" = '1981' |
CREATE TABLE table_26354 (
"Team" text,
"Location" text,
"Home Ground" text,
"First year in Qld Cup" real,
"Last year in Qld Cup" real,
"Qld Cup Premierships" text
) | What is every entry in the QLD Cup Premierships when home ground is Dairy Farmers Stadium? | SELECT "Qld Cup Premierships" FROM table_26354 WHERE "Home Ground" = 'Dairy Farmers Stadium' |
CREATE TABLE table_name_41 (
oklahoma VARCHAR,
nebraska VARCHAR,
year VARCHAR
) | What is the oklahoma has Bush from Nebraska in year 2004? | SELECT oklahoma FROM table_name_41 WHERE nebraska = "bush" AND year = "2004" |
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | Draw a bar chart for what are the id and name of the mountains that have at least 2 photos? | SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id |
CREATE TABLE table_35294 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL team" text,
"College/Junior/Club Team (League)" text
) | which NHL team has a College/Junior/Club Team (League) of shattuck-saint mary's school (midget major aaa)? | SELECT "NHL team" FROM table_35294 WHERE "College/Junior/Club Team (League)" = 'shattuck-saint mary''s school (midget major aaa)' |
CREATE TABLE table_39972 (
"Year" real,
"Venue" text,
"Winner" text,
"Country" text,
"Score" text
) | Which Score has a Country of england, and a Year larger than 1971? | SELECT "Score" FROM table_39972 WHERE "Country" = 'england' AND "Year" > '1971' |
CREATE TABLE table_45782 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Tie number for the match that had away team of Scunthorpe & Lindsey United? | SELECT "Tie no" FROM table_45782 WHERE "Away team" = 'scunthorpe & lindsey united' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.