table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
pa... | calculate the number of patients who underwent a laboratory test for lithium until 2100. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'lithium' AND STRFTIME('%y', lab.labresulttime) <= '2100') |
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(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For all employees who have the letters D or S in their first name, a scatter chart shows the correlation between salary and manager_id . | SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE Faculty (
rank VARCHAR
) | What ranks do we have for faculty? | SELECT DISTINCT rank FROM Faculty |
CREATE TABLE table_26293 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Matchup/Results" text,
"Attendance" real,
"Payout (US$)" text
) | How many different items appear in he attendance column at Sun Devil Stadium? | SELECT COUNT("Attendance") FROM table_26293 WHERE "Stadium" = 'Sun Devil Stadium' |
CREATE TABLE table_72083 (
"Country ( exonym )" text,
"Capital ( exonym )" text,
"Country ( endonym )" text,
"Capital ( endonym )" text,
"Official or native language(s) (alphabet/script)" text
) | What is the local name given to the capital of Anguilla? | SELECT "Capital ( endonym )" FROM table_72083 WHERE "Country ( endonym )" = 'Anguilla' |
CREATE TABLE table_27713583_11 (
location_attendance VARCHAR,
date VARCHAR
) | Name the location attendance april 5 | SELECT location_attendance FROM table_27713583_11 WHERE date = "April 5" |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
) | Return the number of the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones. | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" |
CREATE TABLE table_2626495_1 (
originalairdate VARCHAR,
directed_by VARCHAR
) | how many times was the episode directed by maury geraghty originally aired? | SELECT COUNT(originalairdate) FROM table_2626495_1 WHERE directed_by = "Maury Geraghty" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | when was the first time in which patient 92721 received a dx ultrasound-heart procedure since 2105? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dx ultrasound-heart') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92721) AND STRF... |
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... | provide the number of patients whose age is less than 31 and drug route is ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.route = "IVPCA" |
CREATE TABLE table_name_60 (
other VARCHAR,
player VARCHAR,
total VARCHAR
) | What is the number for other when Adam Pepper is the player with a total more than 7? | SELECT COUNT(other) FROM table_name_60 WHERE player = "adam pepper" AND total > 7 |
CREATE TABLE table_17434 (
"#" real,
"President" text,
"Date of birth" text,
"Date of inauguration" text,
"Age at inauguration" text,
"End of term" text,
"Length of retirement" text,
"Date of death" text,
"Lifespan" text
) | what's the date of birth with end of term being 2april1969 | SELECT "Date of birth" FROM table_17434 WHERE "End of term" = '2April1969' |
CREATE TABLE table_14260687_3 (
blackberry_os VARCHAR,
other VARCHAR,
quarter VARCHAR
) | During the quarter of 2012 Q2, how many millions of Blackberry OS phones where shipped when 0.1 million others were shipped? | SELECT COUNT(blackberry_os) FROM table_14260687_3 WHERE other = "0.1" AND quarter = "2012 Q2" |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_... | list all round trip fares from PHOENIX to WASHINGTON | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... |
CREATE TABLE table_204_699 (
id number,
"district" text,
"name" text,
"party" text,
"residence" text,
"first served" number
) | angel fuentes and gilbert wilson were both from which residence ? | SELECT "residence" FROM table_204_699 WHERE "name" = 'angel fuentes' |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
... | Show the number of companies whose headquarters are not from USA fpr each main industry in a bar chart, and display y axis from low to high order please. | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY COUNT(Main_Industry) |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is date of birth and admission time of subject name lue white? | SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Lue White" |
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,
... | how many newborn patients had the diagnosis long title hyperpotassemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Hyperpotassemia" |
CREATE TABLE table_51935 (
"Club" text,
"Sport" text,
"League" text,
"Venue" text,
"Established" real,
"Championships" real
) | How many championships did the team or teams established in 1976 win? | SELECT SUM("Championships") FROM table_51935 WHERE "Established" = '1976' |
CREATE TABLE table_38233 (
"Nation" text,
"T Score" real,
"A Score" real,
"E Score" real,
"Total" real
) | What was the average T score when the E score was larger than 9.6 and the team was from Spain? | SELECT AVG("T Score") FROM table_38233 WHERE "Nation" = 'spain' AND "E Score" > '9.6' |
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 marital status is single and admission year is less than 2179? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2179" |
CREATE TABLE table_name_32 (
date VARCHAR,
livery VARCHAR
) | When was the livery of Kinneil Sandy Red? | SELECT date FROM table_name_32 WHERE livery = "kinneil sandy red" |
CREATE TABLE table_25831 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the number of date for w 107 97 (ot) | SELECT COUNT("Date") FROM table_25831 WHERE "Score" = 'W 107–97 (OT)' |
CREATE TABLE table_14006_1 (
condition VARCHAR,
bleeding_time VARCHAR,
prothrombin_time VARCHAR
) | what's the condition with bleeding time being unaffected and prothrombin time being prolonged | SELECT condition FROM table_14006_1 WHERE bleeding_time = "Unaffected" AND prothrombin_time = "Prolonged" |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Course_Enrolment (
registration_... | Find the number of the the date of enrollment of the 'Spanish' course, I want to show in desc by the y-axis. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment) DESC |
CREATE TABLE table_22329 (
"Serial No." real,
"District" text,
"Headquartered City" text,
"City Population (2009)" real,
"City Area(km 2 )" real
) | What is the area of the city in the Sargodha district? | SELECT COUNT("City Area(km 2 )") FROM table_22329 WHERE "District" = 'Sargodha District' |
CREATE TABLE gradeconversion (
lettergrade text,
gradepoint number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age num... | What is the name of the department with the most students minoring in it? | SELECT T1.dname FROM department AS T1 JOIN minor_in AS T2 ON T1.dno = T2.dno GROUP BY T2.dno ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id num... | Eligible to vote on controversial Docs edit. | SELECT b.Name, SUM(CASE WHEN b.Class = 1 THEN 1 ELSE 0 END) AS Gold, SUM(CASE WHEN b.Class = 2 AND u.Reputation > 5000 THEN 1 ELSE 0 END) AS "Silver + 5k", SUM(CASE WHEN b.Class = 3 AND u.Reputation > 10000 THEN 1 ELSE 0 END) AS "Bronze + 10k", 1 AS "Jon Skeet" FROM (SELECT UserId, Name, MIN(Class) AS class FROM Badges... |
CREATE TABLE table_20023 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | Name the number ends won when L is 4 and stolen ends is 17 | SELECT COUNT("Ends Won") FROM table_20023 WHERE "L" = '4' AND "Stolen Ends" = '17' |
CREATE TABLE table_name_99 (
score VARCHAR,
away_team VARCHAR
) | what is the score when the away team is rivercity rage? | SELECT score FROM table_name_99 WHERE away_team = "rivercity rage" |
CREATE TABLE table_63270 (
"Name" text,
"Games" text,
"A-League" text,
"Finals" text,
"Goals" real,
"Assists" real,
"Years" text
) | What is the lowest number of goals joe keenan, who has more than 1 assists, had in 2007/08? | SELECT MIN("Goals") FROM table_63270 WHERE "Years" = '2007/08' AND "Name" = 'joe keenan' AND "Assists" > '1' |
CREATE TABLE table_15637071_1 (
commenced_operations INTEGER
) | When did the oldest airline start operations? | SELECT MIN(commenced_operations) FROM table_15637071_1 |
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
... | Can you draw a bar chart to show the number of positions of the pilots?, and I want to rank by the Y from low to high. | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY COUNT(Position) |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
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 cours... | Of all the courses show me the ones that involve parts of Information Industry and Sociocultural Planning and Architecture . | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Sociocultural Planning and Architecture%' OR course.description LIKE '%Sociocultural Planning and Architecture%' OR course.name LIKE '%Sociocultural Planning and Archite... |
CREATE TABLE table_32573 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date was the venue of Glenferrie Oval? | SELECT "Date" FROM table_32573 WHERE "Venue" = 'glenferrie oval' |
CREATE TABLE table_47058 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was the score of the golfer from the united states who had a To par of e? | SELECT SUM("Score") FROM table_47058 WHERE "To par" = 'e' AND "Country" = 'united states' |
CREATE TABLE table_name_58 (
teams VARCHAR,
home VARCHAR
) | What teams has a home of 5-0? | SELECT teams FROM table_name_58 WHERE home = "5-0" |
CREATE TABLE table_75654 (
"Outcome" text,
"Event" text,
"Year" text,
"Venue" text,
"Partner" text
) | What was the Outcome in 1983 of the WD Event? | SELECT "Outcome" FROM table_75654 WHERE "Event" = 'wd' AND "Year" = '1983' |
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,
... | calculate the average age of medicare patients who died before 2111. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dod_year < "2111.0" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | during the current hospital encounter, was patient 20898's respiratory rate ever less than 19.0? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d... |
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,
... | get me the number of patients on main drug prescription who have been diagnosed with hemochromatosis due to repeated red blood cell transfusions. | 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.long_title = "Hemochromatosis due to repeated red blood cell transfusions" AND prescriptions.drug_type = ... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many patients are less than 31 year old with a chemistry lab test category? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab."CATEGORY" = "Chemistry" |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose year of death is less than or equal to 2164 and procedure icd9 code is 9465? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2164.0" AND procedures.icd9_code = "9465" |
CREATE TABLE table_dev_41 (
"id" int,
"gender" string,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"serum_bicarbonate" int,
"renal_disease" bool,
"temperature" float,
"diastolic_blood_pressure_dbp" int,
"liver_disease" bool,
"hdl" int,
"serum_sodium_concentrat... | chronic kidney disease, serum creatinine > 2 mg / dl, chronic liver disease, or uncontrolled hypertension | SELECT * FROM table_dev_41 WHERE kidney_disease = 1 OR serum_creatinine > 2 OR liver_disease = 1 OR hypertension = 1 |
CREATE TABLE table_name_44 (
share_of_votes VARCHAR,
election VARCHAR
) | What is the share of votes in the 2008 election? | SELECT share_of_votes FROM table_name_44 WHERE election = 2008 |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
Owne... | Posts with links to files with particular extension (by CreationDate). | SELECT Id AS "post_link", OwnerUserId AS "user_link", Score, Body FROM Posts WHERE Body LIKE '%http%.##ext?jpg##%' AND CreationDate >= '##Date1?2019-01-01##' AND CreationDate <= '##Date2?2020-01-01##' ORDER BY Id |
CREATE TABLE table_68447 (
"Need" text,
"Being (qualities)" text,
"Having (things)" text,
"Doing (actions)" text,
"Interacting (settings)" text
) | Name the interacting for need of protection | SELECT "Interacting (settings)" FROM table_68447 WHERE "Need" = 'protection' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | Count the number of patients admitted before the year 2150 whose drug route is tp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.route = "TP" |
CREATE TABLE table_10306 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the name of the away team who played Footscray? | SELECT "Away team" FROM table_10306 WHERE "Home team" = 'footscray' |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | what was the age of patient 77676 during their last hospital visit? | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 77676 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_1140103_6 (
date VARCHAR,
circuit VARCHAR
) | What date has a solitudering circuit | SELECT date FROM table_1140103_6 WHERE circuit = "Solitudering" |
CREATE TABLE table_5410 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the result of the 2007 gulf cup of nations? | SELECT "Result" FROM table_5410 WHERE "Competition" = '2007 gulf cup of nations' |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VA... | Stacked bar chart of the number of date account opened for with each other_account_details in each date account opened | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details |
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE a... | What are the dates of ceremony and results for each music festival? | SELECT date_of_ceremony, result FROM music_festival |
CREATE TABLE table_203_562 (
id number,
"state" text,
"no. of candidates" number,
"no. of elected" number,
"total no. of seats in assembly" number,
"year of election" number
) | what state comes after kerala ? | SELECT "state" FROM table_203_562 WHERE id = (SELECT id FROM table_203_562 WHERE "state" = 'kerala') + 1 |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | What classes can be used for PreMajor ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id |
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Da... | Show the number of documents in different starting date and group by starting date with a line chart, list by the X from low to high. | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From ORDER BY Date_in_Location_From |
CREATE TABLE table_13769 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Year joined" real,
"Previous Conference" text,
"Year Left" real,
"Conference joined" text
) | What's the mascot in Anderson for the Independent previous conference? | SELECT "Mascot" FROM table_13769 WHERE "Previous Conference" = 'independent' AND "Location" = 'anderson' |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | The teacher for PATH 643 is whom ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PATH' AND course.number = 643 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... |
CREATE TABLE table_53214 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | What is the date of the election where Sir Christopher William Codrington was elected as First Member and Robert Stayner Holford as the Second Member? | SELECT "Election" FROM table_53214 WHERE "1st Member" = 'sir christopher william codrington' AND "2nd Member" = 'robert stayner holford' |
CREATE TABLE table_204_115 (
id number,
"year" number,
"track" text,
"number" number,
"team" text,
"car" text,
"round result" text
) | which year had a higher round placement , 2006 or 2010 ? | SELECT "year" FROM table_204_115 WHERE "year" IN (2006, 2010) ORDER BY "round result" LIMIT 1 |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE ... | Has mirella lapata written any papers in 2016 ? | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM author, paper, writes WHERE author.authorname = 'mirella lapata' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY writes.authorid |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
... | please list all the flights from KANSAS CITY to CHICAGO on 6 16 | 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 = 'CHICAGO' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d... |
CREATE TABLE table_1342359_15 (
party VARCHAR,
district VARCHAR
) | what are all the party with district being kansas 1 | SELECT party FROM table_1342359_15 WHERE district = "Kansas 1" |
CREATE TABLE table_name_35 (
points VARCHAR,
try_bonus VARCHAR
) | How many points were there when the try bonus was 2? | SELECT points FROM table_name_35 WHERE try_bonus = "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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is date of birth of subject id 3343? | SELECT demographic.dob FROM demographic WHERE demographic.subject_id = "3343" |
CREATE TABLE table_25597136_1 (
date_first_lit VARCHAR,
focal_plane_in_ft__m_ VARCHAR
) | Focal plane in ft (m) is 43ft (13.1m) is the first date lit. | SELECT date_first_lit FROM table_25597136_1 WHERE focal_plane_in_ft__m_ = "43ft (13.1m)" |
CREATE TABLE table_19643196_1 (
fleet__number VARCHAR,
transmission VARCHAR,
engine VARCHAR
) | What is the fleet number when the transmission is Voith D863.4 and the engine is Cummins ISL? | SELECT fleet__number FROM table_19643196_1 WHERE transmission = "Voith D863.4" AND engine = "Cummins ISL" |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | How many of Skeet's rep increase this year comes from old answers of his?. | SELECT YEAR(p.CreationDate) AS "jonsanswerwrittenyear", YEAR(v.CreationDate) AS "votecastyear", COUNT(v.Id) AS "numberofanswers" FROM Votes AS v LEFT OUTER JOIN Posts AS p ON p.Id = v.PostId WHERE VoteTypeId = 2 AND OwnerUserId = 22656 AND YEAR(v.CreationDate) = YEAR(CURRENT_TIMESTAMP()) GROUP BY YEAR(p.CreationDate), ... |
CREATE TABLE table_name_77 (
player VARCHAR,
position VARCHAR,
round VARCHAR
) | Which player is a wide receiver picked in round 7? | SELECT player FROM table_name_77 WHERE position = "wide receiver" AND round = 7 |
CREATE TABLE table_18975 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text
) | Which institution was founded in 1923? | SELECT "Institution" FROM table_18975 WHERE "Founded" = '1923' |
CREATE TABLE table_16278602_1 (
pop_density__per_km²_ VARCHAR,
english_name VARCHAR
) | What is the population density of the Capital Region of Denmark? | SELECT pop_density__per_km²_ FROM table_16278602_1 WHERE english_name = "Capital Region of Denmark" |
CREATE TABLE table_3103 (
"Year" real,
"Location" text,
"Entries" real,
"Winning Boat" text,
"Country" text,
"Skipper" text
) | When 2012 is the year what is the winning boat? | SELECT "Winning Boat" FROM table_3103 WHERE "Year" = '2012' |
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
)
... | how many patients whose discharge location is disch-tran to psych hosp and diagnoses short title is neonatal hypoglycemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.short_title = "Neonatal hypoglycemia" |
CREATE TABLE table_name_82 (
venue VARCHAR,
date VARCHAR
) | What is Venue, when Date is 23,24,26,27,28,29 Feb, 1 Mar 1912? | SELECT venue FROM table_name_82 WHERE date = "23,24,26,27,28,29 feb, 1 mar 1912" |
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 demographic ... | what is drug type and drug route of drug name calcium acetate? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Calcium Acetate" |
CREATE TABLE table_47341 (
"Party" text,
"Previous council" real,
"Staying councillors" real,
"Seats up for election" real,
"Election result" real,
"New council" real
) | Which Staying councillors have a New council of 7, and a Previous council larger than 8? | SELECT AVG("Staying councillors") FROM table_47341 WHERE "New council" = '7' AND "Previous council" > '8' |
CREATE TABLE MINOR_IN (
DNO VARCHAR
)
CREATE TABLE DEPARTMENT (
DName VARCHAR,
DNO VARCHAR
) | Find the name of the department that has no students minored in? | SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TAB... | does DL fly from BOSTON to WASHINGTON | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'DL') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.to_airport = AIRPORT... |
CREATE TABLE table_17324 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What was the score in the game on May 11? | SELECT "Score" FROM table_17324 WHERE "Date" = 'May 11' |
CREATE TABLE table_60717 (
"Greek Designation" text,
"Collegiate Institution" text,
"Charter Date" text,
"Status" text,
"City" text,
"U.S. State/District" text
) | What California city has an active status and a greek designation of established colony? | SELECT "City" FROM table_60717 WHERE "Status" = 'active' AND "U.S. State/District" = 'california' AND "Greek Designation" = 'established colony' |
CREATE TABLE table_23408094_14 (
total_career_titles VARCHAR,
span_of_years_led VARCHAR
) | What were the total career titles of the player who led for 5 years? | SELECT COUNT(total_career_titles) FROM table_23408094_14 WHERE span_of_years_led = 5 |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | A stacked bar graph shows the total number of captains categorize by ranks of different classes, could you list in ascending by the x-axis? | SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class |
CREATE TABLE table_name_50 (
tournament VARCHAR,
margin_of_victory VARCHAR
) | For which tournament was the margin of victory 7 strokes? | SELECT tournament FROM table_name_50 WHERE margin_of_victory = "7 strokes" |
CREATE TABLE table_name_95 (
state VARCHAR,
percent__2009_ VARCHAR
) | Which state has a Percent (2009) of 6.2%? | SELECT state FROM table_name_95 WHERE percent__2009_ = "6.2%" |
CREATE TABLE table_73375 (
"Season" text,
"League" text,
"Division" text,
"GP" real,
"W" real,
"L" real,
"T" real,
"OTL" real,
"SOL" real,
"Pts" real,
"PCT" text,
"GF" real,
"GA" real,
"PIM" real,
"Coach(es)" text,
"Result" text
) | What was the maximum OTL if L is 28? | SELECT MAX("OTL") FROM table_73375 WHERE "L" = '28' |
CREATE TABLE table_17719 (
"Year" real,
"Total Region" real,
"Rockhampton" real,
"Livingstone" real,
"Fitzroy" real,
"Mt Morgan" real
) | what is the maximum total region with fitzroy being 8047 | SELECT MAX("Total Region") FROM table_17719 WHERE "Fitzroy" = '8047' |
CREATE TABLE table_62346 (
"Perpetrator" text,
"Location" text,
"Country" text,
"Killed" real,
"Injured" text
) | How many kills did basobas, florentino have? | SELECT MAX("Killed") FROM table_62346 WHERE "Perpetrator" = 'basobas, florentino' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Find related tags to a given input tag.. | SELECT Tags.TagName AS "tag_name", COUNT(*) AS "number_of_associated_posts" FROM PostTags INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE PostTags.PostId IN (SELECT DISTINCT PostId FROM PostTags INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = '##TagName:string##') AND Tags.TagName != '##TagName:strin... |
CREATE TABLE table_55212 (
"Number & Name" text,
"Description" text,
"Livery" text,
"Owner(s)" text,
"Date" text
) | What owner or owners have an operational description? | SELECT "Owner(s)" FROM table_55212 WHERE "Description" = 'operational' |
CREATE TABLE table_77201 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) | What's the average draw for the song 'stop messin' around'? | SELECT AVG("Draw") FROM table_77201 WHERE "Song" = 'stop messin'' around' |
CREATE TABLE table_name_44 (
lner_class VARCHAR,
wa VARCHAR,
no_built VARCHAR
) | What LINER class has a W.A. of 0-6-0st with a 2 No. Built? | SELECT lner_class FROM table_name_44 WHERE wa = "0-6-0st" AND no_built = 2 |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80... | I want to see trend of how many date account opened by date account opened, order by the date_account_opened in descending. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY date_account_opened DESC |
CREATE TABLE table_50251 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
) | Which institution has a nickname of Blue Hens? | SELECT "Institution" FROM table_50251 WHERE "Nickname" = 'blue hens' |
CREATE TABLE table_name_74 (
drawn VARCHAR,
lost VARCHAR
) | What is the number drawn when 3 have been lost? | SELECT drawn FROM table_name_74 WHERE lost = "3" |
CREATE TABLE table_68077 (
"Week" real,
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Who was the visiting team on weeks under 12 and at Sports Authority Field at Mile High? | SELECT "Visiting Team" FROM table_68077 WHERE "Week" < '12' AND "Stadium" = 'sports authority field at mile high' |
CREATE TABLE table_name_26 (
runner_s__up VARCHAR,
winning_score VARCHAR
) | Which Runner(s)-up has a Winning score of 8 (68-68-72-72=280)? | SELECT runner_s__up FROM table_name_26 WHERE winning_score = –8(68 - 68 - 72 - 72 = 280) |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | patient troy friedman was hospitalized for how many days? | SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Troy Friedman" |
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,
... | give me the number of patients whose diagnoses short title is arthropathy nos-unspec and drug route is po/ng? | 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 = "Arthropathy NOS-unspec" AND prescriptions.route = "PO/NG" |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the four most common drugs prescribed to the cardiomyopathy - dilated male patients of the 30s in the same month after they were diagnosed with cardiomyopathy - dilated since 2102? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiomyopathy - dilated' AND STRFTIME('%y', diagn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.