answer
stringlengths 6
3.91k
| question
stringlengths 7
766
| context
stringlengths 27
7.14k
|
|---|---|---|
SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'
|
Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described
|
CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, organisation_id VARCHAR, grant_amount VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR); CREATE TABLE documents (sent_date VARCHAR, grant_id VARCHAR)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Drug induced neutropenia"
|
what is the number of patients whose admission type is elective and diagnoses long title is drug induced neutropenia?
|
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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT MAX(top_5) FROM table_1671401_2 WHERE avg_finish = "5.0"
|
Name the max top 5 for 5.0 avg finish
|
CREATE TABLE table_1671401_2 (top_5 INTEGER, avg_finish VARCHAR)
|
SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100
|
What are the response received dates for the documents described as 'Regular' or granted with more than 100?
|
CREATE TABLE Documents (response_received_date VARCHAR, document_type_code VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, grant_amount VARCHAR)
|
SELECT "Place" FROM table_47467 WHERE "Country" = 'united states' AND "Money ( $ )" > '145,000' AND "To par" = '–2' AND "Score" = '70-66-73-69=278'
|
Which Place has a Country of united states, and Money ($) larger than 145,000, and a To par of 2, and a Score of 70-66-73-69=278?
|
CREATE TABLE table_47467 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
|
SELECT poles FROM table_1671401_2 WHERE avg_finish = "26.8"
|
Name the poles for avg finish is 26.8
|
CREATE TABLE table_1671401_2 (poles VARCHAR, avg_finish VARCHAR)
|
SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')
|
List the project details of the projects which did not hire any staff for a researcher role.
|
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR); CREATE TABLE Project_Staff (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR)
|
SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY Location DESC
|
Show different locations and the number of performances at each location Visualize by bar chart, and sort x axis in desc order.
|
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
)
|
SELECT COUNT(team_s_) FROM table_1671401_2 WHERE top_10 = 5
|
Name the total number of teams for top 10 being 5
|
CREATE TABLE table_1671401_2 (team_s_ VARCHAR, top_10 VARCHAR)
|
SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2
|
What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?
|
CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR)
|
SELECT "Team 2" FROM table_80411 WHERE "Team 1" = 'al-ismaily'
|
What team played against Al-Ismaily (team 1)?
|
CREATE TABLE table_80411 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
|
SELECT COUNT(mens_u20) FROM table_16724844_1 WHERE womens_40 = "Sydney Scorpions def North Queensland Cyclones"
|
How many times was the mens u20 recorded when the Womens 40 were Sydney Scorpions def North Queensland Cyclones?
|
CREATE TABLE table_16724844_1 (mens_u20 VARCHAR, womens_40 VARCHAR)
|
SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'
|
When do all the researcher role staff start to work, and when do they stop working?
|
CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, role_code VARCHAR)
|
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.short_title = "Alzheimer's disease" AND lab.flag = "delta"
|
Among patients with alzheimer's disease, how many of them had a lab test for abnormal status of delta?
|
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 (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
|
SELECT mens_40 FROM table_16724844_1 WHERE mens_u20 = "Southern Suns def Gold Coast Sharks"
|
What were the results for mens 40 when the mens u20 was Southern Suns def Gold Coast Sharks?
|
CREATE TABLE table_16724844_1 (mens_40 VARCHAR, mens_u20 VARCHAR)
|
SELECT COUNT(DISTINCT role_code) FROM Project_Staff
|
How many kinds of roles are there for the staff?
|
CREATE TABLE Project_Staff (role_code VARCHAR)
|
SELECT chassis FROM table_name_41 WHERE entrant = "larrousse f1" AND driver = "aguri suzuki"
|
Which chassis did Aguri Suzuki drive with an entrant of Larrousse F1?
|
CREATE TABLE table_name_41 (
chassis VARCHAR,
entrant VARCHAR,
driver VARCHAR
)
|
SELECT mens_open FROM table_16724844_1 WHERE womens_40 = "Sydney Scorpions defeated Hunter Hornets"
|
What were the results of the mens open when the womens 40 was Sydney Scorpions defeated Hunter Hornets?
|
CREATE TABLE table_16724844_1 (mens_open VARCHAR, womens_40 VARCHAR)
|
SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id
|
What is the total amount of grants given by each organisations? Also list the organisation id.
|
CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER)
|
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC
|
Visualize a bar chart for how many students are in each department?, and could you sort y axis in descending order?
|
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
|
SELECT womens_u20 FROM table_16724844_1 WHERE mens_45 = "SunWest Razorbacks def Northern Eagles"
|
What were the results of the womens u20 when the mens 45 was Sunwest Razorbacks def Northern Eagles?
|
CREATE TABLE table_16724844_1 (womens_u20 VARCHAR, mens_45 VARCHAR)
|
SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'
|
List the project details of the projects with the research outcome described with the substring 'Published'.
|
CREATE TABLE Research_outcomes (outcome_code VARCHAR, outcome_description VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)
|
SELECT venue FROM table_name_39 WHERE extra = "pentathlon"
|
What is Venue, when Extra is Pentathlon?
|
CREATE TABLE table_name_39 (
venue VARCHAR,
extra VARCHAR
)
|
SELECT mens_45 FROM table_16724844_1 WHERE mens_40 = "SunWest Razorbacks def Sydney Mets"
|
What was the mens 45 when mens 40 was Sunwest Razorbacks def Sydney Mets?
|
CREATE TABLE table_16724844_1 (mens_45 VARCHAR, mens_40 VARCHAR)
|
SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*)
|
How many staff does each project has? List the project id and the number in an ascending order.
|
CREATE TABLE Project_Staff (project_id VARCHAR); CREATE TABLE Projects (project_id VARCHAR)
|
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20801) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '04' ORDER BY labevents.charttime DESC LIMIT 1)
|
what was the name of the lab test that patient 20801 last got in 04/last year.
|
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 labevents (
row_id number,
subject_id number,
hadm_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,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
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 time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
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 number
)
|
SELECT mens_open FROM table_16724844_1 WHERE mens_u20 = "Qld Country Rustlers def Southern Suns"
|
What was the mens open when the mens u20 was Qld Country Rustlers def Southern Suns?
|
CREATE TABLE table_16724844_1 (mens_open VARCHAR, mens_u20 VARCHAR)
|
SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'
|
What is the complete description of the researcher role.
|
CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR)
|
SELECT COUNT(frequency_mhz) FROM table_name_95 WHERE call_sign = "w264bg"
|
How much Frequency MHz has a Call sign of w264bg?
|
CREATE TABLE table_name_95 (
frequency_mhz VARCHAR,
call_sign VARCHAR
)
|
SELECT date FROM table_16729063_2 WHERE opponent = "Los Angeles Raiders"
|
What date was the opponent the Los Angeles Raiders?
|
CREATE TABLE table_16729063_2 (date VARCHAR, opponent VARCHAR)
|
SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1
|
When did the first staff for the projects started working?
|
CREATE TABLE Project_Staff (date_from VARCHAR)
|
SELECT SUM(county) FROM table_name_16 WHERE party = "people before profit" AND borough > 0
|
How many counties have people before profit as the party, and a borough greater than 0?
|
CREATE TABLE table_name_16 (
county INTEGER,
party VARCHAR,
borough VARCHAR
)
|
SELECT COUNT(date) FROM table_16729063_2 WHERE game_site = "Cleveland Stadium"
|
How many games were played at Cleveland Stadium?
|
CREATE TABLE table_16729063_2 (date VARCHAR, game_site VARCHAR)
|
SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1
|
Which project made the most number of outcomes? List the project details and the project id.
|
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)
|
SELECT ground FROM table_14312471_4 WHERE crowd = 19929
|
What are the ground where the crowd totals 19929?
|
CREATE TABLE table_14312471_4 (
ground VARCHAR,
crowd VARCHAR
)
|
SELECT COUNT(week) FROM table_16729063_2 WHERE attendance = 74716
|
In what week number was the attendance 74716?
|
CREATE TABLE table_16729063_2 (week VARCHAR, attendance VARCHAR)
|
SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes)
|
Which projects have no outcome? List the project details.
|
CREATE TABLE Project_outcomes (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)
|
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
|
Create a pie chart showing how many headquarters across headquarters.
|
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
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
|
SELECT region FROM table_1672804_2 WHERE name_of_city = "Iquitos"
|
What is the region where Iquitos is located?
|
CREATE TABLE table_1672804_2 (region VARCHAR, name_of_city VARCHAR)
|
SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
|
Which organisation hired the most number of research staff? List the organisation id, type and detail.
|
CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE Research_Staff (employer_organisation_id VARCHAR)
|
SELECT "Rounds" FROM table_33761 WHERE "Team" = 'walther'
|
Which rounds did the team Walther participate in?
|
CREATE TABLE table_33761 (
"Team" text,
"Chassis" text,
"Engine" text,
"Driver(s)" text,
"Sponsor(s)" text,
"Rounds" text
)
|
SELECT region FROM table_1672804_2 WHERE province = "Constitutional province of Callao"
|
What is the region containing the Constitutional Province of Callao?
|
CREATE TABLE table_1672804_2 (region VARCHAR, province VARCHAR)
|
SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1
|
Show the role description and the id of the project staff involved in most number of project outcomes?
|
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Project_Staff (staff_id VARCHAR, role_code VARCHAR, project_id VARCHAR); CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR)
|
SELECT away_team AS score FROM table_name_84 WHERE venue = "victoria park"
|
How much did the away team score at Victoria park?
|
CREATE TABLE table_name_84 (
away_team VARCHAR,
venue VARCHAR
)
|
SELECT result FROM table_16729071_1 WHERE opponent = "New Orleans Saints"
|
How did the game end against the New Orleans Saints?
|
CREATE TABLE table_16729071_1 (result VARCHAR, opponent VARCHAR)
|
SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'
|
Which document type is described with the prefix 'Initial'?
|
CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR)
|
SELECT "season" FROM table_203_741 WHERE "home" = '1-1'
|
which is the only year they went 1-1 at home ?
|
CREATE TABLE table_203_741 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"aggregate" text
)
|
SELECT COUNT(week) FROM table_16729071_1 WHERE attendance = 60038
|
How many weeks had an attendance of 60038?
|
CREATE TABLE table_16729071_1 (week VARCHAR, attendance VARCHAR)
|
SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'
|
For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.
|
CREATE TABLE Grants (grant_start_date VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, document_type_code VARCHAR)
|
SELECT 1 * (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 = 28443) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5w' AND d_items.linksto = 'inputevents_cv') ORDER BY inputevents_cv.charttime DESC LIMIT 1
|
what is the number of days that have passed since the last time patient 28443 received a d5w intake on the current intensive care unit visit?
|
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 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
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
|
SELECT MIN(points) FROM table_16729457_17 WHERE driver___passenger = "Daniël Willemsen / Kenny van Gaalen"
|
Name the least points for daniël willemsen / kenny van gaalen
|
CREATE TABLE table_16729457_17 (points INTEGER, driver___passenger VARCHAR)
|
SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1
|
How many documents can one grant have at most? List the grant id and number.
|
CREATE TABLE Documents (grant_id VARCHAR)
|
SELECT score FROM table_name_72 WHERE year = "2004"
|
What was the score in the year 2004?
|
CREATE TABLE table_name_72 (
score VARCHAR,
year VARCHAR
)
|
SELECT driver___passenger FROM table_16729457_17 WHERE position = 4
|
Name the driver passenger for position 4
|
CREATE TABLE table_16729457_17 (driver___passenger VARCHAR, position VARCHAR)
|
SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'
|
Find the organisation type description of the organisation detailed as 'quo'.
|
CREATE TABLE Organisations (organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE organisation_Types (organisation_type_description VARCHAR, organisation_type VARCHAR)
|
SELECT "Country" FROM table_65795 WHERE "Top Team" = 'jam' AND "Edition" = '31st'
|
Which Country has a Top Team of jam, and an Edition of 31st?
|
CREATE TABLE table_65795 (
"Edition" text,
"Year" text,
"City" text,
"Country" text,
"Date" text,
"No. of Events" real,
"Top Team" text
)
|
SELECT driver___passenger FROM table_16729457_16 WHERE position = 8
|
Name the driver/passenger for position 8
|
CREATE TABLE table_16729457_16 (driver___passenger VARCHAR, position VARCHAR)
|
SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details
|
What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.
|
CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR)
|
SELECT "Score" FROM table_47393 WHERE "Home team" = 'kidderminster harriers'
|
What is the score for the match that had a home team of Kidderminster Harriers?
|
CREATE TABLE table_47393 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
|
SELECT driver___passenger FROM table_16729457_16 WHERE position = 6
|
Name the driver/passenger for 6 position
|
CREATE TABLE table_16729457_16 (driver___passenger VARCHAR, position VARCHAR)
|
SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'
|
How many Patent outcomes are generated from all the projects?
|
CREATE TABLE Project_outcomes (outcome_code VARCHAR)
|
SELECT "IMED/Avicenna Listed" FROM table_63242 WHERE "Regional/Offshore" = 'offshore' AND "Country/Territory" = 'saint kitts and nevis' AND "Degree" = 'md' AND "Established" < '2000'
|
What is the imed/avicenna listed for a medical school offshore in saint kitts and nevis which was established before 2000 and will give you an MD?
|
CREATE TABLE table_63242 (
"Country/Territory" text,
"Established" real,
"Degree" text,
"Regional/Offshore" text,
"IMED/Avicenna Listed" text
)
|
SELECT winner FROM table_1672976_5 WHERE attendance = 16597
|
Who was the winner when the total attendance was 16597?
|
CREATE TABLE table_1672976_5 (winner VARCHAR, attendance VARCHAR)
|
SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'
|
How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?
|
CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR)
|
SELECT AVG("Attendance") FROM table_8371 WHERE "Away" = 'vida'
|
What is the Attendance when Vida is the Away team?
|
CREATE TABLE table_8371 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
|
SELECT socket FROM table_16729930_18 WHERE frequency = "1.3 GHz"
|
What is the socket for microprocessors with a frequency of 1.3 ghz?
|
CREATE TABLE table_16729930_18 (socket VARCHAR, frequency VARCHAR)
|
SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1
|
What is the last date of the staff leaving the projects?
|
CREATE TABLE Project_Staff (date_to VARCHAR)
|
SELECT "nation" FROM table_203_653 WHERE "nation" <> 'japan' AND "gold" = (SELECT "gold" FROM table_203_653 WHERE "nation" = 'japan')
|
which nation had the same total number of gold medals as japan ?
|
CREATE TABLE table_203_653 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
|
SELECT tdp FROM table_16729930_18 WHERE release_price___usd__ = "$72"
|
For a release price of $72, what is the TDP of the microprocessor?
|
CREATE TABLE table_16729930_18 (tdp VARCHAR, release_price___usd__ VARCHAR)
|
SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'
|
What are the result description of the project whose detail is 'sint'?
|
CREATE TABLE Project_outcomes (outcome_code VARCHAR, project_id VARCHAR); CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2197"
|
what is the number of home health care discharge patients who were admitted before 2197?
|
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
|
SELECT gpu_frequency FROM table_16729930_18 WHERE tdp = "3.6 W" AND part_number_s_ = "CY80632007221AB"
|
For a processor with part number cy80632007221ab and TDP of 3.6 W, What are the available GPU frequencies?
|
CREATE TABLE table_16729930_18 (gpu_frequency VARCHAR, tdp VARCHAR, part_number_s_ VARCHAR)
|
SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
|
List the organisation id with the maximum outcome count, and the count.
|
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (organisation_id VARCHAR, project_id VARCHAR)
|
SELECT ABS((SELECT "population" FROM table_204_616 WHERE "township" = 'easton') - (SELECT "population" FROM table_204_616 WHERE "township" = 'reno'))
|
what is the difference of population in easton and reno ?
|
CREATE TABLE table_204_616 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
|
SELECT sspec_number FROM table_16729930_18 WHERE tdp = "3.6 W" AND model_number = "Atom E665C"
|
For a processor with model number atom e665c and a TDP of 3.6 W, what is the sSpec number?
|
CREATE TABLE table_16729930_18 (sspec_number VARCHAR, tdp VARCHAR, model_number VARCHAR)
|
SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1)
|
List the project details of the projects launched by the organisation
|
CREATE TABLE Projects (project_details VARCHAR, organisation_id VARCHAR)
|
SELECT "2010" FROM table_15199 WHERE "2007" = 'a' AND "2012" = 'a'
|
Name the 2010 for 2007 of a and 2012 of a
|
CREATE TABLE table_15199 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
|
SELECT release_price___usd__ FROM table_16729930_18 WHERE part_number_s_ = "CY80632007227AB"
|
What is the release price for a processor with part number cy80632007227ab?
|
CREATE TABLE table_16729930_18 (release_price___usd__ VARCHAR, part_number_s_ VARCHAR)
|
SELECT staff_details FROM Research_Staff ORDER BY staff_details
|
List the research staff details, and order in ascending order.
|
CREATE TABLE Research_Staff (staff_details VARCHAR)
|
SELECT "Location/Attendance" FROM table_79061 WHERE "Opponent" = 'seattle supersonics'
|
What was the location when the opponent was Seattle Supersonics?
|
CREATE TABLE table_79061 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
)
|
SELECT fsb FROM table_16729930_11 WHERE model_number = "Atom Z540"
|
Name the fsb for atom z540
|
CREATE TABLE table_16729930_11 (fsb VARCHAR, model_number VARCHAR)
|
SELECT COUNT(*) FROM Tasks
|
How many tasks are there in total?
|
CREATE TABLE Tasks (Id VARCHAR)
|
SELECT SUM(to_par) FROM table_name_53 WHERE total < 148
|
What is the to par for the player with fewer than 148 total points?
|
CREATE TABLE table_name_53 (
to_par INTEGER,
total INTEGER
)
|
SELECT frequency FROM table_16729930_11 WHERE part_number_s_ = "AC80566UE041DW"
|
Name the frequency for part number of ac80566ue041dw
|
CREATE TABLE table_16729930_11 (frequency VARCHAR, part_number_s_ VARCHAR)
|
SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id
|
How many tasks does each project have? List the task count and the project detail.
|
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Tasks (project_id VARCHAR)
|
SELECT "Phone" FROM table_56724 WHERE "Address" = '53 dayton road'
|
What is the phone number of the station located at 53 Dayton Road?
|
CREATE TABLE table_56724 (
"Station" text,
"Engine Company" text,
"Ambulance" text,
"Address" text,
"Phone" text
)
|
SELECT memory FROM table_16729930_17 WHERE part_number_s_ = "CT80618003201AA"
|
Name the memory for part number of ct80618003201aa
|
CREATE TABLE table_16729930_17 (memory VARCHAR, part_number_s_ VARCHAR)
|
SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'
|
What are the staff roles of the staff who
|
CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR, date_to VARCHAR)
|
SELECT method FROM table_name_92 WHERE record = "4-0"
|
What was the method of resolution when Mikhail Ilyukhin's record was 4-0?
|
CREATE TABLE table_name_92 (
method VARCHAR,
record VARCHAR
)
|
SELECT memory FROM table_16729930_17 WHERE model_number = "Atom E640T"
|
Name the memory for meodel number for atom e640t
|
CREATE TABLE table_16729930_17 (memory VARCHAR, model_number VARCHAR)
|
SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code
|
What are the descriptions of all the project outcomes?
|
CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Project_outcomes (outcome_code VARCHAR)
|
SELECT opponent_number FROM table_name_73 WHERE attendance = "45,000"
|
Who was the opponent at the game attended by 45,000?
|
CREATE TABLE table_name_73 (
opponent_number VARCHAR,
attendance VARCHAR
)
|
SELECT memory FROM table_16729930_17 WHERE frequency = "1.6 GHz"
|
Name the memory for frequency of 1.6 ghz
|
CREATE TABLE table_16729930_17 (memory VARCHAR, frequency VARCHAR)
|
SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
|
Which role is most common for the staff?
|
CREATE TABLE Project_Staff (role_code VARCHAR)
|
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
|
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the founder , and group by attribute founder, and show Founder in desc order.
|
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
)
|
SELECT winner FROM table_1672976_6 WHERE challenge_leader = "ACC (2-1)"
|
Who won the game where the Challenge Leader is ACC (2-1)?
|
CREATE TABLE table_1672976_6 (winner VARCHAR, challenge_leader VARCHAR)
|
SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'
|
How many friends does Dan have?
|
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR)
|
SELECT DISTINCT paper.paperid FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase, venue WHERE dataset.datasetname = 'Jeopardy! Questions' AND keyphrase.keyphrasename = 'Parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid AND paper.paperid = paperdataset.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
|
Parsing papers using Jeopardy! Questions published at ACL 2014
|
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
|
SELECT television FROM table_1672976_6 WHERE time = "9:00PM"
|
What station aired a game at 9:00pm?
|
CREATE TABLE table_1672976_6 (television VARCHAR, time VARCHAR)
|
SELECT COUNT(*) FROM Person WHERE gender = 'female'
|
How many females does this network has?
|
CREATE TABLE Person (gender VARCHAR)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.