table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE train (
train_number VARCHAR,
name VARCHAR,
TIME VARCHAR
) | show all train numbers and names ordered by their time from early to late. | SELECT train_number, name FROM train ORDER BY TIME |
CREATE TABLE table_66788 (
"Rank" text,
"Goals" text,
"Player" text,
"Club" text,
"Season" text
) | What club scored 143 goals? | SELECT "Club" FROM table_66788 WHERE "Goals" = '143' |
CREATE TABLE table_73910 (
"Institution" text,
"Location (all in Ohio)" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" text,
"Joined" real,
"Left" real,
"Current Conference" text
) | Which year did enrolled Gambier members leave? | SELECT MIN("Left") FROM table_73910 WHERE "Location (all in Ohio)" = 'Gambier' |
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
... | A bar chart for giveing me the number of the descriptions of the service types that cost more than 100, and sort x-axis from high to low order please. | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description DESC |
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 prescription... | how many patients are admitted in clinic referral/premature and diagnosed with primary disease left femur fracture? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "LEFT FEMUR FRACTURE" |
CREATE TABLE table_test_5 (
"id" int,
"systemic_lupus_erythematosus" bool,
"anemia" bool,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estim... | severe renal, lung and liver disease | SELECT * FROM table_test_5 WHERE renal_disease = 1 OR lung_disease = 1 OR liver_disease = 1 |
CREATE TABLE festival_detail (
festival_id number,
festival_name text,
chair_name text,
location text,
year number,
num_of_audience number
)
CREATE TABLE artwork (
artwork_id number,
type text,
name text
)
CREATE TABLE nomination (
artwork_id number,
festival_id number,
... | Show the names of artworks in ascending order of the year they are nominated in. | SELECT T2.name FROM nomination AS T1 JOIN artwork AS T2 ON T1.artwork_id = T2.artwork_id JOIN festival_detail AS T3 ON T1.festival_id = T3.festival_id ORDER BY T3.year |
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,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees who was hired before 2002-06-21, for commission_pct, hire_date, visualize the trend. | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' |
CREATE TABLE table_30682 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) | What is the title of the episode watched by 0.88 million U.S. viewers? | SELECT "Title" FROM table_30682 WHERE "U.S. viewers (million)" = '0.88' |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | what is the drug that patient 54386 was prescribed with within 2 days after having undergone entral infus nutrit sub on the last hospital encounter? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 54386 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... |
CREATE TABLE table_16857 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | Who are the players that played for the jazz from 1979-86 | SELECT "Player" FROM table_16857 WHERE "Years for Jazz" = '1979-86' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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,
insuranc... | what would be the maximum daily number of patients diagnosed with fall from chair in this year? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall from chair') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's... |
CREATE TABLE table_203_3 (
id number,
"province" text,
"capital" text,
"population" number,
"density" text,
"municipalities" text,
"legal districts" number
) | how many municipalities exist in the province of cadiz ? | SELECT "municipalities" FROM table_203_3 WHERE "province" = 'cadiz' |
CREATE TABLE table_55864 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | In what county is the entry that has a Construction Completed date of 07/19/2000 and a Listed date of 09/21/1984 located? | SELECT "County" FROM table_55864 WHERE "Listed" = '09/21/1984' AND "Construction completed" = '07/19/2000' |
CREATE TABLE table_name_1 (
player VARCHAR,
score VARCHAR,
place VARCHAR
) | What is the T4 Place Player with a Score of more than 66? | SELECT player FROM table_name_1 WHERE score > 66 AND place = "t4" |
CREATE TABLE table_45893 (
"Technology" text,
"\u03b7 (%)" real,
"V OC (V)" text,
"I SC (A)" text,
"W/m\u00b2" text,
"t (\u00b5m)" real
) | What is the sum of t ( m), when Technology is MJ? | SELECT SUM("t (\u00b5m)") FROM table_45893 WHERE "Technology" = 'mj' |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEP... | 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 email and employee_id , order y-axis from high to low order. | SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC |
CREATE TABLE table_204_374 (
id number,
"event" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number,
"ranking" text
) | the 1984 paralympics had a total ranking of 5th , in what other year did the ranking fall above 6th ? | SELECT "event" FROM table_204_374 WHERE "event" <> '1984 winter paralympics' AND "ranking" < 6 |
CREATE TABLE table_name_15 (
home_team VARCHAR,
venue VARCHAR
) | What was the home team that played at Corio Oval? | SELECT home_team FROM table_name_15 WHERE venue = "corio oval" |
CREATE TABLE table_52127 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
) | What was the Date of Country of United States? | SELECT "Date" FROM table_52127 WHERE "Country" = 'united states' |
CREATE TABLE table_69466 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Years" text,
"Goals" real
) | What is the lowest ranking for Paul Mctiernan? | SELECT MIN("Ranking") FROM table_69466 WHERE "Name" = 'paul mctiernan' |
CREATE TABLE table_34672 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" real
) | What is the best time for marcus marshall? | SELECT AVG("Best") FROM table_34672 WHERE "Name" = 'marcus marshall' |
CREATE TABLE table_name_68 (
crowd INTEGER,
away_team VARCHAR
) | In games where st kilda was the away team, what was the smallest crowd? | SELECT MIN(crowd) FROM table_name_68 WHERE away_team = "st kilda" |
CREATE TABLE table_72380 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the districk for larry mcdonald | SELECT "District" FROM table_72380 WHERE "Incumbent" = 'Larry McDonald' |
CREATE TABLE table_203_862 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
) | what is the name of the first song listed on this chart ? | SELECT "song" FROM table_203_862 WHERE id = 1 |
CREATE TABLE table_47758 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | On what Date was the Result of the game W 30 15? | SELECT "Date" FROM table_47758 WHERE "Result" = 'w 30–15' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | calculate the maximum age of married patients who are aged 45 years or more. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "45" |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartment_Facilities (
apt_id I... | A bar chart for what are the number of the facility codes of the apartments with more than four bedrooms?, and sort in ascending by the the number of facility code. | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | questions only tagged with merge. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '<cognito-forms>' |
CREATE TABLE table_name_99 (
location VARCHAR,
method VARCHAR,
res VARCHAR
) | Which Location has a Method of decision (unanimous), and Res of win x? | SELECT location FROM table_name_99 WHERE method = "decision (unanimous)" AND res = "win x" |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
ins... | How many classes in the Fall and Winter term are 500 -level classes ? | SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester... |
CREATE TABLE table_44420 (
"q > 1" real,
"q > 1.05" real,
"q > 1.1" real,
"q > 1.2" real,
"q > 1.3" real,
"q > 1.4" real
) | What is the sum of q > 1 when q > 1.05 is bigger than 18,233, and a q > 1.4 less than 112, and q > 1.1 is 13,266? | SELECT COUNT("q > 1") FROM table_44420 WHERE "q > 1.05" > '18,233' AND "q > 1.4" < '112' AND "q > 1.1" = '13,266' |
CREATE TABLE table_8026 (
"World Record" text,
"Press" text,
"92.5" text,
"Hans W\u00f6lpert" text,
"Mannheim ( GER )" text
) | Which 92.5 holds the world record? | SELECT "World Record" FROM table_8026 WHERE "Press" = '92.5' |
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patie... | A bar chart for listing the number of the names of patients who have made appointments, I want to display x-axis in desc order. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name DESC |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varc... | 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, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
CREATE TABLE table_58137 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was the crowd larger than 16,000 people and the away team scored 8.11 (59)? | SELECT "Date" FROM table_58137 WHERE "Crowd" > '16,000' AND "Away team score" = '8.11 (59)' |
CREATE TABLE table_name_89 (
region VARCHAR,
catalog VARCHAR
) | What is the Region with a Catalog of alca-487? | SELECT region FROM table_name_89 WHERE catalog = "alca-487" |
CREATE TABLE table_name_19 (
original_channel VARCHAR,
programme VARCHAR
) | Which channel did Going for Gold air on? | SELECT original_channel FROM table_name_19 WHERE programme = "going for gold" |
CREATE TABLE table_name_15 (
bronze INTEGER,
total INTEGER
) | Which Bronze has a Total smaller than 1? | SELECT AVG(bronze) FROM table_name_15 WHERE total < 1 |
CREATE TABLE table_31824 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real,
"Record" text
) | Tell mem the opponent for result of w 31-21 | SELECT "Opponent" FROM table_31824 WHERE "Result" = 'w 31-21' |
CREATE TABLE table_name_60 (
played INTEGER,
lost VARCHAR,
drawn VARCHAR,
difference VARCHAR
) | What is the highest played that has a drawn less than 9, 36 as the difference, with a lost greater than 7? | SELECT MAX(played) FROM table_name_60 WHERE drawn < 9 AND difference = "36" AND lost > 7 |
CREATE TABLE table_22032599_1 (
result VARCHAR,
film_title_used_in_nomination VARCHAR
) | What was the result for City of the Sun? | SELECT result FROM table_22032599_1 WHERE film_title_used_in_nomination = "City of the Sun" |
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 number of patients whose gender is m and year of birth is less than 2060? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2060" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | what is the hospital's average total cost when it includes remov ext immobilization since 2104? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remov ext immobilization')) AND STRFTIME('%y', cost.charg... |
CREATE TABLE table_14091 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" text,
"Average Ratings" text
) | What's the ratings of TBS of Episode 10 and had a Japanese title of Scandal? | SELECT "Average Ratings" FROM table_14091 WHERE "TV Station" = 'tbs' AND "Episodes" = '10' AND "Japanese Title" = 'scandal' |
CREATE TABLE table_61583 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
) | What term end had minister Danny Ayalon? | SELECT "Term end" FROM table_61583 WHERE "Minister" = 'danny ayalon' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_lab... | what was the three most frequently done surgeries for patients 20s? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
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,
... | what is gender and religion of subject id 71798? | SELECT demographic.gender, demographic.religion FROM demographic WHERE demographic.subject_id = "71798" |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | Return the names of entrepreneurs. | SELECT T2.name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id |
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, a bar chart shows the distribution of name and the average of code , and group by attribute name, and could you list bar in descending order? | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
CREATE TABLE table_name_20 (
date VARCHAR,
record VARCHAR
) | Name the date for record of 74-84 | SELECT date FROM table_name_20 WHERE record = "74-84" |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and salary , and order by the X in descending. | SELECT JOB_ID, SALARY 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_2142 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) | where is the private/presbyterian institute | SELECT "Location" FROM table_2142 WHERE "Type" = 'Private/Presbyterian' |
CREATE TABLE table_20753 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Date" text,
"Crowd" real
) | When the crowd was 8642 what was the away team's score? | SELECT "Away team score" FROM table_20753 WHERE "Crowd" = '8642' |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Give me the comparison about meter_100 over the Time by a bar chart, show in ascending by the total number. | SELECT Time, meter_100 FROM swimmer ORDER BY meter_100 |
CREATE TABLE table_36728 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many Points have a Record of 25 10 11, and a January larger than 28? | SELECT COUNT("Points") FROM table_36728 WHERE "Record" = '25–10–11' AND "January" > '28' |
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... | make a count of the number of patients who are discharged from the hospital in 2105. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '2105' |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Your RANK on STACKOVERFLOW.COM Worldwide,in india,in mumbai. | SELECT d.Reputation, d.RANK AS RANK_INDIA FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS RANK FROM Users WHERE LOWER(Location) LIKE '%india%') AS d WHERE d.Id = @UserId |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | find the diagnoses of jane dillard. | SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jane Dillard" |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
progr... | Which Fall or Winter classes can I take in order to meet my Other requirement ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester 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, program_course AS PROGRAM_COURSEalias0... |
CREATE TABLE table_name_24 (
losses INTEGER,
gains INTEGER
) | Can you tell me the lowest Losses that has the Gains smaller than 0? | SELECT MIN(losses) FROM table_name_24 WHERE gains < 0 |
CREATE TABLE table_name_76 (
republican VARCHAR,
dates_administered VARCHAR
) | Who is the republican Jon Huntsman that was administered June 19, 2008? | SELECT republican AS :_jon_huntsman FROM table_name_76 WHERE dates_administered = "june 19, 2008" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | how long was the last of patient 015-66570's stay in the hospital? | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '015-66570' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE table_50862 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner" text,
"Finalist" text,
"Semifinalists" text
) | WHich Tournament has a Finalist of gustavo kuerten (4)? | SELECT "Tournament" FROM table_50862 WHERE "Finalist" = 'gustavo kuerten (4)' |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGui... | upvote/downvote ratio: 2015 through 2020. Look at the Graph, to see the evolution of the upvote/downvote ratio. | SELECT DATEFROMPARTS(YEAR(CreationDate), MONTH(CreationDate), 1) AS YearMonth, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT), 0)) AS Ratio FROM Votes WHERE CreationDate > '01-01-2015' AND CreationDate < '12-31-2020' GROUP BY DATEF... |
CREATE TABLE table_203_501 (
id number,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"premiere date" text,
"place, theatre" text
) | what was the year of the last title ? | SELECT MAX("premiere date") FROM table_203_501 |
CREATE TABLE table_79138 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"Team from" text,
"League from" text
) | What is the position of the team player from Aik? | SELECT "Position" FROM table_79138 WHERE "Team from" = 'aik' |
CREATE TABLE campuses (
Id VARCHAR
) | How many CSU campuses are there? | SELECT COUNT(*) FROM campuses |
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... | Find All_Home and School_ID , and group by attribute ACC_Road, and visualize them by a bar chart. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home |
CREATE TABLE table_57659 (
"Date" text,
"Location" text,
"Opponent" text,
"Score" text,
"Competition" text
) | When was the 2014 World Cup Qualification in Kampala that had Angola as an opponent | SELECT "Date" FROM table_57659 WHERE "Competition" = '2014 world cup qualification' AND "Location" = 'kampala' AND "Opponent" = 'angola' |
CREATE TABLE table_name_10 (
home_team VARCHAR,
venue VARCHAR
) | What was the name of the home team playing at the Junction Oval venue? | SELECT home_team FROM table_name_10 WHERE venue = "junction oval" |
CREATE TABLE table_16715 (
"Season" real,
"Premier" text,
"Runner Up" text,
"Score" text,
"Venue" text,
"Attendance" real,
"Premiership" text
) | What venue has an attendance of 30824 at Essendon in 1984? | SELECT "Venue" FROM table_16715 WHERE "Premier" = 'Essendon' AND "Attendance" = '30824' |
CREATE TABLE table_58667 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What is Tournament, when Date is '6 October 2008'? | SELECT "Tournament" FROM table_58667 WHERE "Date" = '6 october 2008' |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE... | show me all the flights from CHARLOTTE to CLEVELAND | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEV... |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length in... | i would like information on flights from PHILADELPHIA to OAKLAND california on friday afternoon | 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 = 'OAKLAND' AND date_day.day_number = 25 AND date_day.month_number = 6 AND ... |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescript... | Votes on questions and answers for [rust] per day averaged over months since 2013. | SELECT MIN(Votes.CreationDate), (COUNT(*) + 0.0) / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(Votes.CreationDate)), '%d') AS "votes per day" FROM Posts LEFT JOIN PostTags AS qTags ON qTags.PostId = Posts.Id LEFT JOIN PostTags AS aTags ON aTags.PostId = Posts.ParentId INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE (VoteTypeI... |
CREATE TABLE table_16617025_1 (
season__number VARCHAR,
directed_by VARCHAR
) | In what seasons did Kate Woods direct Without A Trace? | SELECT season__number FROM table_16617025_1 WHERE directed_by = "Kate Woods" |
CREATE TABLE table_69175 (
"Film" text,
"Director(s)" text,
"Producer(s)" text,
"Writer(s)" text,
"Date" text,
"Award" text
) | What award did Andrew Ryder win as producer? | SELECT "Award" FROM table_69175 WHERE "Producer(s)" = 'andrew ryder' |
CREATE TABLE table_name_23 (
first_time_as_hc_climb VARCHAR,
height__m_ VARCHAR,
most_recent VARCHAR,
no_of_times_visited VARCHAR,
no_of_hc_climbs VARCHAR
) | When was the first HC climb before 2013 with more than 3 times visited, more than 4 HC climbs, and a height of 1669? | SELECT first_time_as_hc_climb FROM table_name_23 WHERE no_of_times_visited > 3 AND no_of_hc_climbs = 4 AND most_recent < 2013 AND height__m_ = "1669" |
CREATE TABLE table_70522 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | Name the finish which has qual of 144.817 | SELECT "Finish" FROM table_70522 WHERE "Qual" = '144.817' |
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 patient 62977's first visit to the hospital in 2101? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 62977 AND STRFTIME('%y', admissions.admittime) = '2101' ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE table_name_83 (
player VARCHAR,
chng VARCHAR,
rating VARCHAR,
prev VARCHAR
) | What player has a rating greater than 2746, with a prev less than 4, and +4 as the chng? | SELECT player FROM table_name_83 WHERE rating > 2746 AND prev < 4 AND chng = "+4" |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolea... | Get user list of SO whose bio contains given words. | SELECT 'id' AS "user_link" FROM Users WHERE AboutMe LIKE '%##SearchText##%' LIMIT 10 |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
da... | show me all all flights from PITTSBURGH to ATLANTA on wednesday which leave before 1200 and serve BREAKFAST | 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, food_service WHERE (((flight.departure_time < 1200 AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'BREAKFAST') AND ... |
CREATE TABLE table_17693171_1 (
time_retired VARCHAR,
driver VARCHAR
) | What is the time/retired if the driver is Ed Carpenter? | SELECT time_retired FROM table_17693171_1 WHERE driver = "Ed Carpenter" |
CREATE TABLE table_20803241_1 (
cash_fare VARCHAR,
type_of_fare VARCHAR
) | When fort irwin-barstow/victorville is the type of fare what is the cash fare? | SELECT cash_fare FROM table_20803241_1 WHERE type_of_fare = "Fort Irwin-Barstow/Victorville" |
CREATE TABLE table_name_58 (
affiliation VARCHAR,
owned_since VARCHAR,
channel___tv___rf__ VARCHAR
) | What affiliation has an owned since larger than 1991, and also has a channel (tv/rf) of 42? | SELECT affiliation FROM table_name_58 WHERE owned_since > 1991 AND channel___tv___rf__ = "42" |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is the number of patients less than 80 years who had urine lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Urine" |
CREATE TABLE table_4706 (
"Tournament" text,
"1943" text,
"1944" text,
"1945" text,
"1948" text,
"1949" text,
"1951" text,
"1954" text,
"1956\u20131968" text,
"1969" text,
"Career SR" text
) | What did the tournament with an A in 1956-1958, an A in 1954, and an F in 1948 get in 1969? | SELECT "1969" FROM table_4706 WHERE "1956\u20131968" = 'a' AND "1954" = 'a' AND "1948" = 'f' |
CREATE TABLE table_2562572_54 (
largest_ethnic_group__2002_ VARCHAR,
cyrillic_name_other_names VARCHAR
) | What is the largest ethnic group in 2002 for the cyrillic name, other name of ? | SELECT largest_ethnic_group__2002_ FROM table_2562572_54 WHERE cyrillic_name_other_names = "Бешка" |
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... | Bar chart x axis acc road y axis how many acc road | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
... | How many papers has dominik moritz written ? | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'dominik moritz' AND writes.authorid = author.authorid |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
i... | what was the last drug patient 006-195316 was prescribed via intravenou in this hospital visit? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316' AND patient.hospitaldischargetime IS NULL)) AND medicat... |
CREATE TABLE table_25007 (
"Character" text,
"Original Manchester Performer" text,
"Original West End Performer" text,
"Original Broadway Performer" text,
"Original UK Tour Performer" text,
"Original Non-Equity US Tour Performer" text,
"Original Italian Tour Performer" text,
"Original So... | Who was the Manchester performer of Lisa Davina Phillip's character? | SELECT "Original Manchester Performer" FROM table_25007 WHERE "Original West End Performer" = 'Lisa Davina Phillip' |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | What is the number of cities in each country? Return a bar chart, and sort x-axis in descending order. | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY T2.Name DESC |
CREATE TABLE ref_product_categories (
product_category_code text,
product_category_description text,
unit_of_measure text
)
CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic_value text
)
CREATE TABLE ref_colors (
color_code text,
... | Return the characteristic names of the 'sesame' product. | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" |
CREATE TABLE 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, give me the comparison about price over the name , and group by attribute headquarter by a bar chart, and I want to order Y in ascending order. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price |
CREATE TABLE table_name_33 (
date VARCHAR,
venue VARCHAR
) | What was the date for Westport? | SELECT date FROM table_name_33 WHERE venue = "westport" |
CREATE TABLE table_name_6 (
Id VARCHAR
) | What is the average 1940 value where 1929 values are 101.4 and 1933 values are over 68.3? | SELECT AVG(1940) FROM table_name_6 WHERE 1929 = 101.4 AND 1933 > 68.3 |
CREATE TABLE table_10614 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did Melbourne play as the home team? | SELECT "Venue" FROM table_10614 WHERE "Home team" = 'melbourne' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.