table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | windows phone post count, view count, view/post ratio per day. | SELECT DATE(p.CreationDate) AS pdate, COUNT(*) AS nposts_per_day, SUM(p.ViewCount) AS nviews_per_day, SUM(p.ViewCount) / COUNT(*) AS view_post_ratio FROM Tags JOIN PostTags AS pt ON Tags.Id = pt.TagId JOIN Posts AS p ON pt.PostId = p.Id WHERE Tags.TagName = @TagName GROUP BY DATE(p.CreationDate) ORDER BY pdate DESC LIM... |
CREATE TABLE table_name_57 (
played VARCHAR,
points_1 VARCHAR,
goals_for VARCHAR
) | What is the played number with points 1 is 80, and goals for is more than 77? | SELECT COUNT(played) FROM table_name_57 WHERE points_1 = "80" AND goals_for > 77 |
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 all employees who have the letters D or S in their first name, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, and sort from low to high by the y axis please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) |
CREATE TABLE table_204_374 (
id number,
"event" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number,
"ranking" text
) | which paralymics year had the largest number of medals overall ? | SELECT "event" FROM table_204_374 ORDER BY "total" DESC LIMIT 1 |
CREATE TABLE table_dev_57 (
"id" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"vasopressors" bool,
"temperature" float,
"creatinine_clearance_cl" float,
"cardiogenic_shock" bool,
"height" int,
"serum_creatinine" float,
"... | renal function: serum creatinine > 2 mg / dl or creatinine clearance <= 50 ml / min | SELECT * FROM table_dev_57 WHERE serum_creatinine > 2 OR creatinine_clearance_cl <= 50 |
CREATE TABLE Problem_Status_Codes (
problem_status_code VARCHAR(20),
problem_status_description VARCHAR(80)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_first_name VARCHAR(80),
staff_last_name VARCHAR(80),
other_staff_details VARCHAR(255)
)
CREATE TABLE Problems (
problem_id INTEGER,
... | For each product with some problems, list the count of problems and the product id. Show the correlation. | SELECT COUNT(*), T1.product_id FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id |
CREATE TABLE table_58479 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the driver for Grid 8? | SELECT "Driver" FROM table_58479 WHERE "Grid" = '8' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | until 3 years ago how many patients were prescribed carvedilol 6.25 mg po tabs in the same hospital visit after the procedure of pulmonary/ccm consultation. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'pulmonary/ccm consultation' AND DATETIME(treatment.treatmenttime) <= DATE... |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserD... | Posts by score, from the bottom up. As requested in https://physics.meta.stackexchange.com/q/9813/.
Please don't use this query to go and downvote posts, which would make it self-reinforcing in a really ugly way. This information is relatively useful but please be mindful of how you use it.
Similarly, before you... | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Posts.Score, Posts.CreationDate, CASE WHEN Posts.PostTypeId = 2 THEN 'Answer' ELSE (CASE WHEN NOT Posts.ClosedDate IS NULL THEN 'Closed Question' ELSE 'Open Question' END) END AS "Post Type" FROM Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id OR... |
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 ACC_Percent over the All_Neutral , show in desc by the All_Neutral please. | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY All_Neutral DESC |
CREATE TABLE table_32942 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
) | What is the name of the player who begin playing for the LA Lakers in 1974? | SELECT "Player" FROM table_32942 WHERE "From" = '1974' |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and could you list y axis from high to low order? | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY) DESC |
CREATE TABLE table_45355 (
"Rank" text,
"Badge/Serial Number" text,
"Tenure" text,
"Date of death" text,
"Cause of death" text
) | What is the Rank of the Officer with Badge/Serial Number 11755 who died in Gunfire? | SELECT "Rank" FROM table_45355 WHERE "Cause of death" = 'gunfire' AND "Badge/Serial Number" = '11755' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | what is the diagnosis cost of poisoning-barbiturates? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poisoning-barbiturates')) |
CREATE TABLE table_35262 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Total of 3, and a Gold larger than 0, and a Nation of belarus, and a Silver larger than 2 has what sum of bronze? | SELECT SUM("Bronze") FROM table_35262 WHERE "Total" = '3' AND "Gold" > '0' AND "Nation" = 'belarus' AND "Silver" > '2' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients whose age is less than 48 and drug route is sl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.route = "SL" |
CREATE TABLE table_name_25 (
overall INTEGER,
pick__number VARCHAR
) | How much Overall has a Pick # of 26? | SELECT SUM(overall) FROM table_name_25 WHERE pick__number = 26 |
CREATE TABLE table_name_63 (
usn_2013 INTEGER,
cnn_2011 VARCHAR,
bw_2013 VARCHAR,
forbes_2011 VARCHAR
) | What is the USN 2013 ranking with a BW 2013 ranking less than 1000, a Forbes 2011 ranking larger than 17, and a CNN 2011 ranking less than 13? | SELECT SUM(usn_2013) FROM table_name_63 WHERE bw_2013 < 1000 AND forbes_2011 > 17 AND cnn_2011 < 13 |
CREATE TABLE table_26479 (
"Episode #" real,
"Prod #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Filmed" text
) | How many episodes have the title 'a perfect crime'? | SELECT COUNT("Episode #") FROM table_26479 WHERE "Title" = 'A Perfect Crime' |
CREATE TABLE table_45476 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What is the Date of the match with Opponent in the final Kenneth Carlsen? | SELECT "Date" FROM table_45476 WHERE "Opponent in the final" = 'kenneth carlsen' |
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,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of job_id and manager_id , and could you display by the bars in descending? | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC |
CREATE TABLE table_48594 (
"Election" real,
"Leader" text,
"# of seats won" real,
"# of National votes" real,
"% of National vote" text,
"# of Prefectural votes" real,
"% of Prefectural vote" text
) | What is the average Election, when % Of Nation Vote is 45.23%, and when # Of Prefectural Votes is less than 14,961,199? | SELECT AVG("Election") FROM table_48594 WHERE "% of National vote" = '45.23%' AND "# of Prefectural votes" < '14,961,199' |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the sum of code , and group by attribute founder, and I want to sort in desc by the bar. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC |
CREATE TABLE table_name_74 (
tournament VARCHAR
) | WHAT IS THE 2011 PERFORMANCE AT THE MIAMI MASTERS? | SELECT 2011 FROM table_name_74 WHERE tournament = "miami masters" |
CREATE TABLE table_name_19 (
scoring_rank VARCHAR,
year VARCHAR,
events_played VARCHAR,
rank VARCHAR
) | What is the Scoring rank when there are less than 21 events played with a rank of n/a in years less than 2011? | SELECT scoring_rank FROM table_name_19 WHERE events_played < 21 AND rank = "n/a" AND year < 2011 |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | what is the five most commonly given procedure for patients of 30s in 2103? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) = '2103' GROUP BY treatment.t... |
CREATE TABLE table_name_53 (
attendance INTEGER,
record VARCHAR
) | Name the least attendance for 52-37 record | SELECT MIN(attendance) FROM table_name_53 WHERE record = "52-37" |
CREATE TABLE table_16094 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | Who was Class AAA during the same year that Class AAAAA was Brownsville Pace? | SELECT "Class AAA" FROM table_16094 WHERE "Class AAAAA" = 'Brownsville Pace' |
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... | count the number of patients whose days of hospital stay is greater than 17 and drug name is potassium phosphate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "17" AND prescriptions.drug = "Potassium Phosphate" |
CREATE TABLE table_27833186_1 (
rider_names VARCHAR,
location VARCHAR,
horse_name VARCHAR
) | Who were the winning riders of the championship in Euer Valley, CA and whose horse was Magic Sirocco? | SELECT rider_names FROM table_27833186_1 WHERE location = "Euer Valley, CA" AND horse_name = "Magic Sirocco" |
CREATE TABLE table_14959246_2 (
attendance VARCHAR,
date VARCHAR
) | What was the attendance at the game played on December 10, 1972? | SELECT attendance FROM table_14959246_2 WHERE date = "December 10, 1972" |
CREATE TABLE table_15187735_19 (
segment_c VARCHAR,
segment_b VARCHAR
) | What is the segment C of the episode where segment B is Film Digitization? | SELECT segment_c FROM table_15187735_19 WHERE segment_b = "Film Digitization" |
CREATE TABLE table_66275 (
"Date Released" text,
"Polling institute" text,
"Social Democratic" text,
"Socialist" text,
"Green-Communist" text,
"People's Party" text,
"Left Bloc" text,
"Lead" text
) | What is the result for the Green-Communist party when the Left Bloc has 3.6%? | SELECT "Green-Communist" FROM table_66275 WHERE "Left Bloc" = '3.6%' |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | Top reputation users with no answer score. | SELECT u.Id AS "user_link", u.Reputation AS Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY u.Id, u.Reputation HAVING SUM(p.Score * (1 - ABS(SIGN(p.PostTypeId - 2)))) < 100000 ORDER BY Reputation DESC LIMIT 100 |
CREATE TABLE table_23286112_12 (
high_rebounds VARCHAR,
game VARCHAR
) | Who had the highest rebounds in game 2? | SELECT high_rebounds FROM table_23286112_12 WHERE game = 2 |
CREATE TABLE table_name_44 (
grid INTEGER,
time_retired VARCHAR
) | What is the average grid for the +2.2 secs time/retired? | SELECT AVG(grid) FROM table_name_44 WHERE time_retired = "+2.2 secs" |
CREATE TABLE table_70328 (
"Tournament" text,
"2008" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Name the 2011 with 2010 of 2r | SELECT "2011" FROM table_70328 WHERE "2010" = '2r' |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
val... | when was the first time patient 86555 was prescribed medication via po route? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86555) AND prescriptions.route = 'po' ORDER BY prescriptions.startdate LIMIT 1 |
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 microlab (
microl... | tell me patient 017-20711's total chest tube output: mediastinal r anterior output on last month/16. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-20711')) AND intakeoutput.celllabel = 'chest... |
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... | Is the only person teaching Biochem Res-Med Stu Prof. Corrigan ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Biochem Res-Med Stu%' AND NOT instructor.name LIKE '%Corrigan%' AND offering_instructor.instructor_id = i... |
CREATE TABLE table_71744 (
"Position" text,
"Name" text,
"Party" text,
"First elected" real,
"District" text
) | Name the total number of first elected for dranesville | SELECT COUNT("First elected") FROM table_71744 WHERE "District" = 'dranesville' |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id num... | List posts of deleted user. | SELECT Id AS "post_link", OwnerDisplayName FROM Posts WHERE OwnerDisplayName = 'user121799' |
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, draw a bar chart about the distribution of name and the average of code , and group by attribute name, and display from high to low by the y-axis please. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC |
CREATE TABLE table_name_18 (
attendance INTEGER,
league_position VARCHAR,
opponents VARCHAR
) | When in the 1st league position, how many people watch as they faced West Ham United? | SELECT MIN(attendance) FROM table_name_18 WHERE league_position = "1st" AND opponents = "west ham united" |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean... | Sum - Number of Answer - Android. | SELECT COUNT(P.ViewCount) FROM Posts AS P WHERE NOT P.Tags LIKE '%android%' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
lan... | count the number of times that patient 26817 had had .45ns flush intake in 09/this year. | SELECT COUNT(*) 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 = 26817)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.45ns flush'... |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | when was the last time patient 74159 had surgery on the last hospital encounter? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime DESC LIMIT 1 |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | Draw a bar chart about the distribution of Sex and the average of Height , and group by attribute Sex, and display in ascending by the Y. | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) |
CREATE TABLE table_12562214_1 (
date__from_ VARCHAR,
date__to_ VARCHAR
) | what is the date (from) where date (to) is 1919? | SELECT date__from_ FROM table_12562214_1 WHERE date__to_ = "1919" |
CREATE TABLE table_name_82 (
green_communist VARCHAR,
lead VARCHAR
) | What is the green-communist with a 15.5% lead? | SELECT green_communist FROM table_name_82 WHERE lead = "15.5%" |
CREATE TABLE table_name_82 (
college_junior_club_team__league_ VARCHAR,
round INTEGER
) | WHAT IS THE LEAGUE WITH A ROUND LARGER THAN 6? | SELECT college_junior_club_team__league_ FROM table_name_82 WHERE round > 6 |
CREATE TABLE table_44690 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the Rank of the Nation with more than 1 Gold and a more than 4 Total medals? | SELECT SUM("Rank") FROM table_44690 WHERE "Gold" > '1' AND "Total" > '4' |
CREATE TABLE table_name_19 (
attendance INTEGER,
result VARCHAR,
year VARCHAR
) | What was the total attendance for a result of 7-23 before 1960? | SELECT SUM(attendance) FROM table_name_19 WHERE result = "7-23" AND year < 1960 |
CREATE TABLE table_name_8 (
constructor VARCHAR,
circuit VARCHAR
) | What is the constructor where the circuit is Silverstone? | SELECT constructor FROM table_name_8 WHERE circuit = "silverstone" |
CREATE TABLE table_57856 (
"Country" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (nominal)" text,
"GDP per capita (nominal)" text
) | Which population has a GDP (nominal) of $6.4 billion? | SELECT "Population" FROM table_57856 WHERE "GDP (nominal)" = '$6.4 billion' |
CREATE TABLE table_5970 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | When did the Indians play a game with a record of 28-41? | SELECT "Date" FROM table_5970 WHERE "Record" = '28-41' |
CREATE TABLE table_36732 (
"Year" text,
"Champion" text,
"Runner-up" text,
"Score" text,
"Surface" text
) | What is the surface of the match with Brian Gottfried as the runner-up? | SELECT "Surface" FROM table_36732 WHERE "Runner-up" = 'brian gottfried' |
CREATE TABLE tags (
index number,
id number,
tag text
)
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
) | What are the downloaded numbers and their release types? | SELECT SUM(totalsnatched), releasetype FROM torrents GROUP BY releasetype |
CREATE TABLE table_41717 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"attendance" real
) | What is the Record with an attendance of more than 54,761, and a Result of loss? | SELECT "Record" FROM table_41717 WHERE "attendance" > '54,761' AND "Result" = 'loss' |
CREATE TABLE table_40577 (
"Team" text,
"City" text,
"Inaugural season" text,
"Final season" text,
"Captain" text,
"Coach" text
) | Which City has the Bahawalpur Stags Team? | SELECT "City" FROM table_40577 WHERE "Team" = 'bahawalpur stags' |
CREATE TABLE table_46044 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | Which Nationality has a Pick larger than 109, and a Round smaller than 5? | SELECT "Nationality" FROM table_46044 WHERE "Pick" > '109' AND "Round" < '5' |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Highest number of comments on a post. | SELECT 'site:///a/' + CAST(p.Id AS TEXT) + '/4918|' + CAST(p.Id AS TEXT) AS pLink, COUNT(*) AS cCount FROM Comments AS c LEFT JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.Id HAVING '##limit?30##' <= COUNT(*) ORDER BY 2 DESC |
CREATE TABLE table_name_97 (
method VARCHAR,
round VARCHAR,
opponent VARCHAR
) | what is the method for round 1 and the opponent is bobby mcmaster? | SELECT method FROM table_name_97 WHERE round = 1 AND opponent = "bobby mcmaster" |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_dista... | show me a list of flights from DENVER to BALTIMORE on UA for 8 3 | 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 = 'BALTIMORE' AND date_day.day_number = 3 AND date_day.month_number = 8 AND... |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients whose diagnoses short title is backache nos 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.short_title = "Backache NOS" AND prescriptions.drug_type = "MAIN" |
CREATE TABLE table_203_113 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which of these countries was ranked next after yugoslavia ? | SELECT "nation" FROM table_203_113 WHERE "rank" = (SELECT "rank" FROM table_203_113 WHERE "nation" = 'yugoslavia') + 1 |
CREATE TABLE table_17103566_1 (
team_2 VARCHAR,
result VARCHAR
) | What is team 2 where the result is ICL world by 8 wickets? | SELECT team_2 FROM table_17103566_1 WHERE result = "ICL World by 8 wickets" |
CREATE TABLE table_28591 (
"Engine Family" text,
"Cylinder Layout" text,
"Displacement(s)" text,
"Injection type" text,
"Years produced" text
) | The engine family MaxxForce 5 in the years produced 2007-current, have what cylinder layout? | SELECT "Cylinder Layout" FROM table_28591 WHERE "Years produced" = '2007-current' AND "Engine Family" = 'MaxxForce 5' |
CREATE TABLE table_26423157_2 (
seed VARCHAR,
school VARCHAR
) | What seed was California? | SELECT seed FROM table_26423157_2 WHERE school = "California" |
CREATE TABLE table_38394 (
"Name" text,
"Years of Operation" text,
"Location" text,
"Historical Photos" text,
"Year Clubhouse Constructed" text,
"Sign-in/Bicker" text,
"Year co-ed" text
) | What is the location of the ivy club? | SELECT "Location" FROM table_38394 WHERE "Name" = 'the ivy club' |
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_... | Show me a bar chart for what are the different product names? What is the average product price for each of them?, order by the X-axis from low to high. | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name |
CREATE TABLE table_name_64 (
fcc_info VARCHAR,
frequency_mhz VARCHAR
) | I need the FCC info on the radio Frequency MHz 107.5? | SELECT fcc_info FROM table_name_64 WHERE frequency_mhz = 107.5 |
CREATE TABLE table_26218783_7 (
status VARCHAR,
sd VARCHAR
) | What is the status when sd is 15? | SELECT status FROM table_26218783_7 WHERE sd = 15 |
CREATE TABLE table_32080 (
"Model" text,
"Release date" text,
"Sensor res., size" text,
"Lens(35mmequiv.) zoom, aperture" text,
"Screen size,pixels" text,
"Dimensions W\u00d7H\u00d7D (mm)" text,
"Weight" text
) | What is the screen size and pixel amount of model p5000 when the dimensions are 98 64.5 41? | SELECT "Screen size,pixels" FROM table_32080 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '98×64.5×41' AND "Model" = 'p5000' |
CREATE TABLE table_37952 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
) | What week had a lower attendance than 51,423 but was still higher than the other weeks? | SELECT MAX("Week") FROM table_37952 WHERE "Attendance" < '51,423' |
CREATE TABLE table_35055 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
) | Which round was Brian Elder taken in? | SELECT MIN("Round") FROM table_35055 WHERE "Player" = 'brian elder' |
CREATE TABLE table_2756 (
"Pos" text,
"##" real,
"Name" text,
"Team" text,
"Lap One" text,
"Lap Two" text,
"Lap Three" text,
"Lap Four" text,
"Total Time" text,
"Avg. Speed" text
) | How many lap two's did marco andretti do? | SELECT COUNT("Lap Two") FROM table_2756 WHERE "Name" = 'Marco Andretti' |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a line chart about the change of employee_id over hire_date . | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
CREATE TABLE table_name_63 (
circuit VARCHAR,
winning_constructor VARCHAR,
name VARCHAR
) | Name the circuit for darracq and name of cuban race | SELECT circuit FROM table_name_63 WHERE winning_constructor = "darracq" AND name = "cuban race" |
CREATE TABLE table_name_94 (
money___ INTEGER,
country VARCHAR,
player VARCHAR
) | What was the average money for United States when Lanny Wadkins played? | SELECT AVG(money___) AS $__ FROM table_name_94 WHERE country = "united states" AND player = "lanny wadkins" |
CREATE TABLE table_27275 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Name the cfl team for steven turner | SELECT "CFL Team" FROM table_27275 WHERE "Player" = 'Steven Turner' |
CREATE TABLE table_50856 (
"Internet Plan" text,
"Downstream" text,
"Upstream" text,
"Bandwidth Included" text,
"Price" text
) | What is Downstream, when Upstream is '384 kbit'? | SELECT "Downstream" FROM table_50856 WHERE "Upstream" = '384 kbit' |
CREATE TABLE table_24775 (
"Dates (MDY)" text,
"Gross Sales" text,
"Tickets Sold / Available" text,
"Shows / Sellout" text,
"Sellout (%)" text
) | Between November 25 30, 2008 the sellout rate was at 75%, indicating that the ration between shows to sellout was what? | SELECT "Shows / Sellout" FROM table_24775 WHERE "Sellout (%)" = '75%' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | what was the name of the lab test that patient 59728 had received last until 02/2104? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59728) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-02' ORDER BY labevents.charttime DESC LIMIT 1) |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those products with a price between 60 and 120, what is the relationship between price and manufacturer , and group by attribute name? | SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... | How many answers are there for a tag?. | SELECT COUNT(p1.Id) FROM Posts AS p1 INNER JOIN PostTags AS pt ON pt.TagId = @TagId INNER JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND pt.PostId = p2.Id |
CREATE TABLE table_name_3 (
length VARCHAR,
year VARCHAR
) | What is the length of the version from 2003? | SELECT length FROM table_name_3 WHERE year = 2003 |
CREATE TABLE table_26824484_1 (
title VARCHAR,
directed_by VARCHAR,
written_by VARCHAR
) | Which episode was directed by Jeff Woolnough and written by Christopher Ambrose? | SELECT title FROM table_26824484_1 WHERE directed_by = "Jeff Woolnough" AND written_by = "Christopher Ambrose" |
CREATE TABLE table_23345 (
"Rank" real,
"City" text,
"1890 census" text,
"1910 census" real,
"1920 census" real,
"1930 census" real,
"1940 census" real
) | For cities with a census of 74000 in 1920, what was their census in 1890? | SELECT "1890 census" FROM table_23345 WHERE "1920 census" = '74000' |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | Can you give a histogram to compare the number of flights to each destination city?, show in asc by the x-axis. | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination |
CREATE TABLE table_train_197 (
"id" int,
"dyscrasia" bool,
"gender" string,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | known bleeding diathesis or dyscrasia | SELECT * FROM table_train_197 WHERE bleeding = 1 OR dyscrasia = 1 |
CREATE TABLE table_name_21 (
team VARCHAR,
year INTEGER
) | Are there any Teams after 1997? | SELECT team FROM table_name_21 WHERE year > 1997 |
CREATE TABLE table_name_96 (
set_1 VARCHAR,
score VARCHAR
) | What is the Set 1 with a Score with 3 2? | SELECT set_1 FROM table_name_96 WHERE score = "3–2" |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | Before taking SWC 200 , what are some other courses that might be useful to take ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SWC' AND number = 200 |
CREATE TABLE table_72256 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the season where the episode 'when worlds collide' was shown? | SELECT MAX("Season #") FROM table_72256 WHERE "Title" = 'When Worlds Collide' |
CREATE TABLE table_10967 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Tell me the pole position for graham hill the fastest lap and winning driver of him on 30 may | SELECT "Pole position" FROM table_10967 WHERE "Fastest lap" = 'graham hill' AND "Winning driver" = 'graham hill' AND "Date" = '30 may' |
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 diagnoses short title is chr syst/diastl hrt fail? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail" |
CREATE TABLE table_16409745_1 (
dimensions__mm_ VARCHAR,
product VARCHAR
) | What are the mm dimensions of the Plustek Mobileoffice D28 Corporate? | SELECT dimensions__mm_ FROM table_16409745_1 WHERE product = "Plustek MobileOffice D28 Corporate" |
CREATE TABLE table_61514 (
"Region" text,
"Date" text,
"Label" text,
"Format(s)" text,
"Catalog" text
) | What is the dage of catalog asw 28033? | SELECT "Date" FROM table_61514 WHERE "Catalog" = 'asw 28033' |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | How many females are in the network? | SELECT COUNT(*) FROM person WHERE gender = 'female' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.