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 medication (
medicationid ... | count the number of patients who have been given the procedure for a antibacterials - monobactam two times since 2105. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'antibacterials - monobactam' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') GROUP BY patient.uniqu... |
CREATE TABLE table_58274 (
"Competition" text,
"Stage" text,
"Venue" text,
"Date" text,
"Result" text
) | Which stage was being played in Romania? | SELECT "Stage" FROM table_58274 WHERE "Venue" = 'romania' |
CREATE TABLE table_name_6 (
score VARCHAR,
home VARCHAR,
date VARCHAR
) | What is the Score that has a Home of montreal canadiens on april 11? | SELECT score FROM table_name_6 WHERE home = "montreal canadiens" AND date = "april 11" |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | what number of cv cath plcmt w guidance procedures have been completed in 2103? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cv cath plcmt w guidance') AND STRFTIME('%y', procedures_icd.charttime) = '2103' |
CREATE TABLE table_name_5 (
drawn VARCHAR,
club VARCHAR
) | How many draws are for the club senghenydd rfc? | SELECT drawn FROM table_name_5 WHERE club = "senghenydd rfc" |
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,
... | what is procedure icd9 code of subject id 3343? | SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "3343" |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me school_id by acc regular season in a histogram, display in desc by the x axis. | SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY ACC_Regular_Season DESC |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Posts with a single accepted answer that is downvoted at the same time. | SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON p.AcceptedAnswerId = v.PostId INNER JOIN Votes AS upv ON upv.PostId = v.PostId AND upv.VoteTypeId = 2 AND upv.CreationDate = v.CreationDate WHERE v.VoteTypeId = 1 AND p.AnswerCount = 1 |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Number of people of each age. | SELECT Age, COUNT(*) AS UserCount FROM Users WHERE NOT Age IS NULL AND Age > 0 GROUP BY Age ORDER BY Age |
CREATE TABLE table_name_35 (
aprende VARCHAR,
centennial VARCHAR
) | WHich kind of Aprende has a Centennial of 1988? | SELECT aprende FROM table_name_35 WHERE centennial = "1988" |
CREATE TABLE table_38868 (
"Model" text,
"Years" text,
"Engine" text,
"Displ." text,
"Power" text,
"Torque" text
) | What is the power for model 2.0 tdi (cr) dpf, and a Years of 2010 2011? | SELECT "Power" FROM table_38868 WHERE "Model" = '2.0 tdi (cr) dpf' AND "Years" = '2010–2011' |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
... | do you have a flight from ATLANTA to BOSTON | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... |
CREATE TABLE table_65182 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score when the tie number was a replay and the home team was mansfield town? | SELECT "Score" FROM table_65182 WHERE "Tie no" = 'replay' AND "Home team" = 'mansfield town' |
CREATE TABLE table_name_7 (
rank INTEGER,
nation VARCHAR
) | What is the lowest rank that spain got? | SELECT MIN(rank) FROM table_name_7 WHERE nation = "spain" |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number... | Find new questions with no answers. | SELECT Posts.CreationDate, Posts.Id, Posts.Title, Posts.Tags, Posts.ViewCount, Posts.Body, Posts.OwnerUserId, Posts.OwnerDisplayName, Posts.Score, Posts.FavoriteCount, Posts.PostTypeId, Posts.LastEditDate, Posts.LastActivityDate, Posts.FavoriteCount, Posts.ClosedDate, Users.Reputation, Users.UpVotes, Users.DownVotes, U... |
CREATE TABLE table_31312 (
"Name" text,
"Position" text,
"Country" text,
"Years" text,
"Games" real,
"Minutes" real,
"Goals" real,
"Assists" real,
"Int. caps" real,
"Int. goals" real
) | What are the names of players from the dr congo? | SELECT "Name" FROM table_31312 WHERE "Country" = 'DR Congo' |
CREATE TABLE table_19040 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | what's the won with points against being 304 | SELECT "Won" FROM table_19040 WHERE "Points against" = '304' |
CREATE TABLE table_35093 (
"Date" text,
"Result" text,
"Score" text,
"Venue" text,
"Competition" text
) | Score of 0 0, and a Date of 02-jan-64 had what result? | SELECT "Result" FROM table_35093 WHERE "Score" = '0–0' AND "Date" = '02-jan-64' |
CREATE TABLE table_5749 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Player of mike o'quinn, and a Round smaller than 15 had what lowest pick? | SELECT MIN("Pick") FROM table_5749 WHERE "Player" = 'mike o''quinn' AND "Round" < '15' |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE classroom (
building varchar(15),
room... | how many students are in each department? | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name |
CREATE TABLE table_name_87 (
first_elected VARCHAR,
constiuency VARCHAR,
name VARCHAR
) | What is Myron Walwyn with a Territorial at-large Constiuency's First Elected Date | SELECT first_elected FROM table_name_87 WHERE constiuency = "territorial at-large" AND name = "myron walwyn" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | give me the number of patients whose days of hospital stay is greater than 7 and procedure icd9 code is 5732? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.icd9_code = "5732" |
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... | unaccepted question rate, grouped by user. for each person who has asked a question on the site, display the userid and their unaccepted-question percentage (their Q's that have no accepted answer divided by their Q's; where Q's are further filtered to be 'not closed' and 'at least one answer') | SELECT Users.Id AS "user_link", Posts.Id AS "post_link" FROM Users JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Posts.ClosedDate IS NULL AND Posts.AnswerCount > 0 LIMIT 50 |
CREATE TABLE table_27716 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | How many picks are there with an affiliation is the University of California Norcal Lamorinda United? | SELECT COUNT("Pick #") FROM table_27716 WHERE "Affiliation" = 'University of California NorCal Lamorinda United' |
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
)
... | let me know the number of patients categorized under chemistry lab test with diagnoses icd9 code 431. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "431" AND lab."CATEGORY" = "Chemistry" |
CREATE TABLE table_64812 (
"Class" text,
"Railway number(s)" text,
"DRG number(s)" text,
"Quantity" real,
"Year(s) of manufacture" text,
"Axle arrangement ( UIC ) Bauart" text
) | Which quantity has Axle arrangement (UIC)bauart of c n2t, and DRG number 99 093? | SELECT "Quantity" FROM table_64812 WHERE "Axle arrangement ( UIC ) Bauart" = 'c n2t' AND "DRG number(s)" = '99 093' |
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 are younger than 74 years of age and lab tested with wbc pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "74" AND lab.label = "WBC, Pleural" |
CREATE TABLE table_name_93 (
place VARCHAR,
player VARCHAR
) | What place is S.K. Ho in? | SELECT place FROM table_name_93 WHERE player = "s.k. ho" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | what were the top five most frequent lab tests for patients with an age 20s during this year? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')... |
CREATE TABLE table_202_22 (
id number,
"rank" number,
"rider" text,
"team" text,
"points" number
) | how many points did robbie mcewen and cristian moreni score together ? | SELECT (SELECT "points" FROM table_202_22 WHERE "rider" = 'robbie mcewen') + (SELECT "points" FROM table_202_22 WHERE "rider" = 'cristian moreni') |
CREATE TABLE table_68635 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the average attendance when the record was 17-18? | SELECT AVG("Attendance") FROM table_68635 WHERE "Record" = '17-18' |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
... | how many times had patient 56009 visited intensive care unit in 2100? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56009) AND STRFTIME('%y', icustays.intime) = '2100' |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | Show all allergy type with number of students affected with a bar chart. | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType |
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... | Visualize a pie chart about the proportion of All_Games and ACC_Percent. | SELECT All_Games, ACC_Percent FROM basketball_match |
CREATE TABLE table_13550 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | who is the outgoing manager when the manner of departure is contract terminated and the date of vacancy is 1 september 2008? | SELECT "Outgoing manager" FROM table_13550 WHERE "Manner of departure" = 'contract terminated' AND "Date of vacancy" = '1 september 2008' |
CREATE TABLE table_28155 (
"Graphics" text,
"Launch" real,
"Market" text,
"CPU" text,
"Code name" text,
"Device ID" real,
"Core clock ( MHz )" text,
"Execution units" real,
"Shader model" text,
"DirectX" text,
"OpenGL" text,
"OpenCL" text,
"Memory bandwidth ( GB/s )" ... | What mobile markets have cvt hd? | SELECT "CVT HD" FROM table_28155 WHERE "Market" = 'Mobile' |
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
)
... | Give the number of patients who were admitted before the year 2197 and had admission type as elective. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2197" |
CREATE TABLE table_73053 (
"Name" text,
"Nickname" text,
"First season" text,
"Location" text,
"Home ground(s)" text,
"Coach" text,
"Captain" text
) | What is the dates where Hillcrest Reserve is the home grounds? | SELECT "First season" FROM table_73053 WHERE "Home ground(s)" = 'Hillcrest Reserve' |
CREATE TABLE table_45717 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Which Attendance has a Result of w 23-21, and a Week smaller than 5? | SELECT AVG("Attendance") FROM table_45717 WHERE "Result" = 'w 23-21' AND "Week" < '5' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | give me the number of patients whose primary disease is t5 fracture and procedure icd9 code is 3612? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.icd9_code = "3612" |
CREATE TABLE table_39768 (
"Time" text,
"12:00 PM" text,
"01:00 PM" text,
"02:00 PM" text,
"03:00 PM" text,
"04:00 PM" text,
"05:00 PM" text,
"05:55 PM" text
) | Who preforms at 2:00PM on Monday? | SELECT "02:00 PM" FROM table_39768 WHERE "Time" = 'monday' |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Co... | Please use a pie chart to show the proportion of the total amount of payment by each payment method code. | SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code |
CREATE TABLE table_75780 (
"Capital/Region" text,
"1997" real,
"1998" real,
"1999" real,
"2000" real,
"2001" real,
"2002" real,
"2003" real,
"2004" real,
"2005" real,
"2006" real,
"2007" real
) | How many 2007's have a 2000 greater than 56,6, 23,2 as 2006, and a 1998 greater than 61,1? | SELECT SUM("2007") FROM table_75780 WHERE "2000" > '56,6' AND "2006" = '23,2' AND "1998" > '61,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, visualize a bar chart about the distribution of name and manufacturer , rank from low to high by the Y. | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 TA... | is there a round trip flight from BALTIMORE to DALLAS connecting in DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1... |
CREATE TABLE table_72915 (
"State" text,
"Preliminary" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Average" text
) | Name the swuinsuit for oregon | SELECT "Swimsuit" FROM table_72915 WHERE "State" = 'Oregon' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime t... | how many hours has it been since the first time that patient 4401 on the current intensive care unit visit received a d5w intake? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 4401) AND icustays.outtime IS NULL) ... |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | what are the top five most common medications that followed within 2 months for those patients who were prescribed clindamycin? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'clindamycin') AS t1 JOIN (SELECT patient.uniquepid,... |
CREATE TABLE table_68334 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | Name the date which has type of plain stage | SELECT "Date" FROM table_68334 WHERE "Type" = 'plain stage' |
CREATE TABLE table_dev_58 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"intra_aortic_balloon_pump_iabp" bool,
"systemic_arterial_po2" int,
"creatinine_clearance_cl" float,
"supplemental_oxygen" bool,
"age" float,
"NOUSE" float
) | creatinine clearance < 60 by cockcroft _ gault calculator | SELECT * FROM table_dev_58 WHERE creatinine_clearance_cl < 60 |
CREATE TABLE table_80109 (
"Hits" real,
"Player" text,
"Team" text,
"Year" real,
"Years Record Stood" text
) | Name the player with 238 hits and years after 1885 | SELECT "Player" FROM table_80109 WHERE "Year" > '1885' AND "Hits" = '238' |
CREATE TABLE table_18026 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | What was the attendance at the game that resulted in w 24-20? | SELECT "Attendance" FROM table_18026 WHERE "Result" = 'W 24-20' |
CREATE TABLE table_name_4 (
draw INTEGER,
points VARCHAR,
lost VARCHAR
) | What is the lowest number for draw when the points are less than 17, and the lost is 13? | SELECT MIN(draw) FROM table_name_4 WHERE points < 17 AND lost = 13 |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | does patient 031-1337 have any organisms that were found in his last sputum, expectorated microbiology test? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'sputum, expectorated' ORDER BY microla... |
CREATE TABLE table_name_46 (
loss VARCHAR,
record VARCHAR
) | What was the Loss when the Record was 50-54? | SELECT loss FROM table_name_46 WHERE record = "50-54" |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Display to me what is required for a CS-LSA degree . | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | had 1000 ml flex cont: sodium chloride 0.9 % iv soln, dextrose 5% in water (d5w) iv : 1000 ml bag or potassium chloride been in 12/2105 prescribed for patient 022-44805? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805')) AND medication.drugname IN ('1000 ml flex cont: sodium chlori... |
CREATE TABLE table_204_320 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which country has the most gold medals ? | SELECT "nation" FROM table_204_320 ORDER BY "gold" DESC LIMIT 1 |
CREATE TABLE table_6318 (
"Competition" text,
"Played" real,
"Blackpool" real,
"Draw" real,
"Preston North End" real
) | Which Played is the lowest one that has a Blackpool smaller than 0? | SELECT MIN("Played") FROM table_6318 WHERE "Blackpool" < '0' |
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst text,
packst t... | Which state has the most apple collected? | SELECT distst FROM sampledata15 WHERE commod = "AP" GROUP BY distst ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_name_68 (
nationality VARCHAR,
nhl_team VARCHAR
) | What is the nationality of the Washington Capitals? | SELECT nationality FROM table_name_68 WHERE nhl_team = "washington capitals" |
CREATE TABLE table_name_45 (
assists INTEGER,
games INTEGER
) | How many Assists for the Player with more than 25 Games? | SELECT SUM(assists) FROM table_name_45 WHERE games > 25 |
CREATE TABLE table_204_913 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what is the top listed venue in the table ? | SELECT "venue" FROM table_204_913 WHERE id = 1 |
CREATE TABLE table_3524 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What song was used resulting in the bottom 3? | SELECT "Song choice" FROM table_3524 WHERE "Result" = 'Bottom 3' |
CREATE TABLE table_name_51 (
votes VARCHAR,
notes VARCHAR
) | How many votes were cast when the notes reported lost to incumbent vic gilliam? | SELECT votes FROM table_name_51 WHERE notes = "lost to incumbent vic gilliam" |
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, give me the comparison about the average of revenue over the name , and group by attribute name by a bar chart, list by the total number in asc. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue |
CREATE TABLE table_14650162_1 (
college VARCHAR,
position VARCHAR
) | What college did the defensive back attend? | SELECT college FROM table_14650162_1 WHERE position = "Defensive Back" |
CREATE TABLE table_name_92 (
date VARCHAR,
opponent VARCHAR
) | When did woking compete? | SELECT date FROM table_name_92 WHERE opponent = "woking" |
CREATE TABLE table_12500 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Country of the Player with a To par of +1 and a Score of 74-70-70=214? | SELECT "Country" FROM table_12500 WHERE "To par" = '+1' AND "Score" = '74-70-70=214' |
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
) | What are the names of all products, and count them by a bar chart, and I want to list y axis in desc order. | SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) DESC |
CREATE TABLE table_65325 (
"Year" real,
"Artist" text,
"Song" text,
"UK Chart" text,
"At Eurovision" text
) | Where did Scott Fitzgerald rank on the UK charts? | SELECT "UK Chart" FROM table_65325 WHERE "Artist" = 'scott fitzgerald' |
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,
... | calculate the total number of patients belonging to white-russian ethnic origin amongst those who had radical cystectomy | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Radical cystectomy" |
CREATE TABLE table_name_38 (
draws VARCHAR,
losses VARCHAR,
wins VARCHAR
) | How many draws occured with a record of 10 losses, and 6 wins? | SELECT COUNT(draws) FROM table_name_38 WHERE losses = 10 AND wins > 6 |
CREATE TABLE table_60275 (
"Model" text,
"Year" text,
"Type" text,
"Engine" text,
"Displacement cc" text
) | What type of car has the model 6cm? | SELECT "Type" FROM table_60275 WHERE "Model" = '6cm' |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday by a bar chart, sort by the y axis from low to high please. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE playe... | what are the draft pick numbers and draft classes for players who play the Defender position?, rank by the X in ascending. | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class |
CREATE TABLE table_10798928_1 (
director VARCHAR,
original_title VARCHAR
) | Who directed Dulcinea? | SELECT director FROM table_10798928_1 WHERE original_title = "Dulcinea" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | when in their last hospital visit was the first time patient 85131 received non-invasive mech vent? | 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 = 'non-invasive mech vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85131 AND NO... |
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
) | What is the total number of captains with different classes?, sort by the bars in desc. | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY Class DESC |
CREATE TABLE table_name_90 (
rank__number VARCHAR,
attendance VARCHAR
) | What rank were the Buckeyes when there were 68,586 in attendance? | SELECT rank__number FROM table_name_90 WHERE attendance = "68,586" |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | For those dates that have the 5 highest cloud cover rates, please bin the date into day of the week interval and compute their average cloud cover, and display y-axis in ascending order. | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) |
CREATE TABLE table_38365 (
"State" text,
"Revenue (millions)" text,
"Population" real,
"Revenue per capita" text,
"Spending (millions)" text,
"Spending per capita" text,
"Net contribution per capita" text
) | What is the Revenue of the population of more than 1,499,402, with Spending (millions) of $13,986? | SELECT "Revenue (millions)" FROM table_38365 WHERE "Population" > '1,499,402' AND "Spending (millions)" = '$13,986' |
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
)
... | what is minimum age of patients whose admission type is emergency and year of birth is greater than 2078? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "2078" |
CREATE TABLE table_name_74 (
year VARCHAR,
record VARCHAR
) | How many years have a Record of 73-65? | SELECT COUNT(year) FROM table_name_74 WHERE record = "73-65" |
CREATE TABLE table_name_14 (
visitor VARCHAR,
date VARCHAR
) | Which visitor visited on February 21? | SELECT visitor FROM table_name_14 WHERE date = "february 21" |
CREATE TABLE table_55036 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which surface has an Opponent of fernando verdasco? | SELECT "Surface" FROM table_55036 WHERE "Opponent" = 'fernando verdasco' |
CREATE TABLE table_30303 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Who won the mens doubles when wang hao won the mens singles? | SELECT "Mens Doubles" FROM table_30303 WHERE "Mens Singles" = 'Wang Hao' |
CREATE TABLE table_41692 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | Which 2nd leg has pamesa valencia for team #2? | SELECT "2nd leg" FROM table_41692 WHERE "Team #2" = 'pamesa valencia' |
CREATE TABLE table_13501 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | what is the average gold when rank is total and silver is more than 20? | SELECT AVG("Gold") FROM table_13501 WHERE "Rank" = 'total' AND "Silver" > '20' |
CREATE TABLE table_56113 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team scored 12.11 (83)? | SELECT "Home team" FROM table_56113 WHERE "Home team score" = '12.11 (83)' |
CREATE TABLE table_204_214 (
id number,
"pos" text,
"no." number,
"rider" text,
"manufacturer" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which rider came in first with 25 points ? | SELECT "rider" FROM table_204_214 WHERE "points" = 25 |
CREATE TABLE table_name_32 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
) | What is the attendance for the game against the Kansas City Chiefs earlier than week 13? | SELECT AVG(attendance) FROM table_name_32 WHERE opponent = "kansas city chiefs" AND week < 13 |
CREATE TABLE table_name_95 (
place VARCHAR,
to_par VARCHAR,
player VARCHAR
) | With a To par of 5, what is Nick Faldo's Place? | SELECT place FROM table_name_95 WHERE to_par = "–5" AND player = "nick faldo" |
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built tex... | Show the number of the countries that have managers of age above 50 or below 46, and could you show by the bars from low to high? | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country |
CREATE TABLE table_43140 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | What was the score of the game with the Broadview Hawks as the home team? | SELECT "Score" FROM table_43140 WHERE "Home" = 'broadview hawks' |
CREATE TABLE table_204_928 (
id number,
"year" number,
"album" text,
"territory" text,
"label" text,
"notes" text
) | how many total albums did this group have under capitol records ? | SELECT COUNT("album") FROM table_204_928 WHERE "label" = 'capitol records' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | what was the top four most frequent procedures performed since 5 years ago that patients were given within 2 months after the diagnosis of malig neo bladder nos? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | how many patients are diagnosed with primary disease rash and suggested with drug route via iv? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "RASH" AND prescriptions.route = "IV" |
CREATE TABLE table_71400 (
"Date" text,
"Tournament" text,
"Surface" text,
"Tier" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | Which date has opponents, Akgul Amanmuradova Nina Bratchikova, in the final? | SELECT "Date" FROM table_71400 WHERE "Opponents in the final" = 'akgul amanmuradova nina bratchikova' |
CREATE TABLE table_34593 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the largest played number when the difference is - 8 and position is more than 8? | SELECT MAX("Played") FROM table_34593 WHERE "Difference" = '- 8' AND "Position" > '8' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.