table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_203_258 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | in what year did jason babin force at least 15 sacks ? | SELECT "year" FROM table_203_258 WHERE "sacks" >= 15 |
CREATE TABLE table_204_598 (
id number,
"name" text,
"state of residence" text,
"took office" text,
"left office" text,
"president served under" text
) | name the advisor who served under the same president as karl rove . | SELECT "name" FROM table_204_598 WHERE "name" <> 'karl rove' AND "president served under" = (SELECT "president served under" FROM table_204_598 WHERE "name" = 'karl rove') |
CREATE TABLE table_name_68 (
frequency VARCHAR,
format VARCHAR
) | what is the frequency when the format is contemporary christian music? | SELECT frequency FROM table_name_68 WHERE format = "contemporary christian music" |
CREATE TABLE table_75487 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Total is the lowest one that has a Rank smaller than 1? | SELECT MIN("Total") FROM table_75487 WHERE "Rank" < '1' |
CREATE TABLE table_name_79 (
top_5 INTEGER,
cuts_made VARCHAR
) | What is the average for the top five having a number of 42 cuts made. | SELECT AVG(top_5) FROM table_name_79 WHERE cuts_made = 42 |
CREATE TABLE table_18602462_22 (
round_of_32 VARCHAR,
round_of_16 VARCHAR
) | How many round of 32 results are followed by Polidori ( Ita ) w 6-1, 3-6, 6-3 in the round of 16? | SELECT COUNT(round_of_32) FROM table_18602462_22 WHERE round_of_16 = "Polidori ( ITA ) W 6-1, 3-6, 6-3" |
CREATE TABLE suppliers (
supplier_name VARCHAR,
supplier_phone VARCHAR,
supplier_id VARCHAR
)
CREATE TABLE product_suppliers (
supplier_id VARCHAR,
product_id VARCHAR
)
CREATE TABLE products (
product_id VARCHAR,
product_name VARCHAR
) | List the names and phone numbers of all the distinct suppliers who supply red jeans. | SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = "red jeans" |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
... | the most expensive flight between BOSTON and PHILADELPHIA | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, fare, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_fare AS FLI... |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what is lidocaine 5% ointment's way of ingesting it? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'lidocaine 5% ointment' |
CREATE TABLE table_45558 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | what is the goals when the goal difference is more than -3, the club is real avil s cf and the goals against is more than 60? | SELECT SUM("Goals for") FROM table_45558 WHERE "Goal Difference" > '-3' AND "Club" = 'real avilés cf' AND "Goals against" > '60' |
CREATE TABLE table_62591 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Tie no for Away Team Ipswich Town? | SELECT "Tie no" FROM table_62591 WHERE "Away team" = 'ipswich town' |
CREATE TABLE table_name_13 (
score VARCHAR,
away_team VARCHAR
) | What was the score for the away team southport? | SELECT score FROM table_name_13 WHERE away_team = "southport" |
CREATE TABLE table_56836 (
"Name" text,
"COSPAR ID SATCAT \u2116" text,
"Launch date (UTC)" text,
"Launch vehicle" text,
"Launch site" text,
"Launch designation" text,
"Longitude" text
) | What is the launch designation of the satellite with a 2009-001a COSPAR ID? | SELECT "Launch designation" FROM table_56836 WHERE "COSPAR ID SATCAT \u2116" = '2009-001a' |
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperda... | author who wrote papers with emina torlak | SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'emina torlak' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid |
CREATE TABLE Documents_to_be_destroyed (
Destroyed_by_Employee_ID VARCHAR
) | Show the employee ids and the number of documents destroyed by each employee. | SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID |
CREATE TABLE table_204_292 (
id number,
"no." number,
"name" text,
"class" number,
"games" number,
"minutes" number,
"points" number,
"2 points\n(made/attempts)" text,
"2 points\n(%)" number,
"3 points\n(made/attempts)" text,
"3 points\n(%)" number,
"free throws\n(made/at... | who is the first person on the list to play less than 20 minutes ? | SELECT "name" FROM table_204_292 WHERE "minutes" < 20 ORDER BY id LIMIT 1 |
CREATE TABLE table_62767 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | What's the most in attendance when the Dolphins points were less than 24 and, they played the New England Patriots? | SELECT MAX("Attendance") FROM table_62767 WHERE "Dolphins points" < '24' AND "Opponent" = 'new england patriots' |
CREATE TABLE table_name_2 (
event VARCHAR,
year VARCHAR
) | What event was in 2006? | SELECT event FROM table_name_2 WHERE year = 2006 |
CREATE TABLE table_name_33 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
) | Which To Par has a Score smaller than 70, and a Player of matt kowal? | SELECT to_par FROM table_name_33 WHERE score < 70 AND player = "matt kowal" |
CREATE TABLE table_25017530_5 (
pick__number INTEGER,
player VARCHAR
) | Name the least pick number for steven turner | SELECT MIN(pick__number) FROM table_25017530_5 WHERE player = "Steven Turner" |
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 (... | count the number of patients whose diagnoses icd9 code is e9300 and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "E9300" AND prescriptions.drug_type = "MAIN" |
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... | Show me about the distribution of All_Games and Team_ID in a bar chart, and list Team_ID from low to high order please. | SELECT All_Games, Team_ID FROM basketball_match ORDER BY Team_ID |
CREATE TABLE table_name_44 (
record VARCHAR,
loss VARCHAR
) | Which Record has a Loss of o'connor (0-1)? | SELECT record FROM table_name_44 WHERE loss = "o'connor (0-1)" |
CREATE TABLE table_name_72 (
rank VARCHAR,
round2 VARCHAR,
round3 VARCHAR,
total_points VARCHAR,
round4 VARCHAR
) | what is the rank when the total points is more than 194, round4 is less than 64, round3 is more than 51 and round 2 is less than 66? | SELECT COUNT(rank) FROM table_name_72 WHERE total_points > 194 AND round4 < 64 AND round3 > 51 AND round2 < 66 |
CREATE TABLE event (
id number,
name text,
stadium_id number,
year text
)
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE swimmer (
id number,
name text,
nationality text,
meter_100 number... | Find all 200 meter and 300 meter results of swimmers with nationality 'Australia'. | SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia' |
CREATE TABLE table_23619005_3 (
position VARCHAR,
cfl_team VARCHAR
) | What was the position of the player from Saskatchewan Roughriders? | SELECT position FROM table_23619005_3 WHERE cfl_team = "Saskatchewan Roughriders" |
CREATE TABLE table_name_9 (
totaltk INTEGER,
yards INTEGER
) | what is the sum of totaltk when yards is less than 0? | SELECT SUM(totaltk) FROM table_name_9 WHERE yards < 0 |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Is UC 475 available for me during Spring ? | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... |
CREATE TABLE table_65236 (
"Title" text,
"Series" text,
"Characters" text,
"Production Num." real,
"Release date" text
) | With 4645 as the production number what was the title? | SELECT "Title" FROM table_65236 WHERE "Production Num." = '4645' |
CREATE TABLE table_name_54 (
against VARCHAR,
opposing_teams VARCHAR
) | What is the against when the opposing team is Italy? | SELECT COUNT(against) FROM table_name_54 WHERE opposing_teams = "italy" |
CREATE TABLE table_24543 (
"Year" real,
"Horse" text,
"Driver" text,
"Trainer" text,
"Country of owner" text,
"Odds of winner" text,
"Winning time (km rate)" text
) | When were the odds of winner 16.66? | SELECT "Year" FROM table_24543 WHERE "Odds of winner" = '16.66' |
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Part... | Bar chart x axis left office y axis the number of left office, order by the total number in descending. | SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office) DESC |
CREATE TABLE table_name_24 (
score VARCHAR,
date VARCHAR
) | What is the score on 22 September 1972? | SELECT score FROM table_name_24 WHERE date = "22 september 1972" |
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... | tell me patient 027-25994's maximum respiration on the last intensive care unit visit? | SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-25994') AND NOT patient.unitdischargetime IS N... |
CREATE TABLE table_41309 (
"Album" text,
"Release date" text,
"Label" text,
"Format" text,
"Covered Song" text,
"Original Song" text
) | What is the Label for the Covered Song named ' sign o' the times ' by prince .? | SELECT "Label" FROM table_41309 WHERE "Covered Song" = ' sign o'' the times " by prince .' |
CREATE TABLE table_42161 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | Which Team #2 has a 1st leg of 70 - 44? | SELECT "Team #2" FROM table_42161 WHERE "1st leg" = '70 - 44' |
CREATE TABLE table_55886 (
"Software" text,
"Latest stable date (version)" text,
"Cost ( USD )" text,
"Open source" text,
"License" text
) | Name the software with the latest stable date of 0.6.1 | SELECT "Software" FROM table_55886 WHERE "Latest stable date (version)" = '0.6.1' |
CREATE TABLE table_5199 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | How many picks did Mike Zaher have? | SELECT SUM("Pick #") FROM table_5199 WHERE "Player" = 'mike zaher' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose admission type is emergency and diagnoses long title is accidental fall on or from other stairs or steps? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Accidental fall on or from other stairs or steps" |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | when was the last time that patient 022-31513 had the urine output since 03/14/2101? | 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 = '022-31513')) AND intakeoutput.cellpath LIKE '%output%... |
CREATE TABLE table_name_41 (
fa_cup_goals VARCHAR,
name VARCHAR,
league_cup_goals VARCHAR
) | How many FA cup goals have Jimmy Nicholson as the name, and league cup goals greater than 0? | SELECT COUNT(fa_cup_goals) FROM table_name_41 WHERE name = "jimmy nicholson" AND league_cup_goals > 0 |
CREATE TABLE table_16275828_4 (
program VARCHAR,
location VARCHAR
) | What programs were held in charleston, illinois? | SELECT program FROM table_16275828_4 WHERE location = "Charleston, Illinois" |
CREATE TABLE table_20668 (
"Code" real,
"County" text,
"Former Province" text,
"Area (km 2 )" text,
"Population Census 2009" real,
"Capital" text
) | What capital's county had a population of 730129 as of 2009? | SELECT "Capital" FROM table_20668 WHERE "Population Census 2009" = '730129' |
CREATE TABLE table_name_38 (
position VARCHAR,
round VARCHAR
) | A round of 4 is in what position? | SELECT position FROM table_name_38 WHERE round = 4 |
CREATE TABLE table_name_90 (
week INTEGER,
opponent VARCHAR
) | What is the largest week with the Atlanta Falcons as the opponent? | SELECT MAX(week) FROM table_name_90 WHERE opponent = "atlanta falcons" |
CREATE TABLE table_name_55 (
location VARCHAR,
event VARCHAR
) | The event rip curl pro mademoiselle is in which location? | SELECT location FROM table_name_55 WHERE event = "rip curl pro mademoiselle" |
CREATE TABLE table_38753 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
) | What was the crowd size for the Home team of melbourne? | SELECT COUNT("Crowd") FROM table_38753 WHERE "Home team" = 'melbourne' |
CREATE TABLE table_22973 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What's the title of the episode with production code 10018? | SELECT "Title" FROM table_22973 WHERE "Production code" = '10018' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is maximum age of patients whose marital status is divorced and admission type is emergency? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "EMERGENCY" |
CREATE TABLE table_26974 (
"DS Division" text,
"Main Town" text,
"GN Divisions" real,
"Area (km 2 )" real,
"Sri Lankan Tamil" real,
"Sri Lankan Moors" real,
"Sinhalese" real,
"Indian Tamil" real,
"Other" real,
"Total" real,
"Population Density (/km 2 )" real
) | Name the popultion density being manthai west | SELECT "Population Density (/km 2 )" FROM table_26974 WHERE "DS Division" = 'Manthai West' |
CREATE TABLE table_70445 (
"Year" real,
"Champion" text,
"City" text,
"LLWS" text,
"Record" text
) | What is the total number of Years when the LLWS is 4th place, and when the City is Westport? | SELECT COUNT("Year") FROM table_70445 WHERE "LLWS" = '4th place' AND "City" = 'westport' |
CREATE TABLE table_name_76 (
iata VARCHAR,
icao VARCHAR
) | What is RJCM's IATA? | SELECT iata FROM table_name_76 WHERE icao = "rjcm" |
CREATE TABLE table_2534578_1 (
language VARCHAR,
reading VARCHAR
) | What was the language score when the reading score was 94.47? | SELECT language FROM table_2534578_1 WHERE reading = "94.47" |
CREATE TABLE performance (
performance_id number,
date text,
host text,
location text,
attendance number
)
CREATE TABLE member_attendance (
member_id number,
performance_id number,
num_of_pieces number
)
CREATE TABLE member (
member_id text,
name text,
nationality text,
... | What is the average number of attendees for performances? | SELECT AVG(attendance) FROM performance |
CREATE TABLE table_50346 (
"Callsign" text,
"Area served" text,
"Band" text,
"Freq currently" text,
"Purpose" text
) | What is the Purpose of the Callsign with a Freq currently of 4rph? | SELECT "Purpose" FROM table_50346 WHERE "Freq currently" = '4rph' |
CREATE TABLE table_23872 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Tar Heels points" real,
"Opponents" real,
"Record" text
) | How many games were against Furman? | SELECT MAX("Game") FROM table_23872 WHERE "Opponent" = 'Furman' |
CREATE TABLE table_51367 (
"Year" real,
"Property Taxes" text,
"Investment Earnings" text,
"Other Local Sources" text,
"State & Federal" text,
"Total Revenue" text
) | What were the investment earnings in a year when total revenue was $21,779,618? | SELECT "Investment Earnings" FROM table_51367 WHERE "Total Revenue" = '21,779,618' |
CREATE TABLE table_name_41 (
jockey VARCHAR,
winner VARCHAR
) | Who was the jockey for the winning horse Helioptic? | SELECT jockey FROM table_name_41 WHERE winner = "helioptic" |
CREATE TABLE table_name_73 (
director VARCHAR,
nomination VARCHAR
) | Tell me the director nominated for best actor in a leading role | SELECT director FROM table_name_73 WHERE nomination = "best actor in a leading role" |
CREATE TABLE table_name_60 (
Id VARCHAR
) | What is the 2004 value with 2r in 1994? | SELECT 2004 FROM table_name_60 WHERE 1994 = "2r" |
CREATE TABLE table_name_13 (
drawn INTEGER,
points VARCHAR,
played VARCHAR
) | What was the drawn amount for teams with points of 12 and played smaller than 10? | SELECT AVG(drawn) FROM table_name_13 WHERE points = 12 AND played < 10 |
CREATE TABLE table_42201 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | How many weeks had the Green Bay packers as opponents? | SELECT SUM("Week") FROM table_42201 WHERE "Opponent" = 'green bay packers' |
CREATE TABLE table_name_7 (
total_foreign_born__1000_ INTEGER,
country VARCHAR,
born_in_other_eu_state__1000_ VARCHAR
) | How many Foreign-born (1000) are from Sweden and born in some other EU state (1000) larger than 477? | SELECT SUM(total_foreign_born__1000_) FROM table_name_7 WHERE country = "sweden" AND born_in_other_eu_state__1000_ > 477 |
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... | Bar chart x axis sex y axis how many sex, and order in desc by the how many sex. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY COUNT(Sex) DESC |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | how many hours had it been since patient 006-47576 received her first potassium chloride 20 meq in 50 ml ivpb **locked dose prescription on their current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47... |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId... | Unselfish - Those who answer and never ask.. Query of users who answer but never asked a question.
Sorted by number of answers for a user. | SELECT COUNT(u.DisplayName) FROM Users AS u WHERE (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = u.Id AND PostTypeId = 2) = 0 AND (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = u.Id AND PostTypeId = 1) != 0 |
CREATE TABLE table_23285805_8 (
high_assists VARCHAR,
team VARCHAR
) | Who has the high assists when the team is Oklahoma City? | SELECT high_assists FROM table_23285805_8 WHERE team = "Oklahoma City" |
CREATE TABLE table_19170 (
"Song title" text,
"Artist" text,
"Language" text,
"Decade" text,
"Genre" text,
"Exportable" text,
"Family Friendly" text
) | What language for the glam genre? | SELECT "Language" FROM table_19170 WHERE "Genre" = 'Glam' |
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 procedures (
... | find out the procedure icd9 code and drug name of patient with patient id 10317. | SELECT procedures.icd9_code, prescriptions.drug FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "10317" |
CREATE TABLE table_train_91 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"rosen_modified_hachinski_ischemic_score" int,
"NOUSE" float
) | rosen modified hachinski ischemic score less than or equal to 4 | SELECT * FROM table_train_91 WHERE rosen_modified_hachinski_ischemic_score <= 4 |
CREATE TABLE table_22985 (
"Name" text,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Touchdowns" real,
"Interceptions" real,
"QB Rating" text
) | What is the highest number of interceptions? | SELECT MAX("Interceptions") FROM table_22985 |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | Asked Questions per month for a given Tag. | SELECT t.TagName, YEAR(p.CreationDate), MONTH(p.CreationDate), COUNT(t.TagName) AS d FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS P ON p.Id = pt.PostId WHERE t.TagName = '##TagNam##' AND NOT p.ClosedDate IS NULL GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate), t.TagName ORDER BY ... |
CREATE TABLE table_name_62 (
venue VARCHAR,
goal VARCHAR
) | Which venue has a Goal of 4? | SELECT venue FROM table_name_62 WHERE goal = 4 |
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,... | count the number of patients whose primary disease is s/p fall and year of birth is less than 2085? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dob_year < "2085" |
CREATE TABLE table_76810 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is the average score for the player who is T5 in the United States? | SELECT AVG("Score") FROM table_76810 WHERE "Place" = 't5' AND "Country" = 'united states' |
CREATE TABLE table_15703 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | What is the lowest rank with poland as the nationality and a time greater than 55.34? | SELECT MIN("Rank") FROM table_15703 WHERE "Nationality" = 'poland' AND "Time" > '55.34' |
CREATE TABLE diagnoses (
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,
... | how many patients whose ethnicity is black/haitian and drug route is sc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.route = "SC" |
CREATE TABLE addresses (
address_id text,
line_1 text,
line_2 text,
city_town text,
state_county text,
other_details text
)
CREATE TABLE performers_in_bookings (
order_id number,
performer_id number
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
workshop_g... | What is the description of the marketing region China? | SELECT marketing_region_descriptrion FROM marketing_regions WHERE marketing_region_name = "China" |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about the amount of ACC_Road over the ACC_Road , and group by attribute ACC_Road, display x-axis in desc order. | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | Plot salary by grouped by email as a bar graph | SELECT EMAIL, SALARY FROM employees |
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,... | get me the number of female patients who left against medical advice. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" |
CREATE TABLE table_6061 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which game took place April 6? | SELECT "Game" FROM table_6061 WHERE "April" = '6' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | when did patient 027-106613 first take a tv lab test in 04/2103? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-106613')) AND lab.labname = 'tv' AND STRFTIME('%y-%m', lab.labresulttime) = '21... |
CREATE TABLE table_name_70 (
home__1st_leg_ VARCHAR,
aggregate VARCHAR
) | Which team played their first leg at home with an aggregate score of 3-4? | SELECT home__1st_leg_ FROM table_name_70 WHERE aggregate = "3-4" |
CREATE TABLE table_25525 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | When 129 is the number in the series who is the writer? | SELECT "Written by" FROM table_25525 WHERE "No. in series" = '129' |
CREATE TABLE table_name_69 (
category VARCHAR,
tournament VARCHAR
) | What is the Category of the Rodez, France Tournament? | SELECT category FROM table_name_69 WHERE tournament = "rodez, france" |
CREATE TABLE table_24725951_1 (
episode VARCHAR,
celebrities VARCHAR
) | Which episode had celebrities Nick Hewer and Saira Khan in them? | SELECT episode FROM table_24725951_1 WHERE celebrities = "Nick Hewer and Saira Khan" |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For those employees who did not have any job in the past, give me the comparison about the sum of salary over the hire_date bin hire_date by time, could you sort by the Y in desc? | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC |
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 lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose diagnoses short title is trnspl status-bne marrow and drug route is im? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Trnspl status-bne marrow" AND prescriptions.route = "IM" |
CREATE TABLE table_name_92 (
rating INTEGER,
rank__timeslot_ VARCHAR,
rank__night_ VARCHAR
) | what is the rating when the rank (timeslot) is less than 3 and the rank (night) is less than 8? | SELECT SUM(rating) FROM table_name_92 WHERE rank__timeslot_ < 3 AND rank__night_ < 8 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients whose admission year is less than 2139 and lab test name is bilirubin, indirect? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Bilirubin, Indirect" |
CREATE TABLE table_name_70 (
points INTEGER,
entrant VARCHAR,
year VARCHAR
) | What is the total points that an 1951 Entrant alfa romeo spa have? | SELECT SUM(points) FROM table_name_70 WHERE entrant = "alfa romeo spa" AND year < 1951 |
CREATE TABLE review (
name VARCHAR,
u_id VARCHAR
)
CREATE TABLE useracct (
name VARCHAR,
u_id VARCHAR
) | Find the names of users who did not leave any review. | SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review) |
CREATE TABLE table_name_15 (
goals_scored VARCHAR,
points VARCHAR,
draws VARCHAR,
loses VARCHAR
) | What is the total number of goals scored of the club with more than 3 draws, more than 1 loses, and less than 26 points? | SELECT COUNT(goals_scored) FROM table_name_15 WHERE draws > 3 AND loses > 1 AND points < 26 |
CREATE TABLE table_23032 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | Name the title for us viewers being 18.29 | SELECT "Title" FROM table_23032 WHERE "U.S. viewers (millions)" = '18.29' |
CREATE TABLE table_name_29 (
Id VARCHAR
) | What 2006 has 0-0 as the 2011? | SELECT 2006 FROM table_name_29 WHERE 2011 = "0-0" |
CREATE TABLE table_name_33 (
competition VARCHAR,
score VARCHAR,
opponents VARCHAR
) | Which Competition has a Score of 0-1, and Opponents of pkns fc? | SELECT competition FROM table_name_33 WHERE score = "0-1" AND opponents = "pkns fc" |
CREATE TABLE table_25517718_3 (
extra_points INTEGER,
position VARCHAR
) | What is the smallest number of extra points for a left halfback? | SELECT MIN(extra_points) FROM table_25517718_3 WHERE position = "Left halfback" |
CREATE TABLE table_name_27 (
venue VARCHAR,
away_team VARCHAR
) | What venue featured north melbourne as the away side? | SELECT venue FROM table_name_27 WHERE away_team = "north melbourne" |
CREATE TABLE table_16400 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the highest selection number for the saskatchewan roughriders team? | SELECT MAX("Pick #") FROM table_16400 WHERE "CFL Team" = 'Saskatchewan Roughriders' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.