table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_54 (
title VARCHAR,
year VARCHAR
) | What title was released in 1971? | SELECT title FROM table_name_54 WHERE year = 1971 |
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 was the last gabapentin 100 mg po caps prescription time for patient 016-38131 in this month. | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131')) AND medication.drugname = 'gabapentin 100 mg po c... |
CREATE TABLE table_13564637_5 (
club VARCHAR,
points VARCHAR
) | Who is the club that has 30 points? | SELECT club FROM table_13564637_5 WHERE points = "30" |
CREATE TABLE table_47008 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"FCC info" text
) | Average frequency with ERP W of 62? | SELECT AVG("Frequency MHz") FROM table_47008 WHERE "ERP W" = '62' |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number... | Total users added, by month, with reputation at least 50. | SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS "month", COUNT(*) AS "# Users Added", COUNT(IIF(u.Reputation >= 50, 1, NULL)) AS "# Users Added (current rep >= 50)" FROM Users AS u GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) ORDER BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give the description of diagnoses icd9 code e8120. | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "E8120" |
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... | how many times patient 006-50368 the last year visited the hospital. | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '006-50368' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what were the specimen tests that patient 52456 first had in the last month? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52456) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiology... |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
r... | when did patient 26156 come for the last time to the hospital? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 26156 ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_203_189 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how many competitions did jifar participate in before joining the 10000m ? | SELECT COUNT("competition") FROM table_203_189 WHERE "notes" <> 10000 |
CREATE TABLE table_50091 (
"Name" text,
"Branch" text,
"Term began" text,
"Term ended" text,
"Time in office" text
) | When did the term end for the U.S. Marine Corps? | SELECT "Term ended" FROM table_50091 WHERE "Branch" = 'u.s. marine corps' |
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
) | What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor. Visualize by pie chart. | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor |
CREATE TABLE table_name_2 (
score VARCHAR,
couple VARCHAR,
style VARCHAR
) | Which Score has a Couple comprised of jason & edyta, and a Style of freestyle? | SELECT score FROM table_name_2 WHERE couple = "jason & edyta" AND style = "freestyle" |
CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE documents_to_be_destroyed (
document_id number,
destruction_authorised_by_employee_id number,
destroyed_by_employee_id number,
planned_destruction_date time,
actual_destruction_date time,
other... | Show the ids of all employees who have either destroyed a document or made an authorization to do this. | SELECT destroyed_by_employee_id FROM documents_to_be_destroyed UNION SELECT destruction_authorised_by_employee_id FROM documents_to_be_destroyed |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what are the five most commonly given laboratory tests for patients who previously had a partial pancreatect nec within the same month? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... |
CREATE TABLE table_2850912_1 (
pick__number VARCHAR,
college_junior_club_team VARCHAR
) | What daft pick number is the player coming from Regina Pats (WHL)? | SELECT pick__number FROM table_2850912_1 WHERE college_junior_club_team = "Regina Pats (WHL)" |
CREATE TABLE table_name_2 (
rank VARCHAR,
tenure VARCHAR
) | What is the Rank of the Character with Tenure of 2011? | SELECT rank FROM table_name_2 WHERE tenure = "2011" |
CREATE TABLE table_31453 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | in how many dates the game was 2 | SELECT COUNT("Date") FROM table_31453 WHERE "Game" = '2' |
CREATE TABLE table_76085 (
"Name" text,
"Year commissioned" real,
"Gross head (metres)" real,
"Installed capacity (megawatts)" real,
"Average annual output (million KWh)" real
) | What is the Year commissioned of the power station with a Gross head of 60 metres and Average annual output of less than 59 million KWh? | SELECT MAX("Year commissioned") FROM table_76085 WHERE "Gross head (metres)" = '60' AND "Average annual output (million KWh)" < '59' |
CREATE TABLE table_name_7 (
opponent VARCHAR,
season VARCHAR
) | Which opponent has a Season of 2010/11? | SELECT opponent FROM table_name_7 WHERE season = "2010/11" |
CREATE TABLE table_61970 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What's the average number of wins for those with less than 2 byes? | SELECT AVG("Wins") FROM table_61970 WHERE "Byes" < '2' |
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
)
... | Calculate the minimum age of patients who had coronary artery disease or a coronary artery bypass graft had myomectomy/sda as their primary disease and died before the year 2138 | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.dod_year < "2138.0" |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
) | What are the names and ages of editors? Show me a bar chart. | SELECT Name, Age FROM editor |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | Show me the proportion on what are the names and number of hours spent training for each player who trains for less than 1500 hours? | SELECT pName, HS FROM Player WHERE HS < 1500 |
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, show me about the distribution of founder and the amount of founder , and group by attribute founder in a bar chart, and list total number in desc order please. | SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY COUNT(Founder) DESC |
CREATE TABLE table_11261 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | with a record of 73-82 what was the date? | SELECT "Date" FROM table_11261 WHERE "Record" = '73-82' |
CREATE TABLE table_203_166 (
id number,
"pos" text,
"no" number,
"rider" text,
"manufacturer" text,
"laps" number,
"time" text,
"grid" number,
"points" number
) | who is at the top out of the riders ? | SELECT "rider" FROM table_203_166 ORDER BY "pos" LIMIT 1 |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, find name and the average of revenue , and group by attribute name, and visualize them by a bar chart. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction... | what are the different card types, and how many transactions have been made with each? | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code |
CREATE TABLE table_name_55 (
to_par VARCHAR,
player VARCHAR
) | What is To Par, when Player is 'Tommy Bolt'? | SELECT to_par FROM table_name_55 WHERE player = "tommy bolt" |
CREATE TABLE table_20326 (
"Year" real,
"Matches" real,
"Wins" real,
"Losses" real,
"No Result" real,
"Tied" real,
"Success Rate" text,
"Position" text,
"Summary" text
) | Name the maximum wins for 68.75% | SELECT MAX("Wins") FROM table_20326 WHERE "Success Rate" = '68.75%' |
CREATE TABLE table_16388398_2 (
home_team VARCHAR,
ground VARCHAR
) | What is the home team that played on M.C.G. grounds? | SELECT home_team FROM table_16388398_2 WHERE ground = "M.C.G." |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and show Y in desc order. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC |
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 student_record (
student_id int,
course_id int,
semester int,
... | What are the upper-level elective options for the Spring and Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '... |
CREATE TABLE table_18607 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many sitting Representatives are there in the New York 10 polling area? | SELECT COUNT("Incumbent") FROM table_18607 WHERE "District" = 'New York 10' |
CREATE TABLE table_name_75 (
date VARCHAR,
result VARCHAR
) | What is the Date of the Competition with a Result of 3 0? | SELECT date FROM table_name_75 WHERE result = "3–0" |
CREATE TABLE table_11960407_5 (
high_points VARCHAR,
game VARCHAR
) | Who scored the most points in Game 49? | SELECT high_points FROM table_11960407_5 WHERE game = 49 |
CREATE TABLE table_14649 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which entrant has a Mclaren m7c Chassis? | SELECT "Entrant" FROM table_14649 WHERE "Chassis" = 'mclaren m7c' |
CREATE TABLE table_name_30 (
date VARCHAR,
opponent VARCHAR
) | On what date was the opponent the Miami Dolphins? | SELECT date FROM table_name_30 WHERE opponent = "miami dolphins" |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | Number of questions with ViewCount > nviews. | WITH TaggedPosts AS (SELECT ViewCount FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%##tagSubstring?python##%'), MostViewedQuestions AS (SELECT Count = COUNT(*) FROM TaggedPosts WHERE ViewCount > '##nviews:int?10000##') SELECT Count, CAST(Count AS FLOAT(20, 5)) * 100.0 / (SELECT COUNT(*) FROM TaggedPosts) AS Percentil... |
CREATE TABLE table_13960 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
) | What is the tally with a total larger than 8, Waterford was the opposition? | SELECT "Tally" FROM table_13960 WHERE "Total" > '8' AND "Opposition" = 'waterford' |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | Which courses involve parts of Integ Microsys Lab and Health Care Markets and Public Policies , can you show me ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Health Care Markets and Public Policies%' OR course.description LIKE '%Health Care Markets and Public Policies%' OR course.name LIKE '%Health Care Markets and Public Pol... |
CREATE TABLE table_79053 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is the weight of the player from club panionios g.c. and was born on 1975-05-21? | SELECT "Weight" FROM table_79053 WHERE "Club" = 'panionios g.c.' AND "Date of Birth" = '1975-05-21' |
CREATE TABLE table_27735 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | What player was drafted by the philadelphia union? | SELECT "Player" FROM table_27735 WHERE "MLS Team" = 'Philadelphia Union' |
CREATE TABLE table_21685 (
"School" text,
"Years of Participation" text,
"OCC Championships" real,
"Last OCC Championship" text,
"Last Outright OCC Championship" text
) | What are the years of participation for pickerington north? | SELECT "Years of Participation" FROM table_21685 WHERE "School" = 'Pickerington North' |
CREATE TABLE table_15315 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | What is the average lap of the race with a 23 finish? | SELECT AVG("Laps") FROM table_15315 WHERE "Finish" = '23' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | when did patient 015-910 come into the hospital for the last time during this year? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '015-910' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE table_name_70 (
name VARCHAR,
app_gs_sub_ VARCHAR
) | Tell what has the App(GS/Sub) of 14 (8/6) | SELECT name FROM table_name_70 WHERE app_gs_sub_ = "14 (8/6)" |
CREATE TABLE table_name_75 (
verb VARCHAR
) | For the verb dhoa, what is the 2VF? | SELECT 2 AS __vf_ FROM table_name_75 WHERE verb = "dhoa" |
CREATE TABLE table_name_87 (
episode_4 VARCHAR,
star VARCHAR
) | Which episode 4 has a Star of anna powierza? | SELECT episode_4 FROM table_name_87 WHERE star = "anna powierza" |
CREATE TABLE table_14917 (
"Season" text,
"Series" text,
"Races" text,
"Wins" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | Which Season has 95 Points? | SELECT "Season" FROM table_14917 WHERE "Points" = '95' |
CREATE TABLE table_200_22 (
id number,
"year" number,
"single" text,
"peak chart positions\nger" number,
"peak chart positions\nire" number,
"peak chart positions\nuk" number,
"peak chart positions\nus" number,
"peak chart positions\nus\nmain" number,
"peak chart positions\nus\ndance... | what chart position did the single with david bowie reach in the us ? | SELECT "peak chart positions\nus" FROM table_200_22 WHERE "single" = 'with david bowie' |
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 2132 and drug name is sertraline? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2132.0" AND prescriptions.drug = "Sertraline" |
CREATE TABLE table_name_90 (
team VARCHAR,
game VARCHAR
) | What is Team, when Game is 77? | SELECT team FROM table_name_90 WHERE game = 77 |
CREATE TABLE table_70836 (
"Name" text,
"Frequency" text,
"Language" text,
"City" text,
"Website" text
) | Which city has spanish news on the website ultimahora.com ? | SELECT "City" FROM table_70836 WHERE "Language" = 'spanish' AND "Website" = 'ultimahora.com' |
CREATE TABLE table_47475 (
"Track" real,
"Title" text,
"Songwriter(s)" text,
"Producer(s)" text,
"Length" text
) | Who is sezen aksu's producer? | SELECT "Producer(s)" FROM table_47475 WHERE "Songwriter(s)" = 'sezen aksu' |
CREATE TABLE table_name_54 (
purpose VARCHAR,
name VARCHAR
) | What was the purpose of the Quay test blast? | SELECT purpose FROM table_name_54 WHERE name = "quay" |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | What hour of the day I post the most answers. | SELECT TIME_TO_STR(p.CreationDate, '%h'), COUNT(*) FROM Posts AS p WHERE p.OwnerUserId = @UserId AND p.PostTypeId = 2 GROUP BY TIME_TO_STR(p.CreationDate, '%h') |
CREATE TABLE table_51004 (
"Year" real,
"Nord" text,
"West" text,
"S\u00fcdwest" text,
"Berlin" text
) | What was Berlin when fk pirmasens was S dwest and westfalia herne was west? | SELECT "Berlin" FROM table_51004 WHERE "S\u00fcdwest" = 'fk pirmasens' AND "West" = 'westfalia herne' |
CREATE TABLE table_6000 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
) | Which Team classification has a Combination classification of egoi mart nez, and a Winner of tom boonen? | SELECT "Team classification" FROM table_6000 WHERE "Combination classification" = 'egoi martínez' AND "Winner" = 'tom boonen' |
CREATE TABLE table_11144 (
"Season" real,
"Episodes" real,
"Originally aired" text,
"Season Premiere" text,
"Season Finale" text,
"DVD release date" text
) | Which series has a season premiere on January 3, 2007 with the most episodes? | SELECT MAX("Episodes") FROM table_11144 WHERE "Season Premiere" = 'january 3, 2007' |
CREATE TABLE table_name_39 (
opposition VARCHAR,
stadium VARCHAR
) | Who was the opposition at 11,682 excl. exhibition match? | SELECT opposition FROM table_name_39 WHERE stadium = "11,682 excl. exhibition match" |
CREATE TABLE table_32293 (
"Date" text,
"Time" text,
"Epicenter" text,
"Magnitude" text,
"Fatalities" text,
"Name" text
) | What is the Time when the Epicenter was Bam? | SELECT "Time" FROM table_32293 WHERE "Epicenter" = 'bam' |
CREATE TABLE table_name_19 (
interview VARCHAR,
country VARCHAR,
swimsuit VARCHAR
) | What is the interview number in Louisiana, and the swimsuit number is more than 9.1? | SELECT COUNT(interview) FROM table_name_19 WHERE country = "louisiana" AND swimsuit > 9.1 |
CREATE TABLE table_41721 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text,
"Attendance" text
) | Where Bolton Wanderers is the home team, who is the away team? | SELECT "Away team" FROM table_41721 WHERE "Home team" = 'bolton wanderers' |
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 days of hospital stay and death status of subject name elizabeth bateman? | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Elizabeth Bateman" |
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,
... | let me know the primary disease and name of the patient with patient id 7578. | SELECT demographic.name, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "7578" |
CREATE TABLE table_41090 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text... | What is 1989, when 1999 is F, and when 1994 is 2R? | SELECT "1989" FROM table_41090 WHERE "1999" = 'f' AND "1994" = '2r' |
CREATE TABLE table_name_4 (
winning_score VARCHAR,
date VARCHAR
) | What was the winning score on 7 jun 1976? | SELECT winning_score FROM table_name_4 WHERE date = "7 jun 1976" |
CREATE TABLE table_23747 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real,
"Total" real
) | What percentage of the votes did Obama get in the county where McCain got 3648 votes? | SELECT "Obama%" FROM table_23747 WHERE "McCain#" = '3648' |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int... | Have I taken any courses that are among the most difficult in the NERS department ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'NERS' AND program_course.workload = (SELECT MAX(... |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients whose diagnoses long title is neonatal hypoglycemia and lab test category is chemistry? | 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.long_title = "Neonatal hypoglycemia" AND lab."CATEGORY" = "Chemistry" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | what was the length of stay of patient 15135's last hospital stay? | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 15135 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_name_6 (
closed VARCHAR,
opened VARCHAR,
distance_from_wellington VARCHAR
) | Opened prior to 1877 only 2.44km from Wellington, when did this station close? | SELECT closed FROM table_name_6 WHERE opened < 1877 AND distance_from_wellington = "2.44km" |
CREATE TABLE table_59428 (
"Classification" text,
"% of all" text,
"John Kerry" text,
"John Edwards" text,
"Dennis Kucinich" text
) | What is Dennis Kucinich, when Classification is 'Democrat'? | SELECT "Dennis Kucinich" FROM table_59428 WHERE "Classification" = 'democrat' |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airlin... | in the month of december are there any flights from ATLANTA to DENVER that stop in BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND CITY_2.cit... |
CREATE TABLE table_name_73 (
architecture VARCHAR,
original_vehicle VARCHAR
) | What architecture type does the Ford Escort Wagon have? | SELECT architecture FROM table_name_73 WHERE original_vehicle = "ford escort wagon" |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | when did patient 005-4471 first had the tube feeding residual discarded (ml) output since 08/08/2102? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471')) AND intakeoutput.cellpath LIKE '%output%'... |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | Questions where a given tag was added not by its author. | SELECT q.Id AS "post_link", h.Text AS "edited_tags", q.OwnerUserId AS "user_link", q.CreationDate AS "post_date", h.UserId AS "user_link", h.CreationDate AS "edit_date" FROM PostHistory AS h, Posts AS q WHERE h.PostId = q.Id AND h.PostHistoryTypeId = 6 AND h.Text LIKE '%<' + '##Tag##' + '>%' AND h.UserId != q.OwnerUser... |
CREATE TABLE table_1449176_1 (
common_of VARCHAR,
rank VARCHAR
) | What is the name of the 9th ranked common? | SELECT common_of FROM table_1449176_1 WHERE rank = "9th" |
CREATE TABLE table_name_65 (
speed VARCHAR,
rank VARCHAR,
rider VARCHAR
) | What is Ryan McCay's speed that has a rank better than 8? | SELECT speed FROM table_name_65 WHERE rank > 8 AND rider = "ryan mccay" |
CREATE TABLE table_name_95 (
call_sign VARCHAR,
city_of_license VARCHAR
) | What Call sign has a City of license of higgston, ga? | SELECT call_sign FROM table_name_95 WHERE city_of_license = "higgston, ga" |
CREATE TABLE table_203_855 (
id number,
"date" text,
"city" text,
"venue" text,
"member" text,
"performance" text,
"notes" text
) | how many days after september 3rd did brian perform in stockholm ? | SELECT (SELECT "date" FROM table_203_855 WHERE "city" = 'stockholm') - 3 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients born before 1821 who were discharged to skilled nursing facility? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "1821" |
CREATE TABLE table_57405 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the date that an away team score 11.22 (88)? | SELECT "Date" FROM table_57405 WHERE "Away team score" = '11.22 (88)' |
CREATE TABLE table_203_502 (
id number,
"team" text,
"titles" number,
"runner-up" number,
"third place" number,
"fourth place" number,
"years participated" number
) | what are the number of years maine has participated ? | SELECT "years participated" FROM table_203_502 WHERE "team" = 'maine' |
CREATE TABLE table_27011 (
"Vehicle" text,
"Operating mode" text,
"EPA rated All-electric range" text,
"EPA rated combined fuel economy" text,
"Clean electric grid California (San Francisco)" text,
"U.S. national average electric mix" text,
"Dirty electric grid Rocky Mountains (Denver)" text... | When 100 g/mi (62 g/km) is the clean electric grid california (san francisco) how many vehicles are there? | SELECT COUNT("Vehicle") FROM table_27011 WHERE "Clean electric grid California (San Francisco)" = '100 g/mi (62 g/km)' |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions (
transacti... | Show all dates of transactions whose type code is 'SALE', and count them by a line chart, and list x axis from high to low order. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" ORDER BY date_of_transaction DESC |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Or... | Show the number of customers for each gender. Show scatter chart. | SELECT gender, COUNT(*) FROM Customers GROUP BY gender |
CREATE TABLE table_name_3 (
quantity_made VARCHAR,
manufacturer VARCHAR
) | What is Quantity Made, when Manufacturer is 'Baldwin'? | SELECT quantity_made FROM table_name_3 WHERE manufacturer = "baldwin" |
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
dr... | Show the position of players and the corresponding number of players. | SELECT position, COUNT(*) FROM match_season GROUP BY position |
CREATE TABLE table_43486 (
"Venue" text,
"Location" text,
"Environment" text,
"Closed" text,
"Reason" text
) | What were the reasons that venues closed in the 1990s? | SELECT "Reason" FROM table_43486 WHERE "Closed" = '1990s' |
CREATE TABLE pilot (
name VARCHAR,
pilot_id VARCHAR,
Winning_Pilot VARCHAR,
country VARCHAR
)
CREATE TABLE MATCH (
name VARCHAR,
pilot_id VARCHAR,
Winning_Pilot VARCHAR,
country VARCHAR
) | find the name of pilots who did not win the matches held in the country of Australia. | SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia') |
CREATE TABLE table_name_85 (
championship INTEGER,
league_cup VARCHAR,
total VARCHAR
) | What is the highest championship that has 1 as the league cup, and 17 as the total? | SELECT MAX(championship) FROM table_name_85 WHERE league_cup = 1 AND total = "17" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varch... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, display in ascending by the the average of salary. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY) |
CREATE TABLE table_1745843_9 (
verb_meaning VARCHAR,
part_2 VARCHAR
) | Name the verb meaning for half drosch | SELECT verb_meaning FROM table_1745843_9 WHERE part_2 = "half drosch" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients whose marital status is married and lab test name is albumin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Albumin" |
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 admitted as clinic referral (premature) were diagnosed with percutaneous transluminal coronary angioplasty status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Percutaneous transluminal coronary angioplasty status" |
CREATE TABLE table_13573 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | What's the cores with the part number cl8064701477202? | SELECT "Cores" FROM table_13573 WHERE "Part number(s)" = 'cl8064701477202' |
CREATE TABLE table_203_747 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many countries have at least 10 gold medals in the asian youth games ? | SELECT COUNT("nation") FROM table_203_747 WHERE "gold" >= 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.