context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_tit... | how much does a drug cost, oxycodone-acetaminophen elixir? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'oxycodone-acetaminophen elixir') | mimic_iii |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Descr... | Upvotes per Question/Answer for postgresql tag. | SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS StartOfMonth, COUNT(DISTINCT Posts.Id) AS Questions, COUNT(*) AS UpVotes, ROUND(COUNT(*) / CAST(COUNT(DISTINCT Posts.Id) AS DECIMAL), 2) AS UpVotesPerQuestion, ROUND(SUM(CASE WHEN Votes.PostId IS NULL THEN 1 ELSE 0 END) / CAST(COUNT(DISTINCT Posts.Id) AS DEC... | sede |
CREATE TABLE table_train_202 (
"id" int,
"systolic_blood_pressure_sbp" int,
"body_weight" float,
"diabetic" string,
"qtc" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"clinical_diagnosis" bool,
"NOUSE" float
) | blood pressure greater than 160 / 105 mmhg | SELECT * FROM table_train_202 WHERE systolic_blood_pressure_sbp >= 160 OR diastolic_blood_pressure_dbp >= 105 | criteria2sql |
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
)
... | what is admission type and primary disease of subject id 12220? | SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "12220" | mimicsql_data |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,... | Most viewed questions | Most votes. | SELECT Questions.Id AS "post_link", Questions.Title, Questions.AnswerCount, Questions.ViewCount, Questions.FavoriteCount, Questions.Score, Questions.LastActivityDate FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = Users.Id INNER J... | sede |
CREATE TABLE table_204_129 (
id number,
"place" number,
"team" text,
"titles" number,
"runners-up" number,
"winning years" text
) | what is the last team ? | SELECT "team" FROM table_204_129 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_80 (
result VARCHAR,
opponent VARCHAR
) | What was the result of the game versus Tulsa? | SELECT result FROM table_name_80 WHERE opponent = "tulsa" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | for patients who have been diagnosed with fx lumbar vertebra-close this year what are the five most common procedures that followed within 2 months? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE phone (
Hardware_Model_name VARCHAR,
chip_model VARCHAR,
screen_mode VARCHAR
)
CREATE TABLE screen_mode (
Graphics_mode VARCHAR,
Type VARCHAR
)
CREATE TABLE chip_model (
Model_name VARCHAR,
RAM_MiB VARCHAR
) | List the hardware model name for the phones that have screen mode type 'Text' or RAM size greater than 32. | SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB > 32 | sql_create_context |
CREATE TABLE table_name_59 (
date VARCHAR,
catalogue__number VARCHAR
) | What is the date with the catalogue number ptcd-1015-6? | SELECT date FROM table_name_59 WHERE catalogue__number = "ptcd-1015-6" | sql_create_context |
CREATE TABLE table_61520 (
"Score" text,
"Pos." real,
"Inn." real,
"Venue" text,
"H/A/N" text
) | Which H/A/N has a score of 105* ? | SELECT "H/A/N" FROM table_61520 WHERE "Score" = '105*♠' | wikisql |
CREATE TABLE table_204_311 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many nations have a total of 1 medal won ? | SELECT COUNT("nation") FROM table_204_311 WHERE "total" = 1 | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | when was the first hospital admission time of patient 016-22566 that had been admitted on the direct admit since 2 years ago? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-22566' AND patient.hospitaladmitsource = 'direct admit' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_name_84 (
player VARCHAR,
pos VARCHAR,
college VARCHAR
) | Which player had a position of QB for Texas Tech? | SELECT player FROM table_name_84 WHERE pos = "qb" AND college = "texas tech" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 住院天数超过11天的,在医疗机构1966400里总共有多少 | SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '1966400' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 11 | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | show me the top four most common diagnoses of patients with the age of 20s? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREA... | which EMNLP 2010 papers have been cited the most ? | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'EMNLP' GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC | scholar |
CREATE TABLE table_39524 (
"Ethnic group" text,
"Totora Municipality (%)" real,
"Pojo Municipality (%)" real,
"Pocona Municipality (%)" real,
"Chimor\u00e9 Municipality (%)" real,
"Puerto Villarroel Municipality (%)" real,
"Entre R\u00edos Municipality (%)" real
) | Which Pocona Municipality (%) is the lowest one that has a Puerto Villarroel Municipality (%) smaller than 14.6, and a Chimor Municipality (%) of 5.1, and an Entre R os Municipality (%) smaller than 0.9? | SELECT MIN("Pocona Municipality (%)") FROM table_39524 WHERE "Puerto Villarroel Municipality (%)" < '14.6' AND "Chimor\u00e9 Municipality (%)" = '5.1' AND "Entre R\u00edos Municipality (%)" < '0.9' | wikisql |
CREATE TABLE table_name_95 (
gold INTEGER,
rank VARCHAR
) | What is the sum of gold medals for a rank of 14? | SELECT SUM(gold) FROM table_name_95 WHERE rank = "14" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | what is the daily average amount of urinary catheter output: indwelling/continuous ure that patient 015-91239 had on the current icu visit? | SELECT AVG(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-91239') AND patient.unitdischargetime IS NUL... | eicu |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name te... | Average number of answers depending on the weekday when the question was posted. | WITH tmp AS (SELECT AnswerCount AS ACount, Period = TIME_TO_STR(CreationDate, '%W') FROM Posts WHERE PostTypeId = 1) SELECT Period, AVG(CAST(ACount AS FLOAT)) FROM tmp GROUP BY Period ORDER BY Period | sede |
CREATE TABLE table_65929 (
"Team" text,
"Car Spec." text,
"Drivers" text,
"Class" text,
"Rounds" text
) | What is the car specs for team Airwaves BMW's driver Rob Collard? | SELECT "Car Spec." FROM table_65929 WHERE "Team" = 'airwaves bmw' AND "Drivers" = 'rob collard' | wikisql |
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE authors (
authid number,
lname text,
fname text
) | How many authors are there? | SELECT COUNT(*) FROM authors | spider |
CREATE TABLE table_2570269_2 (
original_air_date__uk_ VARCHAR,
episode__number VARCHAR
) | If the episode number is 2-01 what is the original UK air date? | SELECT original_air_date__uk_ FROM table_2570269_2 WHERE episode__number = "2-01" | sql_create_context |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphras... | How many papers were written on the developing world this year ? | SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'developing world' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = year0 | scholar |
CREATE TABLE table_name_50 (
agg VARCHAR
) | What was the score of the second leg with an agg of 4-6? | SELECT 2 AS nd_leg FROM table_name_50 WHERE agg = "4-6" | sql_create_context |
CREATE TABLE table_66494 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What was the highest number of bronze medals when there were a total of 4 medals, 1 silver medals, and less than 2 medals? | SELECT MAX("Bronze") FROM table_66494 WHERE "Total" = '4' AND "Silver" = '1' AND "Gold" < '2' | wikisql |
CREATE TABLE table_name_89 (
country VARCHAR,
town VARCHAR
) | what country has dubai | SELECT country FROM table_name_89 WHERE town = "dubai" | sql_create_context |
CREATE TABLE table_name_39 (
year INTEGER,
mintage VARCHAR,
issue_price VARCHAR
) | What is the latest year that has an n/a mintage and an Issue Price of $89.95? | SELECT MAX(year) FROM table_name_39 WHERE mintage = "n/a" AND issue_price = "$89.95" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | how much is the difference of weights of patient 017-101426 second measured on the last hospital visit compared to the first value measured on the last hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-101426' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... | eicu |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | how many people had died after being diagnosed with defibrination syndrome during the same month? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE table_name_31 (
home_team VARCHAR,
away_team VARCHAR
) | What did the home team score when the away team was South Melbourne? | SELECT home_team AS score FROM table_name_31 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | count the number of patients who were prescribed pantoprazole sodium within the same month after receiving a cont inv mec ven 96+ hrs procedure. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv me... | mimic_iii |
CREATE TABLE table_6534 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronzes for the nation with over 20 total, under 26 golds, and over 0 silvers? | SELECT COUNT("Bronze") FROM table_6534 WHERE "Silver" > '0' AND "Total" > '20' AND "Gold" < '26' | wikisql |
CREATE TABLE table_name_76 (
_specialist_ VARCHAR,
physician__gp_ INTEGER,
all_nurses VARCHAR
) | What is the number of physicians in the region with an all nurses number of 91? | SELECT MIN(physician__gp_) & _specialist_ FROM table_name_76 WHERE all_nurses = 91 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid ... | what is the number of patients having antiplatelet agent - aggregation inhibitors until 2101? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'antiplatelet agent - aggregation inhibitors' AND STRFTIME('%y', treatment.treatmenttime) <= '2101') | eicu |
CREATE TABLE table_name_72 (
number_of_sequences_number_of_sequences VARCHAR,
name VARCHAR
) | What is the number of sequences for the name Alifoldz? | SELECT number_of_sequences_number_of_sequences AS :_ FROM table_name_72 WHERE name = "alifoldz" | sql_create_context |
CREATE TABLE table_name_32 (
average_annual VARCHAR
) | What is the average value for 2005, when the value for Average annual is 767? | SELECT AVG(2005) FROM table_name_32 WHERE average_annual = 767 | sql_create_context |
CREATE TABLE table_39602 (
"Bank" text,
"Asset" real,
"Loans" real,
"NPL Net" text,
"Deposits" real,
"Net Interest Income" real,
"Non-Interest Income" real,
"Net Profit" real,
"No. of Employees" text,
"No. of Branches/Offices" real,
"No. of ATMs" text
) | Which NPL net's bank was citibank? | SELECT "NPL Net" FROM table_39602 WHERE "Bank" = 'citibank' | wikisql |
CREATE TABLE table_name_97 (
rank__timeslot_ INTEGER,
rating VARCHAR,
share VARCHAR
) | What is the timeslot rank when the rating is smaller than 2.6 and the share is more than 4? | SELECT AVG(rank__timeslot_) FROM table_name_97 WHERE rating < 2.6 AND share > 4 | sql_create_context |
CREATE TABLE table_49264 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Larry LaRocco" text,
"Republican: Jim Risch" text,
"Lead Margin" real
) | Which Poll Source has a Republican Jim Risch of 43%? | SELECT "Poll Source" FROM table_49264 WHERE "Republican: Jim Risch" = '43%' | wikisql |
CREATE TABLE table_63509 (
"Total fat" text,
"Saturated fat" text,
"Monounsaturated fat" text,
"Polyunsaturated fat" text,
"Smoke point" text
) | What is the monounsaturated fat with 15g of saturated fat? | SELECT "Monounsaturated fat" FROM table_63509 WHERE "Saturated fat" = '15g' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | List of all distinct tags. | SELECT * FROM Posts WHERE Tags LIKE '%redis%' | sede |
CREATE TABLE machine (
machine_id VARCHAR,
quality_rank VARCHAR
)
CREATE TABLE technician (
Name VARCHAR,
technician_ID VARCHAR
)
CREATE TABLE repair_assignment (
machine_id VARCHAR,
technician_ID VARCHAR
) | Show names of technicians in ascending order of quality rank of the machine they are assigned. | SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank | sql_create_context |
CREATE TABLE table_name_6 (
rank INTEGER,
gold VARCHAR,
nation VARCHAR,
bronze VARCHAR,
silver VARCHAR
) | What is the average rank Finland, which has 1 bronze, more than 1 silver, and less than 0 gold, has? | SELECT AVG(rank) FROM table_name_6 WHERE bronze = 1 AND silver > 1 AND nation = "finland" AND gold < 0 | sql_create_context |
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... | provide the number of patients whose language is cape and admission location is trsf within this facility? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY" | mimicsql_data |
CREATE TABLE table_name_56 (
year VARCHAR,
band VARCHAR,
lifetime_achievement_award VARCHAR
) | In what year did Aslan receive a Lifetime Achievement Award and Snow Patrol perform? | SELECT year FROM table_name_56 WHERE band = "snow patrol" AND lifetime_achievement_award = "aslan" | sql_create_context |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | Whare the names, friends, and ages of all people who are older than the average age of a person? | SELECT DISTINCT T2.name, T2.friend, T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person) | spider |
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... | what is minimum age of patients whose marital status is married and discharge location is disch-tran to psych hosp? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" | mimicsql_data |
CREATE TABLE table_name_91 (
date VARCHAR,
winning_driver VARCHAR,
name VARCHAR
) | Tell me the date for rudolf caracciola for avusrennen | SELECT date FROM table_name_91 WHERE winning_driver = "rudolf caracciola" AND name = "avusrennen" | sql_create_context |
CREATE TABLE table_4395 (
"Year" real,
"Award" text,
"Category" text,
"Nominated Work" text,
"Result" text
) | Tell me the category for 2012 and drama league award | SELECT "Category" FROM table_4395 WHERE "Year" = '2012' AND "Award" = 'drama league award' | wikisql |
CREATE TABLE table_30955 (
"Episode" text,
"First broadcast" text,
"Andrew and Georgies guest" text,
"Jamie and Johns guest" text,
"Scores" text
) | what was the size when tom daley appeared | SELECT "Episode" FROM table_30955 WHERE "Jamie and Johns guest" = 'Tom Daley' | wikisql |
CREATE TABLE table_name_95 (
place VARCHAR,
score VARCHAR
) | What is the place of the player with a 71-69-66=206 score? | SELECT place FROM table_name_95 WHERE score = 71 - 69 - 66 = 206 | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title te... | count the number of patients who were diagnosed with sec hyperparathyrd-renal until 3 years ago and did not return to the hospital within 2 months. | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'sec hyperp... | mimic_iii |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | indicate the yearly maximum volume of chest tube output: mediastinal anterior that patient 028-39354 has had until 1335 days ago. | SELECT MAX(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 = '028-39354')) AND intakeoutput.celllabel = 'chest... | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | how much is the difference in anion gap of patient 027-85328 second measured on the current hospital visit compared to the first value measured on the current hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'anion... | eicu |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Highest Voted Comments on Questions. | SELECT c.Score, c.Text, c.Id AS "comment_link" FROM Comments AS c INNER JOIN Posts AS q ON q.Id = c.PostId WHERE q.PostTypeId = 1 GROUP BY c.Score, c.Text, c.Id ORDER BY c.Score DESC LIMIT 100 | sede |
CREATE TABLE table_73413 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. Viewers (millions)" text
) | which is the maximun serie episode number when the millions of North American spectators is 3.14? | SELECT MAX("Series no.") FROM table_73413 WHERE "U.S. Viewers (millions)" = '3.14' | wikisql |
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 l... | does the sao2 of patient 004-49903 today have been normal? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-49903')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe... | eicu |
CREATE TABLE table_261906_2 (
joined_mac INTEGER,
institution VARCHAR
) | What is the enrollment at delaware valley college? | SELECT MAX(joined_mac) FROM table_261906_2 WHERE institution = "Delaware Valley College" | sql_create_context |
CREATE TABLE table_29862 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what date was game 29? | SELECT "Date" FROM table_29862 WHERE "Game" = '29' | wikisql |
CREATE TABLE table_name_18 (
team VARCHAR,
carries VARCHAR,
week VARCHAR
) | Which Team has 19 Carries, and a Week larger than 13? | SELECT team FROM table_name_18 WHERE carries = 19 AND week > 13 | sql_create_context |
CREATE TABLE table_33137 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | For the venue of suwon world cup stadium , suwon , south korea and a Score of 3 0 what is the result? | SELECT "Result" FROM table_33137 WHERE "Venue" = 'suwon world cup stadium , suwon , south korea' AND "Score" = '3–0' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 查询13423195病患的检验报告单中结果指标均正常的检验报告单号,需要检验报告的单号 | (SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '13423195' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ... | css |
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 (
... | tell me the number of married patients who have been diagnosed with hypertensive chronic kidney disease, unspecified, with chronic kidney disease stage i through stage iv, or unspecified. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Hy kid NOS w cr kid I-IV" | mimicsql_data |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id n... | this year, what were the top three most frequent specimen tests given to patients within 2 months after being diagnosed with adv eff medicinal nos. | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_68186 (
"Season" real,
"Overall" text,
"Slalom" text,
"Giant Slalom" text,
"Super G" text,
"Downhill" text,
"Combined" text
) | What is the combined of 2 overalls and 5 slaloms? | SELECT "Combined" FROM table_68186 WHERE "Overall" = '2' AND "Slalom" = '5' | wikisql |
CREATE TABLE table_name_40 (
poles INTEGER,
f_laps VARCHAR,
series VARCHAR,
season VARCHAR
) | How many poles are there in the Formula Three Euroseries in the 2008 season with more than 0 F/Laps? | SELECT SUM(poles) FROM table_name_40 WHERE series = "formula three euroseries" AND season = "2008" AND f_laps > 0 | sql_create_context |
CREATE TABLE table_name_6 (
competition VARCHAR
) | Name the competition of 2010 of dnp | SELECT competition FROM table_name_6 WHERE 2010 = "dnp" | sql_create_context |
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
)
CREATE TABLE artists (
id number,
name text
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city t... | List the name of tracks belongs to genre Rock or media type is MPEG audio file. | SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file" | spider |
CREATE TABLE table_name_70 (
round VARCHAR,
position VARCHAR,
player VARCHAR
) | In what Round is John Parco a Center? | SELECT round FROM table_name_70 WHERE position = "center" AND player = "john parco" | sql_create_context |
CREATE TABLE table_15209 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | How many points did Corbari Italia earn in 1985? | SELECT "Points" FROM table_15209 WHERE "Entrant" = 'corbari italia' AND "Year" = '1985' | wikisql |
CREATE TABLE table_name_92 (
home_team VARCHAR,
visiting_team VARCHAR,
result VARCHAR
) | Who is the home team when the san francisco 49ers are visiting with a result of 42-14? | SELECT home_team FROM table_name_92 WHERE visiting_team = "san francisco 49ers" AND result = "42-14" | sql_create_context |
CREATE TABLE table_6963 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | What is the Home with an Away that is toronto rebels? | SELECT "Home" FROM table_6963 WHERE "Away" = 'toronto rebels' | wikisql |
CREATE TABLE table_name_2 (
number_of_seats INTEGER,
leader VARCHAR
) | How many seats does leader Raymond McCartney have? | SELECT SUM(number_of_seats) FROM table_name_2 WHERE leader = "raymond mccartney" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minu... | what flights are there from PITTSBURGH to SAN FRANCISCO on friday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = 6... | atis |
CREATE TABLE table_28802668_3 (
title VARCHAR,
no_in_season VARCHAR
) | How many episode titles does episode 19 in the season have? | SELECT COUNT(title) FROM table_28802668_3 WHERE no_in_season = 19 | sql_create_context |
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 te... | what was the total amount of the input patient 14621 had received on 06/22/2105? | SELECT SUM(inputevents_cv.amount) 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 = 14621)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2105-06-22' | mimic_iii |
CREATE TABLE table_204_329 (
id number,
"no." number,
"score" number,
"player" text,
"team" text,
"balls" number,
"inns." number,
"opposing team" text,
"date" text,
"result" text
) | what is the total number of players listed in the table ? | SELECT COUNT("player") FROM table_204_329 | squall |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE playe... | Show the draft pick numbers and draft classes of players whose positions are defenders Show bar chart, and display from high to low by the x-axis. | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC | nvbench |
CREATE TABLE table_name_31 (
position VARCHAR,
class VARCHAR
) | Which position has a sophomore class? | SELECT position FROM table_name_31 WHERE class = "sophomore" | sql_create_context |
CREATE TABLE table_name_93 (
college VARCHAR,
player VARCHAR
) | Which college does the player jon hameister-ries play for? | SELECT college FROM table_name_93 WHERE player = "jon hameister-ries" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 从2014年2月27日到2014年5月23日,列出病人60960957这期间所有检验报告单中的标本采集部位 | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '60960957' AND jybgb.BGRQ BETWEEN '2014-02-27' AND '2014-05-23' UNI... | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | how many patients have received nitroglycerin since 6 years ago within the same hospital visit after receiving anticonvulsant - gabapentin? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticonvulsant - gabapentin' AND DATETIME(treatment.treatmenttime) >= DAT... | eicu |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_name_62 (
home_team VARCHAR
) | What was Footscray's Home team score? | SELECT home_team AS score FROM table_name_62 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_15887683_5 (
n° VARCHAR,
television_service VARCHAR,
package_option VARCHAR,
content VARCHAR
) | What are the values of n for cinema content provided by Sky Cinema +24 on its Sky Cinema package? | SELECT n° FROM table_15887683_5 WHERE package_option = "Sky Cinema" AND content = "cinema" AND television_service = "Sky Cinema" + 24 | sql_create_context |
CREATE TABLE table_name_3 (
score VARCHAR,
away_team VARCHAR
) | What was the score of the game against away team crewe alexandra? | SELECT score FROM table_name_3 WHERE away_team = "crewe alexandra" | sql_create_context |
CREATE TABLE table_11959669_7 (
location_attendance VARCHAR,
date VARCHAR
) | How many numbers were listed under attendance for March 2? | SELECT COUNT(location_attendance) FROM table_11959669_7 WHERE date = "March 2" | sql_create_context |
CREATE TABLE table_name_58 (
candidate_name VARCHAR,
target_approach VARCHAR
) | What is Candidate Name, when Target/Approach is 'vaccine to amyloid-beta'? | SELECT candidate_name FROM table_name_58 WHERE target_approach = "vaccine to amyloid-beta" | sql_create_context |
CREATE TABLE table_name_52 (
result VARCHAR,
date VARCHAR
) | What was the end result for 28 February 2001? | SELECT result FROM table_name_52 WHERE date = "28 february 2001" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_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 procedures_icd (
row_id number,
su... | list patient ids of patients diagnosed with hypothermia the previous year. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypothermia') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DAT... | mimic_iii |
CREATE TABLE table_65746 (
"Sunrayia FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the draws when there are less than 3 losses and more than 16 wins? | SELECT MAX("Draws") FROM table_65746 WHERE "Losses" < '3' AND "Wins" > '16' | wikisql |
CREATE TABLE table_name_3 (
notes VARCHAR,
film VARCHAR
) | What notes does the film Touch & go have? | SELECT notes FROM table_name_3 WHERE film = "touch & go" | sql_create_context |
CREATE TABLE table_23686 (
"English party name" text,
"Norwegian party name" text,
"Associated ideology" text,
"Current leader" text,
"International affiliation" text,
"2013 Parliamentary election" text,
"County councils ( 2011 )" real
) | What percent of the parliamentary election did the pensioners party receive | SELECT "2013 Parliamentary election" FROM table_23686 WHERE "English party name" = 'Pensioners Party' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 韦浩岚这个病人被门诊诊断为混合性焦虑障碍,他做的三碘甲状腺原氨酸的结果定量及其单位分别是啥 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_name_13 (
play_by_play VARCHAR,
studio_host VARCHAR,
colour_commentator_s_ VARCHAR
) | Who did the play-by-play with studio host Ward Cornell and color commentator Bob Goldham? | SELECT play_by_play FROM table_name_13 WHERE studio_host = "ward cornell" AND colour_commentator_s_ = "bob goldham" | sql_create_context |
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_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE date_day (
... | i would like to fly to BALTIMORE | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND flight.to_airport = airport_service.airport_code | atis |
CREATE TABLE table_4740 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance at the St Kilda home game? | SELECT AVG("Crowd") FROM table_4740 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_name_56 (
total_finals INTEGER,
runners_up VARCHAR,
winners VARCHAR
) | What is the highest total number of finals a club with more than 2 runners-up and fewer than 1 winner went to? | SELECT MAX(total_finals) FROM table_name_56 WHERE runners_up > 2 AND winners < 1 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.