table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTas... | Top questions by Bayesian rating. | SELECT Id AS "post_link", upvotes, downvotes, Score, (upvotes + (AVG(upvotes) OVER ())) / (upvotes + downvotes + (AVG(upvotes + downvotes) OVER ())) AS br FROM (SELECT p.Id, COUNT(CASE v.VoteTypeId WHEN 2 THEN 1 ELSE NULL END) AS upvotes, COUNT(CASE v.VoteTypeId WHEN 3 THEN 1 ELSE NULL END) AS downvotes, MAX(p.Score) A... |
CREATE TABLE table_30888 (
"Code" text,
"Subdivision name ( be ) (BGN/PCGN)" text,
"Subdivision name ( be ) (GOST)" text,
"Subdivision name ( ru ) (BGN/PCGN)" text,
"Subdivision name ( ru ) (GOST)" text,
"Subdivision category" text
) | Which codes have subdivision names (BE) (BGN) of Homyel'skaya Voblasts'? | SELECT "Code" FROM table_30888 WHERE "Subdivision name ( be ) (BGN/PCGN)" = 'Homyel''skaya voblasts' |
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_de... | How many staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's last name, order the number of last name in descending order. | SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY COUNT(last_name) DESC |
CREATE TABLE table_name_23 (
tv_time VARCHAR,
date VARCHAR
) | Which TV Time has a Date of january 2, 2005? | SELECT tv_time FROM table_name_23 WHERE date = "january 2, 2005" |
CREATE TABLE table_30574 (
"School" text,
"Gender" text,
"Age Range" text,
"Religious Affiliation" text,
"Location" text,
"School website" text
) | What is the gender of the school which has the website http://www.nicholasbreakspearschool.co.uk/? | SELECT "Gender" FROM table_30574 WHERE "School website" = 'http://www.nicholasbreakspearschool.co.uk/' |
CREATE TABLE table_44119 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
) | What is the rank of the film directed by Kevin Costner? | SELECT COUNT("Rank") FROM table_44119 WHERE "Director" = 'kevin costner' |
CREATE TABLE table_46062 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the average game number that was on october 19? | SELECT AVG("Game") FROM table_46062 WHERE "October" = '19' |
CREATE TABLE table_name_15 (
craft VARCHAR,
location VARCHAR
) | What is the Craft used at Coniston Water? | SELECT craft FROM table_name_15 WHERE location = "coniston water" |
CREATE TABLE table_26996293_3 (
cfl_team VARCHAR,
college VARCHAR
) | How many CFL teams drafted someone from mount allison college? | SELECT COUNT(cfl_team) FROM table_26996293_3 WHERE college = "Mount Allison" |
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 year of death is less than or equal to 2122 and drug code is beth5? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "BETH5" |
CREATE TABLE table_65419 (
"Branding" text,
"Call-Sign" text,
"Frequency" text,
"Power (kw)" text,
"Location" text
) | What's the location when the branding is 1116 DXAS Zamboanga? | SELECT "Location" FROM table_65419 WHERE "Branding" = '1116 dxas zamboanga' |
CREATE TABLE table_name_33 (
points INTEGER,
extra_points VARCHAR,
field_goals VARCHAR
) | Who had a points average with 0 extra points and 0 field goals? | SELECT AVG(points) FROM table_name_33 WHERE extra_points = 0 AND field_goals > 0 |
CREATE TABLE table_name_79 (
share_of_seats VARCHAR,
european_election__uk_ VARCHAR
) | Which Share of seats has a European election (UK) of 2009? | SELECT share_of_seats FROM table_name_79 WHERE european_election__uk_ = 2009 |
CREATE TABLE table_name_7 (
date VARCHAR,
venue VARCHAR
) | Which date held the match at the City Stadium, Georgetown? | SELECT date FROM table_name_7 WHERE venue = "city stadium, georgetown" |
CREATE TABLE table_72197 (
"Target" text,
"Target Code (Allied)" text,
"Luftwaffe unit (wing)" text,
"Allied forces" text,
"Effect on Allied Squadrons (according to official figures)" text
) | Which Allied Force targetted Woensdrecht? | SELECT "Allied forces" FROM table_72197 WHERE "Target" = 'Woensdrecht' |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookin... | Find the number of booking start date for the apartments that have more than two bedrooms for each weekday in a bar chart. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 |
CREATE TABLE table_name_24 (
team VARCHAR,
laps VARCHAR,
driver VARCHAR
) | What team had 10 Labs and the Driver was Alex Yoong? | SELECT team FROM table_name_24 WHERE laps = 10 AND driver = "alex yoong" |
CREATE TABLE table_35500 (
"Date" text,
"Home Team" text,
"Score" text,
"Away Team" text,
"Venue" text
) | What was the score at Spartan Stadium when San Jose was the Home team? | SELECT "Score" FROM table_35500 WHERE "Home Team" = 'san jose' AND "Venue" = 'spartan stadium' |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number... | on 07/28/2102, when was the last time that the arterial bp [diastolic] of patient 21454 was greater than 52.0? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21454)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... |
CREATE TABLE table_48673 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what is the score on march 8? | SELECT "Score" FROM table_48673 WHERE "Date" = 'march 8' |
CREATE TABLE table_64785 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of the bronze medals when there were less than 8 total medals, 0 silver medals and a rank of 9? | SELECT SUM("Bronze") FROM table_64785 WHERE "Total" < '8' AND "Rank" = '9' AND "Silver" < '0' |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst t... | What are the country of product origins where pesticide residues were not detected? | SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk WHERE T2.concen = "0" GROUP BY T1.country |
CREATE TABLE table_name_23 (
silver VARCHAR,
gold VARCHAR,
bronze VARCHAR,
total VARCHAR,
rank VARCHAR
) | How many times is the total less than 15, rank less than 5, bronze is 4 and gold smaller than 3? | SELECT COUNT(silver) FROM table_name_23 WHERE total < 15 AND rank < 5 AND bronze = 4 AND gold < 3 |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE... | Show the number of accounts opened in each day. Bin the account open day by weekday and group by other account details in a stacked bar chart. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details |
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE products (
product_id number,
color_code text,
product_category_code text,
product_name text,
typical_buying_price text,
typical_selling_price text,
product_description text,
other_product_details t... | What are all the characteristic names of product 'sesame'? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" |
CREATE TABLE table_name_59 (
semi_finalist__number2 VARCHAR,
year VARCHAR
) | Who was the Semi-Finalist #2 in 2007? | SELECT semi_finalist__number2 FROM table_name_59 WHERE year = "2007" |
CREATE TABLE table_30288 (
"Religion" text,
"Births" real,
"Conversions" text,
"New adherents per year" real,
"Growth rate" text
) | Name the number of new adherents per year for confucianism | SELECT COUNT("New adherents per year") FROM table_30288 WHERE "Religion" = 'Confucianism' |
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... | what is average age of patients whose gender is m and days of hospital stay is 27? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "27" |
CREATE TABLE table_name_48 (
rank VARCHAR,
studio VARCHAR
) | What is the total number of ranks that had vestron as the studio? | SELECT COUNT(rank) FROM table_name_48 WHERE studio = "vestron" |
CREATE TABLE table_14650162_1 (
pick__number VARCHAR,
position VARCHAR
) | How many picks played Tight end? | SELECT COUNT(pick__number) FROM table_14650162_1 WHERE position = "Tight End" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | how many patients since 3 years ago were diagnosed with s/p thyroid surgery after antiarrhythmics - class iii antiarrhythmic within 2 months? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiarrhythmics - class iii antiarrhythmic' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME()... |
CREATE TABLE table_36704 (
"Conference" text,
"Division" text,
"Team" text,
"City" text,
"Home Stadium" text
) | Which Division does the City being jacksonville, florida belong to? | SELECT "Division" FROM table_36704 WHERE "City" = 'jacksonville, florida' |
CREATE TABLE table_29565541_2 (
stolen_ends INTEGER,
l VARCHAR
) | When 5 is the l what is the lowest amount of stolen ends? | SELECT MIN(stolen_ends) FROM table_29565541_2 WHERE l = 5 |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name... | Show me a bar chart for what is the id and trade name of the medicines can interact with at least 3 enzymes?, sort total number in ascending order please. | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id |
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE ... | return me the number of citations of ' Making database systems usable ' in each year . | SELECT year, SUM(citation_num) FROM publication WHERE title = 'Making database systems usable' GROUP BY year |
CREATE TABLE table_name_41 (
world_record VARCHAR
) | What's the 123kg of the Total world record? | SELECT 123 AS kg FROM table_name_41 WHERE world_record = "total" |
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 demographic ... | what is the primary disease and procedure icd9 code of subject id 74463? | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "74463" |
CREATE TABLE table_name_38 (
result VARCHAR,
date VARCHAR
) | What was the result of the game that was played on february 27, 2000? | SELECT result FROM table_name_38 WHERE date = "february 27, 2000" |
CREATE TABLE table_41820 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
) | Who is the visitor when the record is 2-1? | SELECT "Visitor" FROM table_41820 WHERE "Record" = '2-1' |
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... | what number of patients given the drug ciprofloxacin were male? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Ciprofloxacin" |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean... | Of questions that have upvoted answers, how many have accepted answers?. | SELECT a.Id AS "Answer ID", p.Id AS "Question ID", p.Title AS "Title" FROM Posts AS p JOIN Posts AS a ON p.Id = a.ParentId WHERE p.PostTypeId = 1 AND a.OwnerUserId = '##UserId:int##' AND a.Score >= '##MinAnswerScore:int##' AND a.Id != p.AcceptedAnswerId |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
) | How many climbers are from each country, and sort by the Y in ascending. | SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY COUNT(*) |
CREATE TABLE table_7216 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the total number of points where there were 3 losses and a played number bigger than 12? | SELECT SUM("Points") FROM table_7216 WHERE "Lost" = '3' AND "Played" > '12' |
CREATE TABLE table_name_36 (
damage__millions_usd__ VARCHAR,
min_press___mbar__ VARCHAR,
deaths VARCHAR
) | What is the cost of 972 Min Press caused 52 death? | SELECT damage__millions_usd__ FROM table_name_36 WHERE min_press___mbar__ = "972" AND deaths = "52" |
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... | what is marital status and admission type of subject id 15898? | SELECT demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.subject_id = "15898" |
CREATE TABLE table_5682 (
"Gauge" text,
"Railway" text,
"Class" text,
"Works no." text,
"Year" text,
"Builder" text
) | Which railway has a class of 250 and year 1936? | SELECT "Railway" FROM table_5682 WHERE "Class" = '250' AND "Year" = '1936' |
CREATE TABLE table_25800134_2 (
writer_s_ VARCHAR,
season__number VARCHAR
) | Who are all the writers of episodes in season 24? | SELECT writer_s_ FROM table_25800134_2 WHERE season__number = 24 |
CREATE TABLE table_26473176_1 (
series VARCHAR,
position VARCHAR
) | How many 'series' were in the 12th 'position? | SELECT COUNT(series) FROM table_26473176_1 WHERE position = "12th" |
CREATE TABLE table_26591434_1 (
ratings__kansai_ VARCHAR,
original_airdate VARCHAR
) | What is the ratings for the original air date may 25, 2010 22.00 - 22.54? | SELECT ratings__kansai_ FROM table_26591434_1 WHERE original_airdate = "May 25, 2010 22.00 - 22.54" |
CREATE TABLE table_29135051_3 (
guest_s_ VARCHAR,
ratings VARCHAR
) | who guest starred on the episode with a 1.44m rating | SELECT guest_s_ FROM table_29135051_3 WHERE ratings = "1.44m" |
CREATE TABLE table_11545282_7 (
years_for_jazz VARCHAR,
player VARCHAR
) | How many years did Paul Griffin play for the Jazz? | SELECT COUNT(years_for_jazz) FROM table_11545282_7 WHERE player = "Paul Griffin" |
CREATE TABLE table_name_4 (
genre VARCHAR,
type VARCHAR,
developer_s_ VARCHAR
) | What type of 3D game did Valve Corporation release? | SELECT genre FROM table_name_4 WHERE type = "3d" AND developer_s_ = "valve corporation" |
CREATE TABLE table_16799784_8 (
year_named INTEGER,
latitude VARCHAR
) | In what year was the feature at a 33.3S latitude named? | SELECT MAX(year_named) FROM table_16799784_8 WHERE latitude = "33.3S" |
CREATE TABLE table_204_443 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number,
"bye" text
) | total number of attendees at the two games against the new england patriots during the season | SELECT SUM("attendance") FROM table_204_443 WHERE "opponent" = 'new england patriots' |
CREATE TABLE table_name_62 (
type VARCHAR,
position VARCHAR,
location VARCHAR
) | what is the type when the position is ambassador and the location is rabat? | SELECT type FROM table_name_62 WHERE position = "ambassador" AND location = "rabat" |
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... | provide the number of patients whose death status is 0 and diagnoses icd9 code is 4260? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "4260" |
CREATE TABLE table_name_16 (
country VARCHAR,
olympics VARCHAR,
name VARCHAR
) | Which country in the 2008 summer olympics is vadim devyatovskiy from? | SELECT country FROM table_name_16 WHERE olympics = "2008 summer olympics" AND name = "vadim devyatovskiy" |
CREATE TABLE table_204_100 (
id number,
"date" text,
"name of ship" text,
"nationality" text,
"tonnage" number,
"fate" text
) | what is the difference in tonnage between the heaviest and the lightest ships ? | SELECT MAX("tonnage") - MIN("tonnage") FROM table_204_100 |
CREATE TABLE table_name_43 (
opponents VARCHAR,
partner VARCHAR,
date VARCHAR
) | Tell me the opponents for mashona washington november 21, 2009 | SELECT opponents FROM table_name_43 WHERE partner = "mashona washington" AND date = "november 21, 2009" |
CREATE TABLE table_name_28 (
away_team VARCHAR,
home_team VARCHAR
) | who is the away team when the home team is sydney spirit? | SELECT away_team FROM table_name_28 WHERE home_team = "sydney spirit" |
CREATE TABLE table_66474 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What power has A as the class, and 93.7 as the frequency? | SELECT "Power" FROM table_66474 WHERE "Class" = 'a' AND "Frequency" = '93.7' |
CREATE TABLE table_name_13 (
australian_marquee VARCHAR,
captain VARCHAR
) | What Australian Marquee team is Michael Beauchamp a captain of? | SELECT australian_marquee FROM table_name_13 WHERE captain = "michael beauchamp" |
CREATE TABLE table_1480455_1 (
population__2005_ VARCHAR,
population_density___km_2__ VARCHAR
) | What is the total number of population in the year 2005 where the population density 35.9 (/km 2)? | SELECT COUNT(population__2005_) FROM table_1480455_1 WHERE population_density___km_2__ = "35.9" |
CREATE TABLE table_204_576 (
id number,
"year" number,
"best" text,
"location" text,
"date" text,
"world rank" text
) | which location has the best time other than brussels ? | SELECT "location" FROM table_204_576 WHERE "location" <> 'brussels' ORDER BY "best" LIMIT 1 |
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 drug name of drug code nalo4i. | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NALO4I" |
CREATE TABLE table_31057 (
"Episode" real,
"Airdate" text,
"Iron Chef" text,
"Challenger" text,
"Theme Ingredient" text,
"Winner" text
) | What date did the episode air when guy grossi won? | SELECT "Airdate" FROM table_31057 WHERE "Winner" = 'Guy Grossi' |
CREATE TABLE table_28262 (
"AB - Angry boar" text,
"B - Bishop" text,
"BA - Running Bear" text,
"BB - Blind Bear" text,
"BC - Beast Cadet" text
) | what is b - bishop where ab - angry boar is vw - vertical wolf? | SELECT "B - Bishop" FROM table_28262 WHERE "AB - Angry boar" = 'VW - Vertical Wolf' |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide nu... | How many movie directors are there? | SELECT COUNT(DISTINCT director) FROM movie |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End... | Plot the number of payment method code by grouped by payment method code as a bar graph, and list by the total number from high to low. | SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(Payment_Method_Code) DESC |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | Return a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, sort by the X-axis from high to low. | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC |
CREATE TABLE table_1997759_1 (
location VARCHAR,
last_flew VARCHAR
) | at what location is the last flew on 11 june 2000 | SELECT location FROM table_1997759_1 WHERE last_flew = "11 June 2000" |
CREATE TABLE table_189598_7 (
population_density__per_km²_ VARCHAR,
name VARCHAR
) | When buffalo narrows is the name how many measurements of population density per kilometer squared are there? | SELECT COUNT(population_density__per_km²_) FROM table_189598_7 WHERE name = "Buffalo Narrows" |
CREATE TABLE table_25375093_1 (
season VARCHAR,
position VARCHAR
) | Name the season for position 4th | SELECT COUNT(season) FROM table_25375093_1 WHERE position = "4th" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is the number of patients who died in or before 2122 and lab test is prot.electrophoresis urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2122.0" AND lab.label = "Prot. Electrophoresis, Urine" |
CREATE TABLE table_name_37 (
score VARCHAR,
attendance VARCHAR
) | What is the score of the game with 1,125 people in attendance? | SELECT score FROM table_name_37 WHERE attendance = "1,125" |
CREATE TABLE table_name_69 (
nominee_s_ VARCHAR,
year VARCHAR,
result VARCHAR
) | Which nominees won before year 2005? | SELECT nominee_s_ FROM table_name_69 WHERE year < 2005 AND result = "won" |
CREATE TABLE table_name_18 (
opponent VARCHAR,
date VARCHAR
) | What is Opponent, when Date is 8 April 1999? | SELECT opponent FROM table_name_18 WHERE date = "8 april 1999" |
CREATE TABLE table_name_44 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
) | Who is the player from Spain that has a +2 to par? | SELECT player FROM table_name_44 WHERE to_par = "+2" AND country = "spain" |
CREATE TABLE table_65764 (
"Ship name" text,
"Year built" real,
"Length" text,
"Crew" real,
"Guests" real,
"Staterooms" real,
"Comments" text
) | What is the total for guests with a ship name of rv indochina, and a crew smaller than 28? | SELECT COUNT("Guests") FROM table_65764 WHERE "Ship name" = 'rv indochina' AND "Crew" < '28' |
CREATE TABLE table_name_60 (
venue VARCHAR,
runs VARCHAR
) | During runs 332, what was the venue? | SELECT venue FROM table_name_60 WHERE runs = "332" |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Give me the comparison about the average of meter_100 over the Nationality , and group by attribute Nationality by a bar chart, and sort by the names from high to low. | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx tex... | since 2104, what are the top three most frequent lab tests ordered for patients in the same hospital encounter after having received 1 int mam-cor art bypass? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i... |
CREATE TABLE table_name_17 (
zone_2008 VARCHAR,
services VARCHAR,
station VARCHAR
) | Which Zone 2008 has Services of greater anglia, and a Station of cheshunt? | SELECT zone_2008 FROM table_name_17 WHERE services = "greater anglia" AND station = "cheshunt" |
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... | Calculate the average age of unmarried patients born after the year 2097 | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2097" |
CREATE TABLE table_40166 (
"School" text,
"Location" text,
"Enrolment" real,
"Founded" real,
"Denomination" text,
"Boys/Girls" text,
"Day/Boarding" text,
"Year Entered Competition" real,
"School Colors" text
) | Which boys' school wears Royal Blue and Gold and entered the competition in 1929? | SELECT "School" FROM table_40166 WHERE "Boys/Girls" = 'boys' AND "Year Entered Competition" = '1929' AND "School Colors" = 'royal blue and gold' |
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 minimum weights for people of each sex? Show a bar chart, sort from low to high by the x-axis. | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex |
CREATE TABLE table_name_14 (
theme VARCHAR,
year VARCHAR,
issue_price VARCHAR
) | What theme is associated with a year before 2006 and Issue Price of $25.22? | SELECT theme FROM table_name_14 WHERE year < 2006 AND issue_price = "$25.22" |
CREATE TABLE table_79078 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What is Venue, when Status is 'Test Match', and when Against is '12'? | SELECT "Venue" FROM table_79078 WHERE "Status" = 'test match' AND "Against" = '12' |
CREATE TABLE table_328 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What player attended Loyola Marymount? | SELECT "Player" FROM table_328 WHERE "School/Club Team/Country" = 'Loyola Marymount' |
CREATE TABLE table_43253 (
"Tournament" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What 2002 tournament has 2008 career statistics? | SELECT "2002" FROM table_43253 WHERE "2008" = 'career statistics' |
CREATE TABLE table_35312 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the Location Attendance when the Date was February 27? | SELECT "Location Attendance" FROM table_35312 WHERE "Date" = 'february 27' |
CREATE TABLE table_name_23 (
rating VARCHAR,
viewers__households_in_millions_ VARCHAR
) | What was the rating of the season that had 18.17 million household viewers? | SELECT rating FROM table_name_23 WHERE viewers__households_in_millions_ = "18.17" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | what is the length of stay of patient 002-56583 for the last intensive care unit stay? | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-56583') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 |
CREATE TABLE table_22871239_5 (
high_rebounds VARCHAR,
_number VARCHAR
) | How many high rebound catagories are listed for game number 5? | SELECT COUNT(high_rebounds) FROM table_22871239_5 WHERE _number = 5 |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | all votes and accepts users have cast for all your posts. | SELECT TotalUpVotes = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), TotalDownVotes = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END), Accepts = SUM(CASE WHEN VoteTypeId = 1 THEN 1 ELSE 0 END) FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.OwnerUserId = '##UserId##' |
CREATE TABLE table_42284 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was 2011, when 2005 was 2R, and when 2003 was 2R? | SELECT "2011" FROM table_42284 WHERE "2005" = '2r' AND "2003" = '2r' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | how many days has it been since the last time patient 011-55642's procedure during the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55642'... |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Return a bar chart about the distribution of name and ID , display from low to high by the x axis. | SELECT name, ID FROM swimmer ORDER BY name |
CREATE TABLE table_15941 (
"Season" real,
"Timeslot ( ET )" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Rank" text,
"Viewers (millions)" text
) | What is the season year where the rank is 39? | SELECT "TV season" FROM table_15941 WHERE "Rank" = '39' |
CREATE TABLE table_name_55 (
fiscal_year INTEGER,
headquarters VARCHAR,
employees VARCHAR
) | What is the average Fiscal Year of the firm Headquartered in noida, with less than 85,335 employees? | SELECT AVG(fiscal_year) FROM table_name_55 WHERE headquarters = "noida" AND employees < 85 OFFSET 335 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.