table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_76299 (
"noun root (meaning)" text,
"case suffix (case)" text,
"postposition" text,
"full word" text,
"English meaning" text
) | What is the Full Word, when Case Suffix (case) is '-sa (dative)'? | SELECT "full word" FROM table_76299 WHERE "case suffix (case)" = '-sa (dative)' |
CREATE TABLE table_40046 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What shows for ICAO when the IATA is sin? | SELECT "ICAO" FROM table_40046 WHERE "IATA" = 'sin' |
CREATE TABLE table_name_43 (
tournament VARCHAR
) | What is the 2010 value with A in 2009 and A in 2008 in the Australian Open? | SELECT 2010 FROM table_name_43 WHERE 2009 = "a" AND 2008 = "a" AND tournament = "australian open" |
CREATE TABLE table_25501 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the highest game number where the team was Cleveland? | SELECT MAX("Game") FROM table_25501 WHERE "Team" = 'Cleveland' |
CREATE TABLE table_12088 (
"Driver" text,
"Constructor" text,
"Q1 order" real,
"Q1 time" text,
"Q1 pos" real,
"Q1+Q2 time" text
) | Who is the driver whose car was constructed by Renault and whose Q1 pos is greater than 2? | SELECT "Driver" FROM table_12088 WHERE "Constructor" = 'renault' AND "Q1 pos" > '2' |
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,
... | count the number of patients whose admission type is elective and admission year is less than 2176? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2176" |
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,
... | what is the admission location and procedure long title of subject id 2560? | SELECT demographic.admission_location, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE table_name_45 (
to_par VARCHAR,
year_s__won VARCHAR
) | What is the To par of the Player who won in 1936? | SELECT to_par FROM table_name_45 WHERE year_s__won = "1936" |
CREATE TABLE table_40454 (
"Rank" real,
"Prev" real,
"Player" text,
"Rating" real,
"Chng" text
) | Can you tell me the total number of Prev that has the Chng of +10, and the Rating larger than 2765? | SELECT COUNT("Prev") FROM table_40454 WHERE "Chng" = '+10' AND "Rating" > '2765' |
CREATE TABLE table_1181375_1 (
introduced VARCHAR,
notes VARCHAR
) | what's the introduced where notes is 9 withdrawn in 1946 after fire | SELECT introduced FROM table_1181375_1 WHERE notes = "9 withdrawn in 1946 after fire" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | 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 job_id , and group by attribute job_id by a bar chart, list by the y-axis from high to low. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC |
CREATE TABLE table_34875 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What is the sum for the game with a score of 103 126? | SELECT SUM("Game") FROM table_34875 WHERE "Score" = '103–126' |
CREATE TABLE table_name_43 (
score VARCHAR,
game VARCHAR
) | What is the Score of game 35? | SELECT score FROM table_name_43 WHERE game = 35 |
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 (
... | what is the number of patients whose admission type is emergency and procedure long title is colostomy, not otherwise specified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Colostomy, not otherwise specified" |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id numbe... | since 5 months ago, patient 3277 had received any medicine? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3277) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 month') |
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 admission location is emergency room admit and year of death is less than or equal to 2138? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dod_year <= "2138.0" |
CREATE TABLE table_9878 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" text
) | On what Date prior to Week 14 was the Record 7-1? | SELECT "Date" FROM table_9878 WHERE "Week" < '14' AND "Record" = '7-1' |
CREATE TABLE table_27700375_11 (
date VARCHAR,
location_attendance VARCHAR
) | Name the date for the palace of auburn hills 14,554 | SELECT date FROM table_27700375_11 WHERE location_attendance = "The Palace of Auburn Hills 14,554" |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | what are the flights from DENVER to PITTSBURGH | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... |
CREATE TABLE table_203_551 (
id number,
"goal" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what is the total number of international goals d m szalai has made ? | SELECT COUNT("goal") FROM table_203_551 |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | when was the last time that patient 19981 was given a hemoglobin lab test in 02/last year? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19981) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR... |
CREATE TABLE table_203_855 (
id number,
"date" text,
"city" text,
"venue" text,
"member" text,
"performance" text,
"notes" text
) | what was the last venue brian preformed in ? | SELECT "venue" FROM table_203_855 ORDER BY "date" DESC LIMIT 1 |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_J... | Find the number of professors with a PhD degree in each department Show bar chart, and could you display X from low to high order? | SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY DEPT_CODE |
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 transfers (
row_id number,
subject_id number,
hadm_... | how many patients had been in the careunit sicu during the previous year? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TAB... | li dong 's paper about semantic parsing | SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori... |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Which Other classes are available next Winter ? | 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_offering.course_id WHERE program_cour... |
CREATE TABLE table_35776 (
"Rank" real,
"Building" text,
"City" text,
"Height (m/ft)" text,
"Built" real
) | What is the name of the building in Bucharest with a rank of less than 12? | SELECT "Building" FROM table_35776 WHERE "City" = 'bucharest' AND "Rank" < '12' |
CREATE TABLE table_10127 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Who took the loss against the California Angels when the attendance was 10,886? | SELECT "Loss" FROM table_10127 WHERE "Opponent" = 'california angels' AND "Attendance" = '10,886' |
CREATE TABLE table_name_18 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR
) | How many bronze medals for the United Kingdom when the silver was less than 0? | SELECT AVG(bronze) FROM table_name_18 WHERE nation = "united kingdom" AND silver < 0 |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | indicate the daily maximum amount of sao2 for patient 006-141797 on the last icu visit. | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-141797') AND NOT patient.unitdischargetime IS NULL OR... |
CREATE TABLE table_65292 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the result for week 2? | SELECT "Result" FROM table_65292 WHERE "Week" = '2' |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name var... | please list all DL flights from KANSAS CITY to SALT LAKE CITY | 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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | what is the number of patients who have had a po oral intake since 6 years ago? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'po oral' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-6 year')) |
CREATE TABLE table_name_51 (
week INTEGER,
date VARCHAR,
attendance VARCHAR
) | When was the last time, since December 14, 1986, that the attendance was lower than 47,096? | SELECT MAX(week) FROM table_name_51 WHERE date = "december 14, 1986" AND attendance < 47 OFFSET 096 |
CREATE TABLE table_57724 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many points did the away team score at Arden Street Oval? | SELECT "Away team score" FROM table_57724 WHERE "Venue" = 'arden street oval' |
CREATE TABLE table_73942 (
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text
) | What is the nickname of the University of Alabama? | SELECT "Nickname" FROM table_73942 WHERE "School" = 'University of Alabama' |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is subject name and gender of subject id 2560? | SELECT demographic.name, demographic.gender FROM demographic WHERE demographic.subject_id = "2560" |
CREATE TABLE table_3543 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | How many Kent State University's are there? | SELECT COUNT("Location") FROM table_3543 WHERE "Institution" = 'Kent State University' |
CREATE TABLE table_73676 (
"Club" text,
"Home city" text,
"Stadium" text,
"First season in the Serie A" real,
"First season in current spell" real,
"Last title" text
) | Name the last title for 2012 | SELECT "Last title" FROM table_73676 WHERE "First season in current spell" = '2012' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | provide the number of patients whose discharge location is dead/expired and admission year is less than 2145? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.admityear < "2145" |
CREATE TABLE table_73795 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text,
"US News Ranking 2014 for Liberal Arts" text,
"Football?" text
) | When was Dickinson College founded? | SELECT "Founded" FROM table_73795 WHERE "Institution" = 'Dickinson College' |
CREATE TABLE table_name_74 (
popular_votes VARCHAR,
office VARCHAR,
year VARCHAR
) | Name the total number of popular votes for mn attorney general in 1994 | SELECT COUNT(popular_votes) FROM table_name_74 WHERE office = "mn attorney general" AND year = 1994 |
CREATE TABLE problems (
problem_id VARCHAR,
reported_by_staff_id VARCHAR
)
CREATE TABLE staff (
staff_id VARCHAR,
staff_last_name VARCHAR
) | Find the ids of the problems that are reported by the staff whose last name is Bosco. | SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco" |
CREATE TABLE table_51166 (
"Episode" real,
"Original airdate" text,
"Timeslot (approx.)" text,
"Viewers (millions)" real,
"Nightly rank" text
) | Original airdate for #6 with 1.246 viewers? | SELECT "Original airdate" FROM table_51166 WHERE "Nightly rank" = '#6' AND "Viewers (millions)" = '1.246' |
CREATE TABLE table_26931 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
) | List all opponents from the 4-4 scoring game. | SELECT "Opponent" FROM table_26931 WHERE "Record" = '4-4' |
CREATE TABLE table_name_62 (
year VARCHAR,
points VARCHAR,
chassis VARCHAR
) | Name the year for points less than 20 and chassis of dallara 3087 | SELECT year FROM table_name_62 WHERE points < 20 AND chassis = "dallara 3087" |
CREATE TABLE table_27155678_2 (
gene_name VARCHAR,
genus_species VARCHAR
) | Name the gene name for methylobacterium nodulans | SELECT gene_name FROM table_27155678_2 WHERE genus_species = "Methylobacterium nodulans" |
CREATE TABLE table_name_92 (
set_1 VARCHAR,
total VARCHAR
) | What is the set 1 score when the total is 85 101? | SELECT set_1 FROM table_name_92 WHERE total = "85–101" |
CREATE TABLE table_name_62 (
seats INTEGER,
general_election VARCHAR,
share_of_votes VARCHAR,
share_of_seats VARCHAR
) | Which Seats have a Share of votes of 18%, and a Share of seats of 3%, and a General election larger than 1992? | SELECT MAX(seats) FROM table_name_62 WHERE share_of_votes = "18%" AND share_of_seats = "3%" AND general_election > 1992 |
CREATE TABLE table_train_240 (
"id" int,
"anemia" bool,
"gender" string,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
"insulin_requirement" float,
"kidney_disease" bool,
"body... | have normal or only mildly impaired kidney function defined as a calculated gfr greater than 60 ml / min / 1.73 m2 | SELECT * FROM table_train_240 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr > 60 |
CREATE TABLE table_204_143 (
id number,
"national park" text,
"region" text,
"land area (km2)" number,
"established" number,
"visitation (2009)" number,
"coordinates" text
) | how many national parks were established after 1990 ? | SELECT COUNT("national park") FROM table_204_143 WHERE "established" > 1990 |
CREATE TABLE table_204_879 (
id number,
"year" number,
"host / location" text,
"division i overall" text,
"division i undergraduate" text,
"division ii overall" text,
"division ii community college" text
) | what is the first year on the chart ? | SELECT "year" FROM table_204_879 WHERE id = 1 |
CREATE TABLE table_73803 (
"City / Municipality" text,
"No. of s Barangay" real,
"District" real,
"Area (km\u00b2)" text,
"Population (2010)" real,
"Income class (2007)" text,
"ZIP code" real,
"Mayor" text
) | What are all the metropolis / municipality where mayor is helen c. De castro | SELECT "City / Municipality" FROM table_73803 WHERE "Mayor" = 'Helen C. De Castro' |
CREATE TABLE table_name_24 (
opponent VARCHAR,
week VARCHAR
) | Who is the listed opponent in Week 2? | SELECT opponent FROM table_name_24 WHERE week = 2 |
CREATE TABLE table_74579 (
"Lane" real,
"Name" text,
"Nationality" text,
"Split (50m)" real,
"Time" real
) | What is the slowest 50m split time for a total of 53.74 in a lane of less than 3? | SELECT MAX("Split (50m)") FROM table_74579 WHERE "Time" = '53.74' AND "Lane" < '3' |
CREATE TABLE table_28219 (
"Unit" text,
"Commander" text,
"Complement" text,
"Killed" text,
"Wounded" text,
"Missing" text
) | What was the complement associated with 0 off 3 men killed and 0 off 2 men wounded? | SELECT "Complement" FROM table_28219 WHERE "Killed" = '0 off 3 men' AND "Wounded" = '0 off 2 men' |
CREATE TABLE table_41732 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the sum of top-25s for events with more than 1 top-5? | SELECT SUM("Top-25") FROM table_41732 WHERE "Top-5" > '1' |
CREATE TABLE table_20790 (
"product" text,
"dimensions (mm)" text,
"dpi" real,
"pages per minute (color)" real,
"max page size" text,
"interface" text
) | What are the mm dimensions of the Plustek Mobileoffice D28 Corporate? | SELECT "dimensions (mm)" FROM table_20790 WHERE "product" = 'Plustek MobileOffice D28 Corporate' |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
... | All my answers sort score , viewcount, creationDate. All my answers on the site | SELECT * FROM (SELECT q.Id AS aid, a.Id AS "post_link", CASE WHEN q.AcceptedAnswerId = a.Id THEN 'Accepted' END AS Accepted, a.Score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2) AS AA INNER JOIN (SELECT DISTINCT Question.Id AS bid, Question.CreationDate ... |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE invoice (
invoiceid number,
customerid number,
invoicedate time,
billingaddress text,
billingcity text,
billingstate text,
billingcountry text,
billingpostalcode text,
total number
)
CREATE TABLE mediatype ... | Find the average unit price of tracks from the Rock genre. | SELECT AVG(T2.unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock" |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | Show the number of the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks'. | SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | what is the top three most frequent microbiology tests that followed in the same month for patients who received chest x-ray? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'chest x-ray') AS t1 JOIN (SELECT patient.uni... |
CREATE TABLE table_name_59 (
nationality VARCHAR,
lane VARCHAR,
rank VARCHAR
) | What Nationality of the person who has a Rank of 4 | SELECT nationality FROM table_name_59 WHERE lane < 4 AND rank = 4 |
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 prescriptions... | calculate the maximum age of male patients with angioedema as primary disease. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "ANGIOEDEMA" |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE ... | How many papers are in NLP ? | SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'NLP' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
CREATE TABLE table_64653 (
"Rank" real,
"Name" text,
"Status" text,
"City" text,
"Floors" real
) | What is the rank for the city of sewri? | SELECT COUNT("Rank") FROM table_64653 WHERE "City" = 'sewri' |
CREATE TABLE table_74774 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | How many weeks had an attendance larger than 84,816? | SELECT COUNT("Week") FROM table_74774 WHERE "Attendance" > '84,816' |
CREATE TABLE table_46715 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"1st Leg" text
) | What is the round of club be ej? | SELECT "Round" FROM table_46715 WHERE "Club" = 'bečej' |
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers real,
Domestic_Passengers real,
Transit_Passengers real,
Aircraft_Movements real,
Freight_Metric_Tonnes real
)
CREATE TABLE aircraft (
Aircraft_ID int(11... | What is the number of each winning aircraft? Visualize by bar chart, and show from low to high by the total number. | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY COUNT(Aircraft) |
CREATE TABLE table_5232 (
"Rank" real,
"Airport" text,
"Passengers" real,
"% Change" text,
"Carriers" text
) | What is the Rank that has Passengers larger than 70,921, and 2.8 % Change? | SELECT SUM("Rank") FROM table_5232 WHERE "Passengers" > '70,921' AND "% Change" = '2.8' |
CREATE TABLE table_name_21 (
lane VARCHAR,
time VARCHAR
) | What is the lane number of the swimmer with a time of 55.69? | SELECT lane FROM table_name_21 WHERE time = 55.69 |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | calculate the stool output of patient 015-59552 on this month/26. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND intakeoutput.celllabel = 'stool... |
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... | what is the number of patients whose insurance is medicaid and procedure short title is conduit left ventr-aorta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.short_title = "Conduit left ventr-aorta" |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | What is minimum hours of the students playing in different position? | SELECT MIN(T2.hs), T1.ppos FROM tryout AS T1 JOIN player AS T2 ON T1.pid = T2.pid GROUP BY T1.ppos |
CREATE TABLE table_27988 (
"Rnd" text,
"Circuit" text,
"Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text,
"Supporting" text
) | What was the winning team when mikhail goikhberg was the winning driver? | SELECT "Winning team" FROM table_27988 WHERE "Winning driver" = 'Mikhail Goikhberg' |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
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)
) | A bar chart about what is minimum hours of the students playing in different position?, show Y in asc order. | SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY MIN(T2.HS) |
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE a... | What is the song in the volume with the maximum weeks on top? | SELECT song FROM volume ORDER BY weeks_on_top DESC LIMIT 1 |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,... | how did in 2105 patient 86209 last enter the hospital? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 86209 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_54782 (
"Rank" real,
"Club" text,
"Gold" real,
"Big Silver" real,
"Small Silver" real,
"Bronze" real,
"Points" real
) | How many points did landskrona bois get when they were ranked below 18? | SELECT COUNT("Points") FROM table_54782 WHERE "Club" = 'landskrona bois' AND "Rank" < '18' |
CREATE TABLE flight (
id VARCHAR,
airport_id VARCHAR,
pilot VARCHAR
)
CREATE TABLE airport (
id VARCHAR,
airport_id VARCHAR,
pilot VARCHAR
) | How many airports haven't the pilot 'Thompson' driven an aircraft? | SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson') |
CREATE TABLE table_34802 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
) | Who was the runner-up on 5 aug 1990? | SELECT "Runner-up" FROM table_34802 WHERE "Date" = '5 aug 1990' |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose diagnoses icd9 code is 5589 and lab test fluid is blood? | 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 = "5589" AND lab.fluid = "Blood" |
CREATE TABLE table_66046 (
"Hull Number" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | Who was the builder for the USS cambridge? | SELECT "Builder" FROM table_66046 WHERE "Name" = 'uss cambridge' |
CREATE TABLE drivers (
forename VARCHAR
) | List the forenames of all distinct drivers in alphabetical order? | SELECT DISTINCT forename FROM drivers ORDER BY forename |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | what was the name of the specimen test that was first given to patient 031-15417 since 116 months ago? | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRE... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | provide the number of patients with delta abnormal lab test status who have benign neoplasm of pituitary gland and craniopharyngeal duct diagnoses. | 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 = "Benign neoplasm of pituitary gland and craniopharyngeal duct" AND lab.flag = "delta" |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give the duration of hospital stay for subject id 8440. | SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "8440" |
CREATE TABLE table_21592 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What day(s) did the team play indiana? | SELECT "Date" FROM table_21592 WHERE "Team" = 'Indiana' |
CREATE TABLE table_name_56 (
erp_w VARCHAR,
city_of_license VARCHAR
) | Name the ERP W for glens falls, new york | SELECT erp_w FROM table_name_56 WHERE city_of_license = "glens falls, new york" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
u... | what was the first drug that patient 016-9636 had been prescribed via ngt route in this month? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND medication.routeadmin = 'ngt' AND DATETIME(medicati... |
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 ... | Let me know on which date the patient Brian Taylor died. | SELECT demographic.dod FROM demographic WHERE demographic.name = "Brian Taylor" |
CREATE TABLE table_53425 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How large of a crowd can the Brunswick Street Oval hold? | SELECT COUNT("Crowd") FROM table_53425 WHERE "Venue" = 'brunswick street oval' |
CREATE TABLE table_28693349_2 (
games INTEGER,
player VARCHAR
) | How many games did Robert Peare play? | SELECT MAX(games) FROM table_28693349_2 WHERE player = "Robert Peare" |
CREATE TABLE table_78445 (
"Name" text,
"Gender" text,
"Local board" text,
"Suburb" text,
"Authority" text,
"Decile" text,
"Roll" real
) | What is the name when the local board is albert eden, and a Decile of 9? | SELECT "Name" FROM table_78445 WHERE "Local board" = 'albert–eden' AND "Decile" = '9' |
CREATE TABLE table_name_35 (
record VARCHAR,
event VARCHAR
) | Which Record has an Event of cage rage 23? | SELECT record FROM table_name_35 WHERE event = "cage rage 23" |
CREATE TABLE table_50370 (
"Start Date/Time" text,
"Duration" text,
"End Time" text,
"Spacecraft" text,
"Crew" text
) | What crew's EVA started on 20 February 20:09? | SELECT "Crew" FROM table_50370 WHERE "Start Date/Time" = '20 february 20:09' |
CREATE TABLE table_19446 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | What are all the AAA classes in the school years of 2004-05? | SELECT "Class AAA" FROM table_19446 WHERE "School Year" = '2004-05' |
CREATE TABLE table_name_46 (
date VARCHAR,
winner VARCHAR,
race_name VARCHAR
) | What date did Ted Horn win Lakewood Race 2? | SELECT date FROM table_name_46 WHERE winner = "ted horn" AND race_name = "lakewood race 2" |
CREATE TABLE company (
headquarters VARCHAR
) | List all headquarters and the number of companies in each headquarter. | SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | what was the name of the procedure, which patient 006-70268 was first received this year? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND DATETIME(treatment.treatmenttime, 'start of year... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.