table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_45 (
location VARCHAR,
fc_matches VARCHAR
) | Where was the FC match with a score of 12 played? | SELECT location FROM table_name_45 WHERE fc_matches = "12" |
CREATE TABLE table_66333 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | For the Cage Combat Fighting Championships: Mayhem, what was the record? | SELECT "Record" FROM table_66333 WHERE "Event" = 'cage combat fighting championships: mayhem' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
... | what was the first height of patient 9294 this month. | SELECT chartevents.valuenum 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 = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ... |
CREATE TABLE table_53231 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What city was a visitor on the date of April 30? | SELECT "Visitor" FROM table_53231 WHERE "Date" = 'april 30' |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | when did patient 009-12985 the last time had urine catheter output until 2045 days ago? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12985')) AND intakeoutput.cellpath LIKE '%output%... |
CREATE TABLE table_36305 (
"Tournament" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text
) | Which 992 has a 1 2 of 1989 ? | SELECT "1992" FROM table_36305 WHERE "1989" = '1–2' |
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location tex... | What are the names of shops in ascending order of open year? | SELECT shop_name FROM shop ORDER BY open_year |
CREATE TABLE table_name_71 (
rider VARCHAR,
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Who was the rider for laps less than 23 with grid greater than 21 that had a time of +1 lap? | SELECT rider FROM table_name_71 WHERE laps < 23 AND grid > 21 AND time_retired = "+1 lap" |
CREATE TABLE table_name_33 (
tournament VARCHAR
) | Name the 2010 for 2008 of 1r and tournament of us open | SELECT 2010 FROM table_name_33 WHERE 2008 = "1r" AND 2011 = "1r" AND tournament = "us open" |
CREATE TABLE table_59903 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | Who is the player that has scored more than 0 league cup goals, but has than 13 total goals, and 4 league cup appearances total? | SELECT "Name" FROM table_59903 WHERE "League Cup Goals" > '0' AND "Total Goals" < '13' AND "League Cup Apps" = '4' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose first name is ending with the letter m, show the frequency of the first name using a bar chart, and rank total number in ascending order. | SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY COUNT(FIRST_NAME) |
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... | count the number of patients whose primary disease is abdominal pain and admission year is less than 2173? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.admityear < "2173" |
CREATE TABLE table_51813 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What location was f bio maldonado the opponent at? | SELECT "Location" FROM table_51813 WHERE "Opponent" = 'fábio maldonado' |
CREATE TABLE table_45124 (
"Event" text,
"2006\u201307" text,
"2009\u201310" text,
"2010\u201311" text,
"2011\u201312" text,
"2012\u201313" text
) | what is 2012-13 when 2011-12 is dnp and event is autumn gold? | SELECT "2012\u201313" FROM table_45124 WHERE "2011\u201312" = 'dnp' AND "Event" = 'autumn gold' |
CREATE TABLE table_46393 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the most points in the game on November 12? | SELECT "High points" FROM table_46393 WHERE "Date" = 'november 12' |
CREATE TABLE table_name_79 (
catalog VARCHAR,
format VARCHAR,
label VARCHAR
) | What is the Catalog number of the CD Reissue Universal release? | SELECT catalog FROM table_name_79 WHERE format = "cd reissue" AND label = "universal" |
CREATE TABLE table_27539535_4 (
points INTEGER
) | What is the least amount of points? | SELECT MIN(points) FROM table_27539535_4 |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Sal... | Show all dates of transactions whose type code is 'SALE', and count them by a bar chart | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" |
CREATE TABLE table_name_11 (
time VARCHAR,
opponent VARCHAR
) | Which time has eddie miller as opponent? | SELECT time FROM table_name_11 WHERE opponent = "eddie miller" |
CREATE TABLE table_name_26 (
laps INTEGER,
year VARCHAR
) | How many laps were done in 2012? | SELECT SUM(laps) FROM table_name_26 WHERE year = 2012 |
CREATE TABLE table_201_39 (
id number,
"no" number,
"title" text,
"directed by" text,
"released" number
) | who directed the most cartoons ? | SELECT "directed by" FROM table_201_39 GROUP BY "directed by" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_1342426_3 (
result VARCHAR,
incumbent VARCHAR
) | What was the result when incumbent John R. Tyson was elected? | SELECT result FROM table_1342426_3 WHERE incumbent = "John R. Tyson" |
CREATE TABLE table_name_81 (
first_match VARCHAR,
last_match VARCHAR
) | On what date was the first match for the competition that ended its last match on December 16, 2007? | SELECT first_match FROM table_name_81 WHERE last_match = "december 16, 2007" |
CREATE TABLE table_20673 (
"State" text,
"Preliminary Average" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Semifinal Average" text
) | What was the evening gown score for the one who had a preliminary average of 8.121 (8)? | SELECT "Evening Gown" FROM table_20673 WHERE "Preliminary Average" = '8.121 (8)' |
CREATE TABLE table_name_77 (
played VARCHAR,
points_for VARCHAR
) | What is the number Played that has 310 Points for? | SELECT played FROM table_name_77 WHERE points_for = "310" |
CREATE TABLE table_57332 (
"Council" text,
"2003 result" text,
"Notional control (based on 2003 results)" text,
"2007 result" text,
"Details" text
) | What's the 2007 result when the notional control is noc and the 2003 result is snp? | SELECT "2007 result" FROM table_57332 WHERE "Notional control (based on 2003 results)" = 'noc' AND "2003 result" = 'snp' |
CREATE TABLE table_49618 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
) | What is the No. 8 of the person with a No. 4 of Noah? | SELECT "No. 8" FROM table_49618 WHERE "No. 4" = 'noah' |
CREATE TABLE table_name_84 (
song_title VARCHAR,
movie VARCHAR
) | What was the name of the song in Amma Cheppindi? | SELECT song_title FROM table_name_84 WHERE movie = "amma cheppindi" |
CREATE TABLE table_name_33 (
rank VARCHAR,
year VARCHAR
) | What is the rank for 1961? | SELECT rank FROM table_name_33 WHERE year = "1961" |
CREATE TABLE table_36623 (
"Fraction" text,
"Ellipsis" text,
"Vinculum" text,
"Dots" text,
"Parentheses" text
) | What fraction has parentheses of 0.(3)? | SELECT "Fraction" FROM table_36623 WHERE "Parentheses" = '0.(3)' |
CREATE TABLE Document_Sections_Images (
section_id INTEGER,
image_id INTEGER
)
CREATE TABLE Documents (
document_code VARCHAR(15),
document_structure_code VARCHAR(15),
document_type_code VARCHAR(15),
access_count INTEGER,
document_name VARCHAR(80)
)
CREATE TABLE Images (
image_id INTEG... | what are the different role codes for users, and how many users have each?, and sort from high to low by the Y. | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY COUNT(*) DESC |
CREATE TABLE table_228973_11 (
no_in_series VARCHAR,
directed_by VARCHAR
) | David James Elliott directed which episode number within the series? | SELECT no_in_series FROM table_228973_11 WHERE directed_by = "David James Elliott" |
CREATE TABLE table_2066 (
"Role" text,
"Original Broadway Cast" text,
"Current Broadway Cast" text,
"Original Toronto Cast" text,
"First National Tour Cast" text,
"Original Australian Cast" text,
"Original West End Cast" text,
"Current West End Cast" text,
"Second National Tour Cast"... | What member of the current Broadway cast plays the character played by Constantine Maroulis from the original Broadway cast? | SELECT "Current Broadway Cast" FROM table_2066 WHERE "Original Broadway Cast" = 'Constantine Maroulis' |
CREATE TABLE table_203_771 (
id number,
"#" number,
"artist" text,
"featuring" text,
"title" text,
"version" text,
"length" text
) | how many tracks are there on the 2005 best of benassi bros. album ? | SELECT COUNT("title") FROM table_203_771 |
CREATE TABLE table_name_60 (
director VARCHAR,
language VARCHAR
) | Who directed the Romanian film? | SELECT director FROM table_name_60 WHERE language = "romanian" |
CREATE TABLE table_name_31 (
opponent VARCHAR,
week VARCHAR
) | Who were the opponents for week 12? | SELECT opponent FROM table_name_31 WHERE week = 12 |
CREATE TABLE table_name_97 (
height__m_ INTEGER,
name VARCHAR,
ave__no VARCHAR
) | Which Height (m) has a Name of plessur alps, and a AVE-No larger than 63? | SELECT MIN(height__m_) FROM table_name_97 WHERE name = "plessur alps" AND ave__no > 63 |
CREATE TABLE table_6750 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest number of silver medals with a rank of 4 and total medals greater than 1? | SELECT MIN("Silver") FROM table_6750 WHERE "Rank" = '4' AND "Total" > '1' |
CREATE TABLE table_test_32 (
"id" int,
"anemia" bool,
"symptomatic_disease" bool,
"language" string,
"deceased" bool,
"abdominal_pain" bool,
"fever" bool,
"arthralgia" bool,
"unable_provide_consent" bool,
"headache" bool,
"myalgia" bool,
"rash" bool,
"thrombocytopenia... | patients who meet any of the following criteria will not be enrolled in the study: < 18 years of age, non _ english speakers, deceased at time of survey, and / or unable to provide consent | SELECT * FROM table_test_32 WHERE age < 18 OR language <> 'english' OR deceased = 1 OR unable_provide_consent = 1 |
CREATE TABLE table_17622423_12 (
high_assists VARCHAR,
date VARCHAR
) | Name the high assists for may 21 | SELECT high_assists FROM table_17622423_12 WHERE date = "May 21" |
CREATE TABLE table_31770 (
"Nationality" text,
"No [a ]" text,
"Pos [a ]" text,
"From" text,
"School/club" text,
"Pts [b ]" real,
"Reb [b ]" real,
"Ast [b ]" real
) | What is the points that is more than 636 and has a value of 50? | SELECT "Pts [b ]" FROM table_31770 WHERE "Reb [b ]" > '636' AND "No [a ]" = '50' |
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,... | provide the number of patients admitted prematurely via clinic referral who have procedure icd9 code 4573. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4573" |
CREATE TABLE table_55158 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | What is the toal rec with more than 27 and averages less than 10.8 and TDs more than 6? | SELECT COUNT("Long") FROM table_55158 WHERE "Rec." > '27' AND "Avg." < '10.8' AND "TD's" > '6' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | patient 004-86136 was prescribed 1000 ml bag : lactated ringers iv solp since 02/2105? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND medication.drugname = '1000 ml bag : lactated ringers iv ... |
CREATE TABLE table_name_1 (
method VARCHAR,
record VARCHAR
) | Tell me the method with a record of 4-2 | SELECT method FROM table_name_1 WHERE record = "4-2" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diag... | tell me the percentile of rdw worth 13.4 for patients of the same age as patient 84346 during the last hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE... |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | For each movie that received more than 3 reviews, what is the average rating? | SELECT mid, AVG(stars) FROM rating GROUP BY mid HAVING COUNT(*) >= 2 |
CREATE TABLE table_31808 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Tell me the result for 2008-12-23 | SELECT "Result" FROM table_31808 WHERE "Date" = '2008-12-23' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by time. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
CREATE TABLE table_8528 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | Which player lost more than 12? | SELECT COUNT("Lost") FROM table_8528 WHERE "Played" > '12' |
CREATE TABLE table_40479 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | How many wins are related to events of 7 and more than 2 top-10s? | SELECT COUNT("Wins") FROM table_40479 WHERE "Events" = '7' AND "Top-10" > '2' |
CREATE TABLE table_10812403_4 (
position VARCHAR,
player VARCHAR
) | What position did Calvin Mccarty play? | SELECT position FROM table_10812403_4 WHERE player = "Calvin McCarty" |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what is the number of days since patient 99883 received the last potassium chloride prescription in the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'potassium chloride' ORDER BY prescriptions.st... |
CREATE TABLE table_name_31 (
lane INTEGER,
rank VARCHAR,
nationality VARCHAR
) | What is the highest lane with a rank larger than 2 in Guyana? | SELECT MAX(lane) FROM table_name_31 WHERE rank > 2 AND nationality = "guyana" |
CREATE TABLE table_6890 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What was the lowest Top-10, when the Wins were 0, when the Top-25 was 12, and when the Events were less than 23? | SELECT MIN("Top-10") FROM table_6890 WHERE "Wins" = '0' AND "Top-25" = '12' AND "Events" < '23' |
CREATE TABLE table_name_68 (
year INTEGER,
winner VARCHAR
) | What is the most recent year that Iftiraas was the winner? | SELECT MAX(year) FROM table_name_68 WHERE winner = "iftiraas" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
... | calculate the total dosage of albumin 25% taken from patient 28443 since 11/17/2104. | SELECT SUM(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 = 28443)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... |
CREATE TABLE table_63334 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronze medals did the team have with 0 total silver and less than 3 total medals? | SELECT "Bronze" FROM table_63334 WHERE "Total" < '3' AND "Silver" > '0' |
CREATE TABLE table_name_21 (
year INTEGER,
length VARCHAR
) | What is the earliest year having a length of 11:25? | SELECT MIN(year) FROM table_name_21 WHERE length = "11:25" |
CREATE TABLE table_71180 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the highest place of a swimmer from the Netherlands? | SELECT MAX("Rank") FROM table_71180 WHERE "Nationality" = 'netherlands' |
CREATE TABLE table_26039 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" text,
"U.S. Viewers (in millions)" text
) | Who directed the episode with production code 208? | SELECT "Directed by" FROM table_26039 WHERE "Prod. code" = '208' |
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, show me about the distribution of name and code , and group by attribute founder in a bar chart, I want to sort in descending by the Code. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code DESC |
CREATE TABLE trip (
start_station_name VARCHAR,
duration INTEGER
) | List all the distinct stations from which a trip of duration below 100 started. | SELECT DISTINCT start_station_name FROM trip WHERE duration < 100 |
CREATE TABLE table_16641 (
"Rd." real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Constructor" text,
"Report" text
) | What is the fastest lap for the european grand prix? | SELECT "Fastest Lap" FROM table_16641 WHERE "Grand Prix" = 'European Grand Prix' |
CREATE TABLE customers (
first_name VARCHAR,
last_name VARCHAR,
id VARCHAR
)
CREATE TABLE invoices (
customer_id VARCHAR
) | List the customers first and last name of 10 least expensive invoices. | SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10 |
CREATE TABLE table_25908 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Jons team" text,
"Scores" text
) | What was the score on the episode that had Russell Kane and Louise Redknapp on Sean's team? | SELECT "Scores" FROM table_25908 WHERE "Seans team" = 'Russell Kane and Louise Redknapp' |
CREATE TABLE table_2988 (
"Year" real,
"Kentucky Derby" real,
"The Preakness Stakes" text,
"Kentucky Oaks" text,
"Belmont Stakes" text,
"Travers Stakes" text,
"Breeders Cup Saturday" text,
"Breeders Cup Friday" text
) | What was the Kentucky Oaks attendance the year the Belmont Stakes had 64,949 attendance? | SELECT "Kentucky Oaks" FROM table_2988 WHERE "Belmont Stakes" = '64,949' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | tell me the long title of diagnosis for patient with diagnosis icd9 code 42731. | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "42731" |
CREATE TABLE table_name_8 (
tied INTEGER,
pct VARCHAR,
lost VARCHAR
) | What is the highest number of games tied for teams with under 551 games and a percentage of under 0.5593? | SELECT MAX(tied) FROM table_name_8 WHERE pct < 0.5593 AND lost = 551 |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Na... | number of users who posted, by year. Count of users who posted at least 1 question or answer, grouped by year | SELECT YEAR(CreationDate) AS "year", COUNT(DISTINCT OwnerUserId) AS "#userswhoposted" FROM Posts WHERE PostTypeId IN (1, 2) GROUP BY YEAR(CreationDate) ORDER BY YEAR(CreationDate) |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
su... | since 2101, what were the top four most frequent specimen tests given to patients within 2 months following the diagnosis of angiopathy in other dis? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
CREATE TABLE table_name_39 (
date VARCHAR,
tournament VARCHAR
) | What date was the tournament in Indian Wells? | SELECT date FROM table_name_39 WHERE tournament = "indian wells" |
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 people are current patients aged 50s? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 50 AND 59 |
CREATE TABLE table_11964047_8 (
leading_scorer VARCHAR,
date VARCHAR
) | What is the leading scorer on february 1? | SELECT leading_scorer FROM table_11964047_8 WHERE date = "February 1" |
CREATE TABLE table_name_63 (
Id VARCHAR
) | What is 1997, when 1996 is '1R', when 1990 is '2R', and when 1991 is 'F'? | SELECT 1997 FROM table_name_63 WHERE 1996 = "1r" AND 1990 = "2r" AND 1991 = "f" |
CREATE TABLE table_name_39 (
crowd INTEGER,
venue VARCHAR
) | What is the total number of people that attended the glenferrie oval venue? | SELECT SUM(crowd) FROM table_name_39 WHERE venue = "glenferrie oval" |
CREATE TABLE table_11570261_1 (
year INTEGER,
winning_score VARCHAR
) | what is the minimum year where winning score is 8 (71-63-69-69=272) | SELECT MIN(year) FROM table_11570261_1 WHERE winning_score = −8(71 - 63 - 69 - 69 = 272) |
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGE... | Group and count the move in date in a bar chart, order in desc by the Y please. | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) DESC |
CREATE TABLE table_55387 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which result has a Score of 1 1? | SELECT "Result" FROM table_55387 WHERE "Score" = '1–1' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose age is less than 71 and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab."CATEGORY" = "Hematology" |
CREATE TABLE table_35993 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game is the highest that has a January of 28? | SELECT MAX("Game") FROM table_35993 WHERE "January" = '28' |
CREATE TABLE table_3533 (
"English" text,
"Japanese" text,
"Kana spelling" text,
"Revised Hepburn" text,
"Kunrei-shiki" text,
"Nihon-shiki" text
) | how many number of english when kunrei-shiki is otya | SELECT COUNT("English") FROM table_3533 WHERE "Kunrei-shiki" = 'otya' |
CREATE TABLE table_11677691_8 (
college VARCHAR,
player VARCHAR
) | Where did robert nkemdiche go to college | SELECT college FROM table_11677691_8 WHERE player = "Robert Nkemdiche ‡" |
CREATE TABLE table_25401874_1 (
number VARCHAR,
assists VARCHAR
) | How many numbers belong to the player with 10 assists? | SELECT COUNT(number) FROM table_25401874_1 WHERE assists = 10 |
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... | Let me know the gender and long title of diagnoses for the patient with patient id 2110. | SELECT demographic.gender, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2110" |
CREATE TABLE editor (
Name VARCHAR,
Age INTEGER
) | List the names of editors who are older than 25. | SELECT Name FROM editor WHERE Age > 25 |
CREATE TABLE table_77048 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
) | What team has a home city of Koprivnica? | SELECT "Team" FROM table_77048 WHERE "Home city" = 'koprivnica' |
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... | what was the time patient 031-19622 was discharged from the hospital for the last time? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '031-19622' ORDER BY patient.hospitaldischargetime DESC LIMIT 1 |
CREATE TABLE table_203_656 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"scorers" text,
"report" text
) | the total number of different teams listed as an opponent | SELECT COUNT(DISTINCT "opponent") FROM table_203_656 |
CREATE TABLE table_24814477_2 (
week VARCHAR,
opponent VARCHAR
) | What week did the Galaxy play the Amsterdam Admirals? | SELECT week FROM table_24814477_2 WHERE opponent = "Amsterdam Admirals" |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREA... | For events that have more than one participant, count the event details for a bar chart, and list by the the number of event details in ascending. | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY COUNT(Event_Details) |
CREATE TABLE table_43338 (
"Week" real,
"Date" text,
"Opponent" text,
"Game Site" text,
"Final Score" text,
"Record" text,
"Attendance" text
) | Which record has 64,053 as the attendance? | SELECT "Record" FROM table_43338 WHERE "Attendance" = '64,053' |
CREATE TABLE table_31843 (
"Week" text,
"Date" text,
"Opponent" text,
"Time" text,
"Game Site" text,
"Result/Score" text,
"Record" text
) | Tell me the game site for week of 1 | SELECT "Game Site" FROM table_31843 WHERE "Week" = '1' |
CREATE TABLE table_204_683 (
id number,
"no." number,
"constituency" text,
"winner candidate" text,
"party" text,
"votes" number,
"margin" number
) | how many votes were there for the constituency of danta ? | SELECT "votes" FROM table_204_683 WHERE "constituency" = 'danta' |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | Scatter chart. what are the different account ids that have made financial transactions, as well as how many transactions correspond to each? | SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id |
CREATE TABLE table_55052 (
"Season" text,
"Team Name" text,
"Games" real,
"Losses" real,
"Points" real
) | What's the total number of losses with less than 19 points and more than 36 games? | SELECT COUNT("Losses") FROM table_55052 WHERE "Points" < '19' AND "Games" > '36' |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | when has patient 006-100609 first received a procedure a year before? | SELECT 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 = '006-100609')) AND DATETIME(treatment.treatmenttime, 'start of yea... |
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category tex... | Which directors had a movie in either 1999 or 2000, and count them by a bar chart | SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director |
CREATE TABLE table_37978 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What position does the draft pick from Finland play? | SELECT "Position" FROM table_37978 WHERE "Nationality" = 'finland' |
CREATE TABLE table_name_23 (
money___ INTEGER,
score VARCHAR
) | How much was paid to the player whose score was 70-71-77-76=294? | SELECT SUM(money___) AS $__ FROM table_name_23 WHERE score = 70 - 71 - 77 - 76 = 294 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.