table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_37211 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Duchess" text,
"Ceased to be Duchess" text,
"Death" text,
"Spouse" text
) | When did eleonor magdalene of the palatinate-neuburg become duchess? | SELECT "Became Duchess" FROM table_37211 WHERE "Name" = 'eleonor magdalene of the palatinate-neuburg' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | count the number of patients who have received a opn mitral valvuloplasty procedure in the same month after having had a left heart cardiac cath procedure since 6 years ago. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'left heart ... |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | In the 16 -credit courses are there any CJS 400 -level ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... |
CREATE TABLE table_name_56 (
laps INTEGER,
time VARCHAR
) | What is the average Laps that shows spun off for time? | SELECT AVG(laps) FROM table_name_56 WHERE time = "spun off" |
CREATE TABLE table_113 (
"Title" text,
"System" text,
"Publisher" text,
"Product No." text,
"Compatible with 20/60GB NTSC PS3 (CECHA/CECHB)" text,
"Compatible with 60GB PAL/80GB NTSC PS3 (CECHC/CECHE)" text
) | What publishers were involved with product number SCUS-97265? | SELECT "Publisher" FROM table_113 WHERE "Product No." = 'SCUS-97265' |
CREATE TABLE table_name_76 (
date VARCHAR,
away_team VARCHAR
) | What date was Ipswich Town the away team? | SELECT date FROM table_name_76 WHERE away_team = "ipswich town" |
CREATE TABLE table_name_87 (
elected INTEGER,
district VARCHAR
) | What was the year elected in District 17? | SELECT MIN(elected) FROM table_name_87 WHERE district = 17 |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | For all employees who have the letters D or S in their first name, 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 FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid ... | how many patients have been prescribed until 1 year ago for 100 ml flex cont : magnesium sulfate in d5w 10-5 mg/ml-% iv soln? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '100 ml flex cont : magnesium sulfate in d5w 10-5 mg/ml-% iv soln' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year')) |
CREATE TABLE table_19268 (
"Player" text,
"Touchdowns (5 points)" real,
"Extra points 1 point" real,
"Field goals (5 points)" real,
"Safeties (2 points)" real,
"Total Points" real
) | How many extra points did Paul Dickey received | SELECT MAX("Extra points 1 point") FROM table_19268 WHERE "Player" = 'Paul Dickey' |
CREATE TABLE table_77337 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | Can you tell me the sum of Area km 2 that has the Official Name of glenelg? | SELECT SUM("Area km 2") FROM table_77337 WHERE "Official Name" = 'glenelg' |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | Which upper level elective classes next semester do not meet on Fridays ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... |
CREATE TABLE table_33554 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the largest crowd for the St Kilda as the away team? | SELECT MAX("Crowd") FROM table_33554 WHERE "Away team" = 'st kilda' |
CREATE TABLE table_name_66 (
opponent VARCHAR,
date VARCHAR
) | Which team did they play on September 19? | SELECT opponent FROM table_name_66 WHERE date = "september 19" |
CREATE TABLE table_30120560_1 (
barony VARCHAR,
area__acres__ VARCHAR
) | what is the barony and an area of 560? | SELECT barony FROM table_30120560_1 WHERE area__acres__ = 560 |
CREATE TABLE table_71508 (
"Television Network" text,
"Founded" text,
"% of Venezuelan households reached" text,
"# of households viewable" text,
"Type of network" text,
"# of Full-Power Affiliates" text,
"# of Low-Power/Class-A Affiliates & Transmitters" text
) | What television network, founded in 2002, has a community type of network? | SELECT "Television Network" FROM table_71508 WHERE "Type of network" = 'community' AND "Founded" = '2002' |
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... | give the number of patients who are widowed and diagnosed with osteoarthrosis, unspecified whether generalized or localized, site unspecified. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Osteoarthrosis, unspecified whether generalized or localized, site unspecified" |
CREATE TABLE table_10333757_1 (
frequency VARCHAR,
market_rank VARCHAR
) | What is the Frequency at the Market/Rank of Burlington - Plattsburgh , Vermont - New York /143? | SELECT COUNT(frequency) FROM table_10333757_1 WHERE market_rank = "Burlington - Plattsburgh , Vermont - New York /143" |
CREATE TABLE table_28007 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
) | What was the smallest production code for August 11's original episode? | SELECT MIN("Production code") FROM table_28007 WHERE "Original airdate" = 'August 11' |
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 age and item id of subject id 2560? | SELECT demographic.age, lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE savings (
custid number,
balance number
) | What is the total checking balance in all accounts? | SELECT SUM(balance) FROM checking |
CREATE TABLE table_4444 (
"Engine" text,
"Horsepower" text,
"Torque" text,
"Carburetor" text,
"Compression Ratio" text,
"Bore & Stroke" text,
"VIN Code" text
) | Tell me the carburetor for engine of 250-1v i-6 | SELECT "Carburetor" FROM table_4444 WHERE "Engine" = '250-1v i-6' |
CREATE TABLE table_60884 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is the To par when there was a total of 291? | SELECT "To par" FROM table_60884 WHERE "Total" = '291' |
CREATE TABLE table_name_80 (
ranking INTEGER,
years VARCHAR,
goals VARCHAR
) | Who has the highest ranking from 1996 13, and more than 17 goals? | SELECT MAX(ranking) FROM table_name_80 WHERE years = "1996–13" AND goals > 17 |
CREATE TABLE table_39727 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What is the score when the points are larger than 74 and the game is 57? | SELECT "Score" FROM table_39727 WHERE "Points" > '74' AND "Game" = '57' |
CREATE TABLE table_69809 (
"Year" text,
"Men's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Which Men's singles has a Mixed doubles of kai abraham petra michalowsky? | SELECT "Men's singles" FROM table_69809 WHERE "Mixed doubles" = 'kai abraham petra michalowsky' |
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 primary disease is ruq pain and year of death is less than or equal to 2111? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dod_year <= "2111.0" |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
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
)
... | Show me about the distribution of meter_500 and ID in a bar chart, rank Y in ascending order. | SELECT meter_500, ID FROM swimmer ORDER BY ID |
CREATE TABLE table_204_223 (
id number,
"party" text,
"previous council" number,
"staying councillors" number,
"seats up for election" number,
"election result" number,
"new council" number
) | which party had the most previous council ? | SELECT "party" FROM table_204_223 ORDER BY "previous council" DESC LIMIT 1 |
CREATE TABLE table_24536 (
"No. in total" text,
"No. in series" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What number in series is 'Judas Kiss'? | SELECT "No. in series" FROM table_24536 WHERE "Title" = 'Judas Kiss' |
CREATE TABLE table_43323 (
"Competition" text,
"Ladder Position" text,
"Coach" text,
"Captain(s)" text,
"Details" text
) | Who is the coach of the 2010 Gold Coast Titans season? | SELECT "Coach" FROM table_43323 WHERE "Details" = '2010 gold coast titans season' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the drug route and drug dose of promethazine HCl? | SELECT prescriptions.route, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Promethazine HCl" |
CREATE TABLE table_77957 (
"Series" text,
"Monday" text,
"Tuesday" text,
"Thursday" text,
"Saturday" text
) | Which series airs Saturday on Channel 5? | SELECT "Series" FROM table_77957 WHERE "Saturday" = 'channel 5' |
CREATE TABLE table_name_91 (
team_2 VARCHAR
) | Who is the 2nd round opponent when Team 2 is Red Star (D1)? | SELECT 2 AS nd_round FROM table_name_91 WHERE team_2 = "red star (d1)" |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperdataset (
paperid int,
... | how many ACL papers by author | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid |
CREATE TABLE table_train_28 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systemic_antifungal_therapy" bool,
"child_pugh_class" string,
"invasive_candida_infection" bool,
"age" float,
"NOUSE" float
) | liver cirrhosis child c | SELECT * FROM table_train_28 WHERE child_pugh_class = 'c' |
CREATE TABLE table_name_56 (
score VARCHAR,
assist_pass VARCHAR,
date VARCHAR
) | What was the score on 2010-07-13 when Abby wambach had the assist/pass? | SELECT score FROM table_name_56 WHERE assist_pass = "abby wambach" AND date = "2010-07-13" |
CREATE TABLE table_39176 (
"Team" text,
"Copa Libertadores 1999" text,
"Copa Mercosur 1999" text,
"Copa CONMEBOL 1999" text,
"Intercontinental Cup 1999" text
) | What is the Intercontinental Cup 1999 result for the team with a Copa Conmebol 1999 result of runner-up? | SELECT "Intercontinental Cup 1999" FROM table_39176 WHERE "Copa CONMEBOL 1999" = 'runner-up' |
CREATE TABLE table_72335 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
... | What is the rear sight in the Cole model no. 735? | SELECT "Rear sight" FROM table_72335 WHERE "Colt model no." = '735' |
CREATE TABLE table_53714 (
"engine name" text,
"engine code(s)" text,
"valvetrain" text,
"displacement" text,
"max. power at rpm" text,
"max. torque at rpm" text
) | What is the engine name that has a maximum torque at rpm of n m ( lbf ft ) @ 3,800? | SELECT "engine name" FROM table_53714 WHERE "max. torque at rpm" = 'n·m ( lbf·ft ) @ 3,800' |
CREATE TABLE table_25505246_7 (
round VARCHAR,
against VARCHAR
) | What kind of round was played when Hanne Skak Jensen faced Austria? | SELECT round FROM table_25505246_7 WHERE against = "Austria" |
CREATE TABLE table_63667 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
) | is the restaurant bacchus roti with meredith heron as the designer still open? | SELECT "Still Open?" FROM table_63667 WHERE "Designer" = 'meredith heron' AND "Restaurant Name" = 'bacchus roti' |
CREATE TABLE table_23214055_2 (
ezhavas VARCHAR,
muslims VARCHAR
) | Name the ezhavas for muslims being 5.4 | SELECT ezhavas FROM table_23214055_2 WHERE muslims = "5.4" |
CREATE TABLE table_1342256_40 (
candidates VARCHAR,
district VARCHAR
) | What is the candidate for south carolina 3? | SELECT candidates FROM table_1342256_40 WHERE district = "South Carolina 3" |
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 widowed patients had lab test named metamyelocytes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Metamyelocytes" |
CREATE TABLE table_16965 (
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production Code" real
) | What was the airdate of 21 series number? | SELECT "Original air date" FROM table_16965 WHERE "Series no." = '21' |
CREATE TABLE table_7846 (
"Species" text,
"Species common name" text,
"NCBI Accession Number (mRNA/Protein)" text,
"Length (bp/aa)" text,
"Protein Identity" text
) | What Species has the Species common name listed as mouse? | SELECT "Species" FROM table_7846 WHERE "Species common name" = 'mouse' |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,... | Getting all coments on a site. | SELECT Score, PostId AS "post_link", Id AS "comment_link", UserId AS "user_link" FROM Comments ORDER BY Score DESC LIMIT 10000 |
CREATE TABLE table_name_73 (
Id VARCHAR
) | What was in 2007 that is from 2004 0f 2r and 2010 of A? | SELECT 2007 FROM table_name_73 WHERE 2004 = "2r" AND 2010 = "a" |
CREATE TABLE table_33967 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the highest round where a back named Ed Cody can be found? | SELECT MAX("Round") FROM table_33967 WHERE "Position" = 'back' AND "Player" = 'ed cody' |
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions... | Show the average and maximum damage for all storms with max speed higher than 1000. | SELECT AVG(damage_millions_usd), MAX(damage_millions_usd) FROM storm WHERE max_speed > 1000 |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
Fac... | Show me a scatter chart for what are the faculty id and the number of students each faculty has? | SELECT FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.FacID |
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... | for patient id 74032, specify the icd9 code and type of drug he was treated with. | SELECT diagnoses.short_title, prescriptions.drug_type FROM diagnoses INNER JOIN prescriptions ON diagnoses.hadm_id = prescriptions.hadm_id WHERE diagnoses.subject_id = "74032" |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What are the requirements to get a CS-LSA degree ? | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
CREATE TABLE View_Product_Availability (
product_id INTEGER,
booking_id INTEGER,
status_date DATETIME,
available_yn VARCHAR(1)
)
CREATE TABLE Products_Booked (
booking_id INTEGER,
product_id INTEGER,
returned_yn VARCHAR(1),
returned_late_yn VARCHAR(1),
booked_count INTEGER,
book... | What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a bar chart, order in desc by the y axis. | SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' ORDER BY COUNT(payment_date) DESC |
CREATE TABLE table_name_85 (
original_title VARCHAR,
director VARCHAR
) | Name the original title directed by luis bu uel | SELECT original_title FROM table_name_85 WHERE director = "luis buñuel" |
CREATE TABLE table_name_18 (
road_number VARCHAR,
year INTEGER
) | How many road numbers are before 1922? | SELECT COUNT(road_number) FROM table_name_18 WHERE year < 1922 |
CREATE TABLE table_77906 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What day is south melbourne at home? | SELECT "Date" FROM table_77906 WHERE "Home team" = 'south melbourne' |
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 (
... | what was the organism found in the last mini-bal microbiology test for patient 3369 until 04/2103? | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3369) AND microbiologyevents.spec_type_desc = 'mini-bal' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime)... |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | Next semester , what are the 300 -level classes ? | 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 course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester... |
CREATE TABLE table_65077 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
) | What is the Col entry for the peak with an elevation of 2,308 meters? | SELECT COUNT("Col (m)") FROM table_65077 WHERE "Elevation (m)" = '2,308' |
CREATE TABLE table_202_281 (
id number,
"date" text,
"time (edt)" number,
"team #1" text,
"res." text,
"team #2" text,
"round" text,
"spectators" number
) | what is the difference in number of spectators between the best attended match and least attended match -lrb- of all matches listed -rrb- ? | SELECT (SELECT "spectators" FROM table_202_281 ORDER BY "spectators" DESC LIMIT 1) - (SELECT "spectators" FROM table_202_281 ORDER BY "spectators" LIMIT 1) |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLin... | Bad question days by month. | SELECT year_, month_, SUM(CASE WHEN down > 0 THEN 1 ELSE 0 END) AS bad_days FROM (SELECT YEAR(CreationDate) AS year_, MONTH(CreationDate) AS month_, MAX(CASE WHEN Score > 0 THEN 1 ELSE 0 END) AS up, MAX(CASE WHEN Score < 1 THEN 1 ELSE 0 END) AS down FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 1 GROUP B... |
CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
gender_mfu text,
date_of_birth time,
other_details text
)
CREATE TABLE document_locations (
document_id number,
loca... | Show the names of all the employees with role 'HR'. | SELECT employee_name FROM employees WHERE role_code = "HR" |
CREATE TABLE table_74430 (
"Date" text,
"Episode" real,
"Official rating 4+" text,
"Share 4+" text,
"Official rating 16-39" text,
"Share 16-39" text
) | What is the 16-39 share of the episode with a 4+ share of 30,01%? | SELECT "Share 16-39" FROM table_74430 WHERE "Share 4+" = '30,01%' |
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Numb... | Return a bar chart on how many stores are headquarted in each city?, and sort in asc by the bars. | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY Headquartered_City |
CREATE TABLE table_201_13 (
id number,
"city" text,
"county(ies)" text,
"population\n(2000 census)" number,
"population\n(2010 census)" number,
"class" text,
"incorporation\ndate" number
) | which city has the most population in the 2010 census ? | SELECT "city" FROM table_201_13 ORDER BY "population\n(2010 census)" DESC LIMIT 1 |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid nu... | what is the minimum total cost of a hospital that includes a drug named ampicillin until 2104? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'ampicillin') AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cost.hadm_id) AS t1 |
CREATE TABLE table_15681686_4 (
rank__week_ VARCHAR,
viewers__millions_ VARCHAR
) | what rank has viewers at 6.45? | SELECT rank__week_ FROM table_15681686_4 WHERE viewers__millions_ = "6.45" |
CREATE TABLE table_44403 (
"Poll Source" text,
"Date administered" text,
"Democrat" text,
"Republican" text,
"Lead Margin" real
) | Which Lead Margin has a Poll Source of rasmussen reports/ fox news? | SELECT MIN("Lead Margin") FROM table_44403 WHERE "Poll Source" = 'rasmussen reports/ fox news' |
CREATE TABLE table_train_141 (
"id" int,
"gender" string,
"hypothyroidism" bool,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"neuropsychiatric_diagnoses" bool,
"memory_box" float,
"early_stage_ad" bool,
"head_injury" bool,
"stroke" bool,
"body_weight" float,
... | major medical illness ( e.g., diabetes, severe / uncontrolled hypertension, hypothyroidism ) . | SELECT * FROM table_train_141 WHERE major_medical_illness = 1 OR (diabetes = 1 OR hypertension = 1 OR hypertension = 1 OR hypothyroidism = 1) |
CREATE TABLE Rooms (
roomName VARCHAR,
decor VARCHAR,
basePrice VARCHAR,
beds VARCHAR
) | Find the names of all modern rooms with a base price below $160 and two beds. | SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern' |
CREATE TABLE table_name_89 (
first_issue VARCHAR,
title VARCHAR
) | What is the First Issue date of Bamboo Blade? | SELECT first_issue FROM table_name_89 WHERE title = "bamboo blade" |
CREATE TABLE table_name_86 (
venue VARCHAR,
date VARCHAR
) | Which venue was used 22 january 2008? | SELECT venue FROM table_name_86 WHERE date = "22 january 2008" |
CREATE TABLE table_name_61 (
main_campus_location VARCHAR,
founded VARCHAR
) | What college was founded in 1967? | SELECT main_campus_location FROM table_name_61 WHERE founded = 1967 |
CREATE TABLE table_32767 (
"Freq" real,
"Call" text,
"City" text,
"Owner" text,
"Day Power ( W )" real,
"Night Power" real,
"Format" text,
"Stereo" text
) | Is WPEO in stereo? | SELECT "Stereo" FROM table_32767 WHERE "Call" = 'wpeo' |
CREATE TABLE table_28784 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Patient Portrayer" text,
"Original air date" text,
"Production code" real
) | what is the original air date for julie warner? | SELECT "Original air date" FROM table_28784 WHERE "Patient Portrayer" = 'Julie Warner' |
CREATE TABLE table_name_41 (
goals INTEGER,
apps INTEGER
) | Which Goals have Apps smaller than 1? | SELECT AVG(goals) FROM table_name_41 WHERE apps < 1 |
CREATE TABLE table_56612 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game played with a home team score of 8.13 (61)? | SELECT "Venue" FROM table_56612 WHERE "Home team score" = '8.13 (61)' |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | list flights from PHILADELPHIA to SAN FRANCISCO thursday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 24 AND date_day.month_number = 5... |
CREATE TABLE table_32562 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was Melbourne's score when they were the home team? | SELECT "Home team score" FROM table_32562 WHERE "Home team" = 'melbourne' |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Stack bar chart of school_id vs ACC_Road based on all home, and show bar in asc order. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | count the number of patients who were diagnosed with acute respiratory failure until 2103 and did not return to the hospital within 2 months. | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1) - (SELECT C... |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | When in the morning is the LAW 438 course ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'LAW' AND cour... |
CREATE TABLE table_42425 (
"Year" real,
"Champions" text,
"Result" text,
"Runners-up" text,
"Playoffs MVP" text
) | What is the result for the champions jeonju kcc egis with runners-up seoul samsung thunders after 2007? | SELECT "Result" FROM table_42425 WHERE "Year" > '2007' AND "Runners-up" = 'seoul samsung thunders' AND "Champions" = 'jeonju kcc egis' |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | Visualize a bar chart for what are the average ages for male and female students?, and list Y in asc order. | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) |
CREATE TABLE table_204_178 (
id number,
"number" text,
"south/west end" text,
"north/east end" text,
"formed" text,
"eliminated" text
) | how many routes were formed in 1926 ? | SELECT COUNT("number") FROM table_204_178 WHERE "formed" = 1926 |
CREATE TABLE table_name_83 (
label VARCHAR,
region VARCHAR,
catalog VARCHAR
) | What label has the netherlands as the region, and magik muzik 802-1 as the catalog? | SELECT label FROM table_name_83 WHERE region = "netherlands" AND catalog = "magik muzik 802-1" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | how many days have passed since the last time patient 15447 stayed in the careunit tsicu in their current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1 |
CREATE TABLE table_name_40 (
gamerankings VARCHAR,
metacritic VARCHAR,
year_released VARCHAR
) | What is the GameRankings Released of 2011 with a Metacritic of 83/100? | SELECT gamerankings FROM table_name_40 WHERE metacritic = "83/100" AND year_released = 2011 |
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
) | what is the total area of edinburg ? | SELECT "area (km2)" FROM table_203_74 WHERE "urban area" = 'edinburgh' |
CREATE TABLE country (
Country_id VARCHAR,
Country_name VARCHAR
)
CREATE TABLE match_season (
Player VARCHAR,
Country VARCHAR
) | Which players are from Indonesia? | SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = "Indonesia" |
CREATE TABLE table_19534677_1 (
creators VARCHAR,
volume_title VARCHAR
) | Name the umbr of creators for flash of two worlds | SELECT COUNT(creators) FROM table_19534677_1 WHERE volume_title = "Flash of Two Worlds" |
CREATE TABLE table_name_80 (
year INTEGER,
billboard_200_peak VARCHAR,
riaa_sales_certification VARCHAR,
title VARCHAR
) | For how many years did the song 'Lost Without Your Love' win the gold RIAA Sales Certification, and have a Billboard 200 Peak greater than 26? | SELECT SUM(year) FROM table_name_80 WHERE riaa_sales_certification = "gold" AND title = "lost without your love" AND billboard_200_peak > 26 |
CREATE TABLE table_name_31 (
attendance INTEGER,
date VARCHAR
) | What was the attendance on 10 november 2004? | SELECT AVG(attendance) FROM table_name_31 WHERE date = "10 november 2004" |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
... | show me one way flights from MILWAUKEE to ORLANDO leaving on wednesday morning | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (((DATE_DAY_0.day_number = 23 AND DATE_DAY_0.month... |
CREATE TABLE table_27147 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | What was the game site for the matchup against the Frankfurt Galaxy? | SELECT "Game site" FROM table_27147 WHERE "Opponent" = 'Frankfurt Galaxy' |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,... | When is Ching Lee teaching 783 next ? | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 783 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Ching Lee%' AND offering_instructor.instructo... |
CREATE TABLE school_bus (
school_id number,
driver_id number,
years_working number,
if_full_time others
)
CREATE TABLE driver (
driver_id number,
name text,
party text,
home_city text,
age number
)
CREATE TABLE school (
school_id number,
grade text,
school text,
loc... | Show the party and the number of drivers in each party. | SELECT party, COUNT(*) FROM driver GROUP BY party |
CREATE TABLE table_77658 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was the game played at Lake Oval? | SELECT "Date" FROM table_77658 WHERE "Venue" = 'lake oval' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.