schema
stringlengths
29
5.42k
question
stringlengths
0
752
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
8.94k
weight
float64
0
8.73
CREATE TABLE table_36427 ("NTFA Div 1" CLOB, "Wins" FLOAT, "Byes" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
What is the total number of byes associated with fewer than 8 wins and fewer than 1 draw?
SELECT COUNT("Byes") FROM table_36427 WHERE "Draws" < '1' AND "Wins" < '8'
SELECT COUNT("Byes") FROM "table_36427" WHERE "Draws" < '1' AND "Wins" < '8'
0.074219
CREATE TABLE table_name_47 (player VARCHAR2, hometown VARCHAR2)
Who is from flower mound, tx?
SELECT player FROM table_name_47 WHERE hometown = "flower mound, tx"
SELECT "player" FROM "table_name_47" WHERE "flower mound, tx" = "hometown"
0.072266
CREATE TABLE table_48095 ("Player" CLOB, "Country" CLOB, "Year ( s ) won" CLOB, "Total" FLOAT, "To par" CLOB, "Finish" CLOB)
Bernhard Langer maximum total was what?
SELECT MAX("Total") FROM table_48095 WHERE "Player" = 'bernhard langer'
SELECT MAX("Total") FROM "table_48095" WHERE "Player" = 'bernhard langer'
0.071289
CREATE TABLE table_204_679 (id NUMBER, "place" CLOB, "player" CLOB, "country" CLOB, "score" CLOB, "to par" NUMBER, "money ( $ ) " NUMBER)
who had the same score as bulla ?
SELECT "player" FROM table_204_679 WHERE "player" <> 'johnny bulla' AND "score" = (SELECT "score" FROM table_204_679 WHERE "player" = 'johnny bulla')
SELECT "player" FROM "table_204_679" WHERE "player" <> 'johnny bulla' AND "score" = (SELECT "score" FROM "table_204_679" WHERE "player" = 'johnny bulla')
0.149414
CREATE TABLE table_63691 ("Rank" FLOAT, "Lane" FLOAT, "Name" CLOB, "Nationality" CLOB, "React" FLOAT, "Time" FLOAT)
What is the average react of bryan barnett, who has a lane less than 2?
SELECT AVG("React") FROM table_63691 WHERE "Name" = 'bryan barnett' AND "Lane" < '2'
SELECT AVG("React") FROM "table_63691" WHERE "Lane" < '2' AND "Name" = 'bryan barnett'
0.083984
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
tell me the number of patients on main drug type prescription who were diagnosed with cardiac complications, not elsewhere classified.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Surg compl-heart" AND prescriptions.drug_type = "MAIN"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Surg compl-heart" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "MAIN" = "prescriptions"."drug_type" AND "demographic"."hadm_id" = "prescriptions"."hadm_id"
0.296875
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
what is the age and ethnicity of the patient id 2560?
SELECT demographic.age, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "2560"
SELECT "demographic"."age", "demographic"."ethnicity" FROM "demographic" WHERE "2560" = "demographic"."subject_id"
0.111328
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
find the number of female patients who had 24 hour creatinine lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "24 hr Creatinine"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "24 hr Creatinine" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "F" = "demographic"."gender"
0.193359
CREATE TABLE College (cName VARCHAR2, state VARCHAR2, enr NUMBER) CREATE TABLE Tryout (pID NUMBER, cName VARCHAR2, pPos VARCHAR2, decision VARCHAR2) CREATE TABLE Player (pID NUMBER, pName VARCHAR2, yCard VARCHAR2, HS NUMBER)
Return a bar chart on how many students participated in tryouts for each college by descennding count?
SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC
SELECT "cName", COUNT(*) FROM "Tryout" GROUP BY "cName" ORDER BY COUNT(*) DESC
0.076172
CREATE TABLE table_20991 ("Year" FLOAT, "Starts" FLOAT, "Wins" FLOAT, "Top 5" FLOAT, "Top 10" FLOAT, "Poles" FLOAT, "Avg. Start" CLOB, "Avg. Finish" CLOB, "Winnings" CLOB, "Position" CLOB, "Team ( s ) " CLOB)
Name the max top 5 for 5.0 avg finish
SELECT MAX("Top 5") FROM table_20991 WHERE "Avg. Finish" = '5.0'
SELECT MAX("Top 5") FROM "table_20991" WHERE "Avg. Finish" = '5.0'
0.064453
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
posts tagged 'pejorative' by day of week.
SELECT TIME_TO_STR(CreationDate, '%W'), COUNT(P.Id) FROM Posts AS P JOIN PostTags AS PT ON P.Id = PT.PostId JOIN Tags AS T ON PT.TagId = T.Id GROUP BY TIME_TO_STR(CreationDate, '%W') ORDER BY TIME_TO_STR(CreationDate, '%W')
SELECT TO_CHAR("CreationDate", 'WW'), COUNT("P"."Id") FROM "Posts" "P" JOIN "PostTags" "PT" ON "P"."Id" = "PT"."PostId" JOIN "Tags" "T" ON "PT"."TagId" = "T"."Id" GROUP BY TO_CHAR("CreationDate", 'WW') ORDER BY TO_CHAR("CreationDate", 'WW')
0.234375
CREATE TABLE table_30657 ("Couple" CLOB, "Style" CLOB, "Music" CLOB, "Trine Dehli Cleve" FLOAT, "Tor Fl\\u00f8ysvik" FLOAT, "Karianne Gulliksen" FLOAT, "Christer Tornell" FLOAT, "Total" FLOAT)
What is listed in tor floysvik when karianne gulliksen is 6?
SELECT MIN("Tor Fl\u00f8ysvik") FROM table_30657 WHERE "Karianne Gulliksen" = '6'
SELECT MIN("Tor Fl\u00f8ysvik") FROM "table_30657" WHERE "Karianne Gulliksen" = '6'
0.081055
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 CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
what are the five most commonly prescribed medications for patients that were also prescribed with benicar at the same time since 4 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'benicar' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5
WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate") >= DATETIME(CURRENT_TIME(), '-4 year')), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND DATETIME("prescriptions"."startdate") = DATETIME("t2"."startdate") WHERE "prescriptions"."drug" = 'benicar' AND DATETIME("prescriptions"."startdate") >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" "t3" WHERE "t3"."c1" <= 5
0.765625
CREATE TABLE table_63826 ("Rank" FLOAT, "Lane" FLOAT, "Athlete" CLOB, "Nationality" CLOB, "Time" FLOAT, "React" FLOAT)
Which Reaction has a Rank smaller than 4, and a Nationality of trinidad and tobago, and a Time larger than 45.13?
SELECT AVG("React") FROM table_63826 WHERE "Rank" < '4' AND "Nationality" = 'trinidad and tobago' AND "Time" > '45.13'
SELECT AVG("React") FROM "table_63826" WHERE "Nationality" = 'trinidad and tobago' AND "Rank" < '4' AND "Time" > '45.13'
0.117188
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
what were the top three diagnoses most frequently diagnosed since 6 years ago?
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 DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 3)
WITH "t1" AS (SELECT "diagnoses_icd"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnoses_icd" WHERE DATETIME("diagnoses_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY "diagnoses_icd"."icd9_code"), "_u_0" AS (SELECT "t1"."icd9_code" FROM "t1" "t1" WHERE "t1"."c1" <= 3 GROUP BY "icd9_code") SELECT "d_icd_diagnoses"."short_title" FROM "d_icd_diagnoses" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "d_icd_diagnoses"."icd9_code" WHERE NOT "_u_0"."" IS NULL
0.483398
CREATE TABLE table_name_1 (name VARCHAR2, roll VARCHAR2, years VARCHAR2)
Which name has a Roll larger than 297, and Years of 7 13?
SELECT name FROM table_name_1 WHERE roll > 297 AND years = "7–13"
SELECT "name" FROM "table_name_1" WHERE "7–13" = "years" AND "roll" > 297
0.071289
CREATE TABLE table_name_99 (league VARCHAR2, open_cup VARCHAR2, year VARCHAR2)
Which League that has a Open Cup of 1st round, and a Year of 2009?
SELECT league FROM table_name_99 WHERE open_cup = "1st round" AND year = 2009
SELECT "league" FROM "table_name_99" WHERE "1st round" = "open_cup" AND "year" = 2009
0.083008
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) 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 patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
what is the maximum cost of the hospital which involves respiratory acidosis since 1 year ago?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'respiratory acidosis')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY cost.patienthealthsystemstayid) AS t1
WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'respiratory acidosis' GROUP BY "patientunitstayid"), "_u_1" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patienthealthsystemstayid"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."patienthealthsystemstayid" WHERE DATETIME("cost"."chargetime") >= DATETIME(CURRENT_TIME(), '-1 year') AND NOT "_u_1"."" IS NULL GROUP BY "cost"."patienthealthsystemstayid") SELECT MAX("t1"."c1") FROM "t1" "t1"
0.664063
CREATE TABLE table_19481 ("Pick #" FLOAT, "NFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
What college did the defensive back attend?
SELECT "College" FROM table_19481 WHERE "Position" = 'Defensive Back'
SELECT "College" FROM "table_19481" WHERE "Position" = 'Defensive Back'
0.069336
CREATE TABLE player_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes CLOB) CREATE TABLE player (player_id CLOB, birth_year CLOB, birth_month CLOB, birth_day CLOB, birth_country CLOB, birth_state CLOB, birth_city CLOB, death_year CLOB, death_month CLOB, death_day CLOB, death_country CLOB, death_state CLOB, death_city CLOB, name_first CLOB, name_last CLOB, name_given CLOB, weight CLOB) CREATE TABLE hall_of_fame (player_id CLOB, yearid NUMBER, votedby CLOB, ballots CLOB, needed CLOB, votes CLOB, inducted CLOB, category CLOB, needed_note CLOB) CREATE TABLE salary (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, salary NUMBER) CREATE TABLE player_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first CLOB)
Top 10 countries with the most hall of fame players
SELECT T1.birth_country FROM player AS T1 JOIN hall_of_fame AS T2 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" GROUP BY T1.birth_country ORDER BY COUNT(*) DESC LIMIT 10
SELECT "T1"."birth_country" FROM "player" "T1" JOIN "hall_of_fame" "T2" ON "T1"."player_id" = "T2"."player_id" AND "T2"."inducted" = "Y" GROUP BY "T1"."birth_country" ORDER BY COUNT(*) DESC FETCH FIRST 10 ROWS ONLY
0.208984
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
show me the flights from DALLAS to BALTIMORE at economy level
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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND fare_basis.economy = 'YES' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DALLAS' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "flight_fare" ON "flight"."flight_id" = "flight_fare"."flight_id" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'BALTIMORE' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id" JOIN "fare_basis" ON "fare"."fare_basis_code" = "fare_basis"."fare_basis_code" AND "fare_basis"."economy" = 'YES'
0.720703
CREATE TABLE table_name_5 (outcome VARCHAR2, tournament VARCHAR2)
What the Outcome for the Tournament of Johannesburg, South Africa
SELECT outcome FROM table_name_5 WHERE tournament = "johannesburg, south africa"
SELECT "outcome" FROM "table_name_5" WHERE "johannesburg, south africa" = "tournament"
0.083984
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT) CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
For those records from the products and each product's manufacturer, find name and the average of manufacturer , and group by attribute name, and visualize them by a bar chart, and I want to order in desc by the y axis please.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
SELECT "T2"."Name", "T1"."Manufacturer" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T2"."Name" ORDER BY "T1"."Manufacturer" DESC
0.173828
CREATE TABLE table_7490 ("Place" FLOAT, "Team" CLOB, "Played" FLOAT, "Draw" FLOAT, "Lost" FLOAT, "Goals Scored" FLOAT, "Goals Conceded" FLOAT, "Points" FLOAT)
What is the mean played number where the goals conceded is less than 16?
SELECT AVG("Played") FROM table_7490 WHERE "Goals Conceded" < '16'
SELECT AVG("Played") FROM "table_7490" WHERE "Goals Conceded" < '16'
0.066406
CREATE TABLE table_27862483_3 (overall_record VARCHAR2, win VARCHAR2)
What was the overall record in the game won by D. Klein (2-0)?
SELECT overall_record FROM table_27862483_3 WHERE win = "D. Klein (2-0)"
SELECT "overall_record" FROM "table_27862483_3" WHERE "D. Klein (2-0)" = "win"
0.076172
CREATE TABLE table_name_51 (election VARCHAR2)
which 1st Member has a Election of 1832
SELECT 1 AS st_member FROM table_name_51 WHERE election = "1832"
SELECT 1 AS "st_member" FROM "table_name_51" WHERE "1832" = "election"
0.068359
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
how many patients during this year were prescribed nicardipine hcl iv?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'nicardipine hcl iv' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
WITH "_u_0" AS (SELECT "prescriptions"."hadm_id" FROM "prescriptions" WHERE "prescriptions"."drug" = 'nicardipine hcl iv' AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "hadm_id") SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "admissions"."hadm_id" WHERE NOT "_u_0"."" IS NULL
0.402344
CREATE TABLE body_builder (body_builder_id NUMBER, people_id NUMBER, snatch NUMBER, clean_jerk NUMBER, total NUMBER) CREATE TABLE people (people_id NUMBER, name CLOB, height NUMBER, weight NUMBER, birth_date CLOB, birth_place CLOB)
What is the average snatch score of body builders?
SELECT AVG(snatch) FROM body_builder
SELECT AVG("snatch") FROM "body_builder"
0.039063
CREATE TABLE table_name_28 (name VARCHAR2, street_address VARCHAR2)
What is the Name of the Building at 100 North Tampa Street?
SELECT name FROM table_name_28 WHERE street_address = "100 north tampa street"
SELECT "name" FROM "table_name_28" WHERE "100 north tampa street" = "street_address"
0.082031
CREATE TABLE teaches (ID VARCHAR2, course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER) CREATE TABLE student (ID VARCHAR2, name VARCHAR2, dept_name VARCHAR2, tot_cred NUMBER) CREATE TABLE section (course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER, building VARCHAR2, room_number VARCHAR2, time_slot_id VARCHAR2) CREATE TABLE time_slot (time_slot_id VARCHAR2, day VARCHAR2, start_hr NUMBER, start_min NUMBER, end_hr NUMBER, end_min NUMBER) CREATE TABLE advisor (s_ID VARCHAR2, i_ID VARCHAR2) CREATE TABLE takes (ID VARCHAR2, course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER, grade VARCHAR2) CREATE TABLE classroom (building VARCHAR2, room_number VARCHAR2, capacity NUMBER) CREATE TABLE instructor (ID VARCHAR2, name VARCHAR2, dept_name VARCHAR2, salary NUMBER) CREATE TABLE prereq (course_id VARCHAR2, prereq_id VARCHAR2) CREATE TABLE department (dept_name VARCHAR2, building VARCHAR2, budget NUMBER) CREATE TABLE course (course_id VARCHAR2, title VARCHAR2, dept_name VARCHAR2, credits NUMBER)
Find the total credits of courses provided by different department Plot them as bar chart, could you sort in ascending by the x-axis?
SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY dept_name
SELECT "dept_name", SUM("credits") FROM "course" GROUP BY "dept_name" ORDER BY "dept_name"
0.087891
CREATE TABLE track (track_id NUMBER, name CLOB, location CLOB, seating NUMBER, year_opened NUMBER) CREATE TABLE race (race_id NUMBER, name CLOB, class CLOB, date CLOB, track_id CLOB)
Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
SELECT location FROM track WHERE seating > 90000 INTERSECT SELECT location FROM track WHERE seating < 70000
SELECT "location" FROM "track" WHERE "seating" > 90000 INTERSECT SELECT "location" FROM "track" WHERE "seating" < 70000
0.116211
CREATE TABLE table_8535 ("Discipline" CLOB, "Championship" CLOB, "Circuit" CLOB, "Event" CLOB, "Session" CLOB, "Cause" CLOB)
With a Championship of 1959 USAC Championship Car Season what is the event?
SELECT "Event" FROM table_8535 WHERE "Championship" = '1959 usac championship car season'
SELECT "Event" FROM "table_8535" WHERE "Championship" = '1959 usac championship car season'
0.088867
CREATE TABLE wrestler (Name VARCHAR2, Days_held NUMBER)
What are the names of wrestlers days held less than 100?
SELECT Name FROM wrestler WHERE Days_held < 100
SELECT "Name" FROM "wrestler" WHERE "Days_held" < 100
0.051758
CREATE TABLE table_name_95 (february VARCHAR2, game VARCHAR2, opponent VARCHAR2)
How much February has a Game larger than 37, and an Opponent of chicago black hawks?
SELECT COUNT(february) FROM table_name_95 WHERE game > 37 AND opponent = "chicago black hawks"
SELECT COUNT("february") FROM "table_name_95" WHERE "chicago black hawks" = "opponent" AND "game" > 37
0.099609
CREATE TABLE table_train_199 ("id" NUMBER, "t2dm" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "renal_disease" BOOLEAN, "diabetic" CLOB, "hypoglycemia" BOOLEAN, "diabetes" BOOLEAN, "seizure_disorder" BOOLEAN, "glaucoma" BOOLEAN, "hypertension" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
patients with renal disease not caused by diabetes or hypertension.
SELECT * FROM table_train_199 WHERE renal_disease = 1 AND (diabetes = 0 AND hypertension = 0)
SELECT * FROM "table_train_199" WHERE "diabetes" = 0 AND "hypertension" = 0 AND "renal_disease" = 1
0.09668
CREATE TABLE table_13758945_3 (points_against VARCHAR2, tries_for VARCHAR2)
how many points against with tries for being 43
SELECT COUNT(points_against) FROM table_13758945_3 WHERE tries_for = "43"
SELECT COUNT("points_against") FROM "table_13758945_3" WHERE "43" = "tries_for"
0.077148
CREATE TABLE table_203_355 (id NUMBER, "year" NUMBER, "total" NUMBER, "romanians" CLOB, "hungarians" CLOB, "roma" CLOB)
what is the number of times the total population was 6,000 or more ?
SELECT COUNT(*) FROM table_203_355 WHERE "total" >= 6000
SELECT COUNT(*) FROM "table_203_355" WHERE "total" >= 6000
0.056641
CREATE TABLE table_6324 ("Year" FLOAT, "Chassis" CLOB, "Engine" CLOB, "Start" CLOB, "Finish" CLOB, "Team" CLOB)
What is the name of the team with a finish of 19?
SELECT "Team" FROM table_6324 WHERE "Finish" = '19'
SELECT "Team" FROM "table_6324" WHERE "Finish" = '19'
0.051758
CREATE TABLE table_16942 ("Date" CLOB, "Tournament" CLOB, "Location" CLOB, "Purse ( $ ) " FLOAT, "Winner" CLOB, "Score" CLOB, "1st Prize ( $ ) " FLOAT)
what's the tournament where winner is raymond floyd (1)
SELECT "Tournament" FROM table_16942 WHERE "Winner" = 'Raymond Floyd (1)'
SELECT "Tournament" FROM "table_16942" WHERE "Winner" = 'Raymond Floyd (1)'
0.073242
CREATE TABLE table_34915 ("Country" CLOB, "Skip" CLOB, "Third" CLOB, "Second" CLOB, "Lead" CLOB)
Which Lead has a Third of jeanne ellegaard?
SELECT "Lead" FROM table_34915 WHERE "Third" = 'jeanne ellegaard'
SELECT "Lead" FROM "table_34915" WHERE "Third" = 'jeanne ellegaard'
0.06543
CREATE TABLE table_55561 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
What is the home teamscore for Richmond?
SELECT "Home team score" FROM table_55561 WHERE "Home team" = 'richmond'
SELECT "Home team score" FROM "table_55561" WHERE "Home team" = 'richmond'
0.072266
CREATE TABLE table_18277 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
What is the party for District Georgia 9?
SELECT "Party" FROM table_18277 WHERE "District" = 'Georgia 9'
SELECT "Party" FROM "table_18277" WHERE "District" = 'Georgia 9'
0.0625
CREATE TABLE table_name_49 (record VARCHAR2, home VARCHAR2, date VARCHAR2)
Which Record has a Home of Montreal Canadiens and a Date of April 22?
SELECT record FROM table_name_49 WHERE home = "montreal canadiens" AND date = "april 22"
SELECT "record" FROM "table_name_49" WHERE "april 22" = "date" AND "home" = "montreal canadiens"
0.09375
CREATE TABLE table_48816 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
Who had the high assists in the game against Memphis?
SELECT "High assists" FROM table_48816 WHERE "Team" = 'memphis'
SELECT "High assists" FROM "table_48816" WHERE "Team" = 'memphis'
0.063477
CREATE TABLE table_237036_2 (luma_samples_s VARCHAR2, level VARCHAR2)
What are the luma samples at level 1.3?
SELECT luma_samples_s FROM table_237036_2 WHERE level = "1.3"
SELECT "luma_samples_s" FROM "table_237036_2" WHERE "1.3" = "level"
0.06543
CREATE TABLE table_36081 ("Name" CLOB, "Species Specific" CLOB, "Intra-molecular structure" CLOB, "Comparative" CLOB, "Link" CLOB)
Which Comparative has a Name of pictar?
SELECT "Comparative" FROM table_36081 WHERE "Name" = 'pictar'
SELECT "Comparative" FROM "table_36081" WHERE "Name" = 'pictar'
0.061523
CREATE TABLE table_37547 ("Date" CLOB, "Venue" CLOB, "Score" CLOB, "Result" CLOB, "Competition" CLOB)
When was the 2014 fifa world cup qualification?
SELECT "Date" FROM table_37547 WHERE "Competition" = '2014 fifa world cup qualification'
SELECT "Date" FROM "table_37547" WHERE "Competition" = '2014 fifa world cup qualification'
0.087891
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
calculate the length of patient 025-51835's stay for the first hospital stay.
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '025-51835' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
SELECT STRFTIME('%j', "patient"."hospitaldischargetime") - STRFTIME('%j', "patient"."hospitaladmittime") FROM "patient" WHERE "patient"."uniquepid" = '025-51835' AND NOT "patient"."hospitaladmittime" IS NULL ORDER BY "patient"."hospitaladmittime" FETCH FIRST 1 ROWS ONLY
0.263672
CREATE TABLE table_name_47 (crowd NUMBER, home_team VARCHAR2)
What was the smallest crowd size for a home game for Richmond?
SELECT MIN(crowd) FROM table_name_47 WHERE home_team = "richmond"
SELECT MIN("crowd") FROM "table_name_47" WHERE "home_team" = "richmond"
0.069336
CREATE TABLE table_54166 ("Player" CLOB, "No. ( s ) " CLOB, "Height in Ft." CLOB, "Position" CLOB, "Years for Rockets" CLOB, "School/Club Team/Country" CLOB)
What player had a school of missouri
SELECT "Player" FROM table_54166 WHERE "School/Club Team/Country" = 'missouri'
SELECT "Player" FROM "table_54166" WHERE "School/Club Team/Country" = 'missouri'
0.078125
CREATE TABLE table_204_548 (id NUMBER, "team" CLOB, "basic elements" NUMBER, "tumbling" NUMBER, "stunts" NUMBER, "tosses" NUMBER, "pyramids" NUMBER, "deductions" NUMBER, "total score" NUMBER, "result" CLOB)
what was the number of deductions given to all the teams combined ?
SELECT SUM("deductions") FROM table_204_548
SELECT SUM("deductions") FROM "table_204_548"
0.043945
CREATE TABLE table_name_81 (venue VARCHAR2, goal VARCHAR2)
Which venue has a Goal of 3?
SELECT venue FROM table_name_81 WHERE goal = 3
SELECT "venue" FROM "table_name_81" WHERE "goal" = 3
0.050781
CREATE TABLE table_name_52 (rank VARCHAR2, actor_actress VARCHAR2)
What is Jolene Anderson's Rank?
SELECT rank FROM table_name_52 WHERE actor_actress = "jolene anderson"
SELECT "rank" FROM "table_name_52" WHERE "actor_actress" = "jolene anderson"
0.074219
CREATE TABLE table_name_8 (catalog VARCHAR2, format VARCHAR2, date VARCHAR2)
What Catalog released on June 29, 1999 has a Digipak Album Format?
SELECT catalog FROM table_name_8 WHERE format = "digipak album" AND date = "june 29, 1999"
SELECT "catalog" FROM "table_name_8" WHERE "date" = "june 29, 1999" AND "digipak album" = "format"
0.095703
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
find the drug name of drug code nalo4i.
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NALO4I"
SELECT "prescriptions"."drug" FROM "prescriptions" WHERE "NALO4I" = "prescriptions"."formulary_drug_cd"
0.100586
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
What is the total number of patients admitted before the year 2166 who had a lab test for absolute cd4 count?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2166" AND lab.label = "Absolute CD4 Count"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Absolute CD4 Count" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2166" > "demographic"."admityear"
0.201172
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
for patient jerry deberry, specify the type and location of admission
SELECT demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
SELECT "demographic"."admission_type", "demographic"."admission_location" FROM "demographic" WHERE "Jerry Deberry" = "demographic"."name"
0.133789
CREATE TABLE table_2260452_1 (average_speed__mph_ VARCHAR2, race_time VARCHAR2)
If the race time is 2:00:33, what is the average speed?
SELECT average_speed__mph_ FROM table_2260452_1 WHERE race_time = "2:00:33"
SELECT "average_speed__mph_" FROM "table_2260452_1" WHERE "2:00:33" = "race_time"
0.079102
CREATE TABLE table_55906 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
Who was the Away team that played at Carlton on 11 June 1966?
SELECT "Away team" FROM table_55906 WHERE "Date" = '11 june 1966' AND "Home team" = 'carlton'
SELECT "Away team" FROM "table_55906" WHERE "Date" = '11 june 1966' AND "Home team" = 'carlton'
0.092773
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
how many days have elapsed since patient 15794's last pco2 lab test on the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'pco2' GROUP BY "itemid"), "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 15794 GROUP BY "hadm_id") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "labevents"."charttime")) FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY
0.599609
CREATE TABLE neighborhood (id NUMBER, business_id VARCHAR2, neighborhood_name VARCHAR2) CREATE TABLE review (rid NUMBER, business_id VARCHAR2, user_id VARCHAR2, rating FLOAT, text TEXT, year NUMBER, month VARCHAR2) CREATE TABLE user (uid NUMBER, user_id VARCHAR2, name VARCHAR2) CREATE TABLE business (bid NUMBER, business_id VARCHAR2, name VARCHAR2, full_address VARCHAR2, city VARCHAR2, latitude VARCHAR2, longitude VARCHAR2, review_count NUMBER, is_open NUMBER, rating FLOAT, state VARCHAR2) CREATE TABLE category (id NUMBER, business_id VARCHAR2, category_name VARCHAR2) CREATE TABLE tip (tip_id NUMBER, business_id VARCHAR2, text TEXT, user_id VARCHAR2, likes NUMBER, year NUMBER, month VARCHAR2) CREATE TABLE checkin (cid NUMBER, business_id VARCHAR2, count NUMBER, day VARCHAR2)
How many tips have been written in 2015
SELECT COUNT(DISTINCT (text)) FROM tip WHERE year = 2015
SELECT COUNT(DISTINCT "text") FROM "tip" WHERE "year" = 2015
0.058594
CREATE TABLE table_26787 ("Contestant" CLOB, "Starting Weight ( kg ) " CLOB, "Final Weight ( kg ) " CLOB, "Weight Lost ( kg ) " CLOB, "Percentage Lost" CLOB, "Position ( out of Eliminated Contestants ) " CLOB)
Who is every contestant for the position of 4th?
SELECT "Contestant" FROM table_26787 WHERE "Position (out of Eliminated Contestants)" = '4th'
SELECT "Contestant" FROM "table_26787" WHERE "Position (out of Eliminated Contestants)" = '4th'
0.092773
CREATE TABLE table_name_43 (date VARCHAR2, record VARCHAR2)
When were the Brewers 27-31?
SELECT date FROM table_name_43 WHERE record = "27-31"
SELECT "date" FROM "table_name_43" WHERE "27-31" = "record"
0.057617
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
Find the lab test and lab test fluid of Shawn Green.
SELECT lab.label, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Shawn Green"
SELECT "lab"."label", "lab"."fluid" FROM "demographic" JOIN "lab" ON "demographic"."hadm_id" = "lab"."hadm_id" WHERE "Shawn Green" = "demographic"."name"
0.149414
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
Next Winter , who are the professors for the PreMajor classes available ?
SELECT DISTINCT instructor.name 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 INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE program_course.category LIKE '%PreMajor%' AND semester.semester = 'Winter' AND semester.year = 2017
SELECT DISTINCT "instructor"."name" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "program_course" ON "course_offering"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%PreMajor%' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Winter' AND "semester"."year" = 2017 JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id"
0.581055
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
provide the number of patients whose age is less than 56 and drug name is insulin human regular?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.drug = "Insulin Human Regular"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Insulin Human Regular" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "56" > "demographic"."age"
0.224609
CREATE TABLE appellations (no NUMBER, appelation CLOB, county CLOB, state CLOB, area CLOB, isava CLOB) CREATE TABLE grapes (id NUMBER, grape CLOB, color CLOB) CREATE TABLE wine (no NUMBER, grape CLOB, winery CLOB, appelation CLOB, state CLOB, name CLOB, year NUMBER, price NUMBER, score NUMBER, cases NUMBER, drink CLOB)
What are the distinct names of wines that have appellations in the North Coast area?
SELECT DISTINCT T2.name FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T1.area = "North Coast"
SELECT DISTINCT "T2"."name" FROM "appellations" "T1" JOIN "wine" "T2" ON "T1"."appelation" = "T2"."appelation" WHERE "North Coast" = "T1"."area"
0.140625
CREATE TABLE table_69287 ("D 41" CLOB, "D 42" CLOB, "D 43" CLOB, "D 44" CLOB, "D 45" CLOB, "D 46" CLOB, "D 47" CLOB, "D 48" CLOB)
What is the D44 when D43 is R 14?
SELECT "D 44" FROM table_69287 WHERE "D 43" = 'r 14'
SELECT "D 44" FROM "table_69287" WHERE "D 43" = 'r 14'
0.052734
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) 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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
have there been any microbiological other tests for patient 031-3355?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '031-3355' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) FROM "microlab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "microlab"."patientunitstayid" WHERE "microlab"."culturesite" = 'other' AND NOT "_u_1"."" IS NULL
0.509766
CREATE TABLE table_name_69 (date VARCHAR2, score VARCHAR2)
On what date was the score 6 4, 7 5?
SELECT date FROM table_name_69 WHERE score = "6–4, 7–5"
SELECT "date" FROM "table_name_69" WHERE "6–4, 7–5" = "score"
0.05957
CREATE TABLE table_203_365 (id NUMBER, "released" CLOB, "video title" CLOB, "company" CLOB, "director" CLOB, "notes" CLOB)
did shoko goto make more films in 2004 or 2005 ?
SELECT "released" FROM table_203_365 WHERE "released" IN (2004, 2005) GROUP BY "released" ORDER BY COUNT("video title") DESC LIMIT 1
SELECT "released" FROM "table_203_365" WHERE "released" IN (2004, 2005) GROUP BY "released" ORDER BY COUNT("video title") DESC FETCH FIRST 1 ROWS ONLY
0.146484
CREATE TABLE table_18323 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
When was the first elected for district missouri 7?
SELECT MIN("First elected") FROM table_18323 WHERE "District" = 'Missouri 7'
SELECT MIN("First elected") FROM "table_18323" WHERE "District" = 'Missouri 7'
0.076172
CREATE TABLE table_203_491 (id NUMBER, "year" NUMBER, "title" CLOB, "us hot 100" NUMBER, "us modern rock" NUMBER, "us mainstream rock" NUMBER, "album" CLOB)
what is the last song listed on the table ?
SELECT "title" FROM table_203_491 ORDER BY id DESC LIMIT 1
SELECT "title" FROM "table_203_491" ORDER BY "id" DESC FETCH FIRST 1 ROWS ONLY
0.076172
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
is patient 021-69410's phosphate second measured on the first hospital visit less than first measured on the first 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 = '021-69410' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AND lab.labname = 'phosphate' ORDER BY lab.labresulttime LIMIT 1 OFFSET 1) < (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 = '021-69410' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AND lab.labname = 'phosphate' ORDER BY lab.labresulttime LIMIT 1)
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '021-69410' AND NOT "patient"."hospitaldischargetime" IS NULL GROUP BY "patienthealthsystemstayid" ORDER BY "patient"."hospitaladmittime" FETCH FIRST 1 ROWS ONLY), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT "lab"."labresult" FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'phosphate' AND NOT "_u_1"."" IS NULL ORDER BY "lab"."labresulttime" OFFSET 1 ROWS FETCH FIRST 1 ROWS ONLY) < (SELECT "lab"."labresult" FROM "lab" LEFT JOIN "_u_4" "_u_4" ON "_u_4"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'phosphate' AND NOT "_u_4"."" IS NULL ORDER BY "lab"."labresulttime" FETCH FIRST 1 ROWS ONLY)
1.102539
CREATE TABLE table_name_10 (elevator VARCHAR2, elector VARCHAR2)
What is listed for the Elevator that has the Elector of Gerardo?
SELECT elevator FROM table_name_10 WHERE elector = "gerardo"
SELECT "elevator" FROM "table_name_10" WHERE "elector" = "gerardo"
0.064453
CREATE TABLE table_name_20 (attendance VARCHAR2, score VARCHAR2)
What is the total attendance at games with a score of 4-2?
SELECT COUNT(attendance) FROM table_name_20 WHERE score = "4-2"
SELECT COUNT("attendance") FROM "table_name_20" WHERE "4-2" = "score"
0.067383
CREATE TABLE table_55951 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
Where was South Melbourne played?
SELECT "Venue" FROM table_55951 WHERE "Home team" = 'south melbourne'
SELECT "Venue" FROM "table_55951" WHERE "Home team" = 'south melbourne'
0.069336
CREATE TABLE table_19469 ("Team" CLOB, "# appearances" FLOAT, "years ( won in bold ) " CLOB, "# wins" FLOAT, "# runner-up" FLOAT, "Most recent final" CLOB)
What is the number of runner-up results for the years (won in bold) 1984, 2010?
SELECT MAX("# runner-up") FROM table_19469 WHERE "years (won in bold)" = '1984, 2010'
SELECT MAX("# runner-up") FROM "table_19469" WHERE "years (won in bold)" = '1984, 2010'
0.084961
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
(EXAMPLE #1) Time to First Answer (no link to question).
SELECT q.Id AS "question_id", q.CreationDate AS "question_date", MIN(a.CreationDate) AS "1st_answer_date", DATEDIFF(n, q.CreationDate, MIN(a.CreationDate)) AS "min_to_1st_answer" FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND (a.PostTypeId = 2 OR a.PostTypeId IS NULL) AND q.DeletionDate IS NULL AND a.DeletionDate IS NULL AND q.ClosedDate IS NULL AND a.ClosedDate IS NULL AND q.CreationDate >= DATEADD(d, -'##daysBack:int?10##', GETDATE()) GROUP BY q.Id, q.CreationDate ORDER BY q.Id
SELECT "q"."Id" AS "question_id", "q"."CreationDate" AS "question_date", MIN("a"."CreationDate") AS "1st_answer_date", DATEDIFF(CAST("n" AS DATETIME), CAST("q"."CreationDate" AS DATETIME), MIN("a"."CreationDate")) AS "min_to_1st_answer" FROM "Posts" "q" LEFT JOIN "Posts" "a" ON "a"."ParentId" = "q"."Id" WHERE "a"."ClosedDate" IS NULL AND "a"."DeletionDate" IS NULL AND ("a"."PostTypeId" = 2 OR "a"."PostTypeId" IS NULL) AND "q"."ClosedDate" IS NULL AND "q"."CreationDate" >= DATEADD("d", -'##daysBack:int?10##', GETDATE()) AND "q"."DeletionDate" IS NULL AND "q"."PostTypeId" = 1 GROUP BY "q"."Id", "q"."CreationDate" ORDER BY "q"."Id"
0.621094
CREATE TABLE table_42916 ("m\\u00e5cha" CLOB, "indicative" CLOB, "imperative" CLOB, "subjunctive" CLOB, "inverse subjunctive" CLOB)
The indicative of si m chan has what as the inverse subjunctive?
SELECT "inverse subjunctive" FROM table_42916 WHERE "indicative" = 'si måchan'
SELECT "inverse subjunctive" FROM "table_42916" WHERE "indicative" = 'si måchan'
0.078125
CREATE TABLE table_204_570 (id NUMBER, "rank" NUMBER, "mountain" CLOB, "height ( m ) " NUMBER, "height ( ft ) " NUMBER, "range" CLOB, "coordinates" CLOB, "prominence ( m ) " NUMBER, "parent mountain" CLOB, "first ascent" NUMBER, "ascents ( failed attempts ) bef.2004" CLOB)
which mountain has a larger height , lhotse or makalu ?
SELECT "mountain" FROM table_204_570 WHERE "mountain" IN ('lhotse', 'makalu') ORDER BY "height (m)" DESC LIMIT 1
SELECT "mountain" FROM "table_204_570" WHERE "mountain" IN ('lhotse', 'makalu') ORDER BY "height (m)" DESC FETCH FIRST 1 ROWS ONLY
0.126953
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 CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
did patient 61527 get a prescription for docusate sodium, potassium chloride, or spironolactone in a year before?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 61527 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_0"."" IS NULL
0.450195
CREATE TABLE Activity (actid NUMBER, activity_name VARCHAR2) CREATE TABLE Participates_in (stuid NUMBER, actid NUMBER) CREATE TABLE Student (StuID NUMBER, LName VARCHAR2, Fname VARCHAR2, Age NUMBER, Sex VARCHAR2, Major NUMBER, Advisor NUMBER, city_code VARCHAR2) CREATE TABLE Faculty_Participates_in (FacID NUMBER, actid NUMBER) CREATE TABLE Faculty (FacID NUMBER, Lname VARCHAR2, Fname VARCHAR2, Rank VARCHAR2, Sex VARCHAR2, Phone NUMBER, Room VARCHAR2, Building VARCHAR2)
A bar chart showing the number of male and female faculty, display in descending by the Sex.
SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY Sex DESC
SELECT "Sex", COUNT(*) FROM "Faculty" GROUP BY "Sex" ORDER BY "Sex" DESC
0.070313
CREATE TABLE table_203_489 (id NUMBER, "year" NUMBER, "title" CLOB, "system" CLOB, "developer" CLOB, "publisher" CLOB)
how many ghostbusters games were released in 1990 ?
SELECT COUNT("title") FROM table_203_489 WHERE "year" = 1990
SELECT COUNT("title") FROM "table_203_489" WHERE "year" = 1990
0.060547
CREATE TABLE status (station_id NUMBER, bikes_available NUMBER, docks_available NUMBER, time CLOB) CREATE TABLE trip (id NUMBER, duration NUMBER, start_date CLOB, start_station_name CLOB, start_station_id NUMBER, end_date CLOB, end_station_name CLOB, end_station_id NUMBER, bike_id NUMBER, subscription_type CLOB, zip_code NUMBER) CREATE TABLE weather (date CLOB, max_temperature_f NUMBER, mean_temperature_f NUMBER, min_temperature_f NUMBER, max_dew_point_f NUMBER, mean_dew_point_f NUMBER, min_dew_point_f NUMBER, max_humidity NUMBER, mean_humidity NUMBER, min_humidity NUMBER, max_sea_level_pressure_inches NUMBER, mean_sea_level_pressure_inches NUMBER, min_sea_level_pressure_inches NUMBER, max_visibility_miles NUMBER, mean_visibility_miles NUMBER, min_visibility_miles NUMBER, max_wind_Speed_mph NUMBER, mean_wind_speed_mph NUMBER, max_gust_speed_mph NUMBER, precipitation_inches NUMBER, cloud_cover NUMBER, events CLOB, wind_dir_degrees NUMBER, zip_code NUMBER) CREATE TABLE station (id NUMBER, name CLOB, lat NUMBER, long NUMBER, dock_count NUMBER, city CLOB, installation_date CLOB)
Bar chart x axis date y axis the number of date, could you display by the total number from high to low?
SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC
SELECT "date", COUNT("date") FROM "weather" ORDER BY COUNT("date") DESC
0.069336
CREATE TABLE table_41784 ("Year" FLOAT, "Country" CLOB, "Team" CLOB, "Individual" CLOB, "Location" CLOB)
What is the Team when the match was in buenos aires , argentina?
SELECT "Team" FROM table_41784 WHERE "Location" = 'buenos aires , argentina'
SELECT "Team" FROM "table_41784" WHERE "Location" = 'buenos aires , argentina'
0.076172
CREATE TABLE table_204_717 (id NUMBER, "season" CLOB, "level" NUMBER, "division" CLOB, "place" CLOB)
which season was the only season to come in 18th ?
SELECT "season" FROM table_204_717 WHERE "place" = 18
SELECT "season" FROM "table_204_717" WHERE "place" = 18
0.053711
CREATE TABLE table_78079 ("Airing date" CLOB, "Number of episodes" FLOAT, "HD format" CLOB, "Highest average point ratings" FLOAT, "Genre" CLOB, "Official website" CLOB)
What was the airing date when the number of episodes was larger than 20 and had the genre of costume action?
SELECT "Airing date" FROM table_78079 WHERE "Number of episodes" > '20' AND "Genre" = 'costume action'
SELECT "Airing date" FROM "table_78079" WHERE "Genre" = 'costume action' AND "Number of episodes" > '20'
0.101563
CREATE TABLE table_27291 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
Name the district for spencer bachus
SELECT "District" FROM table_27291 WHERE "Incumbent" = 'Spencer Bachus'
SELECT "District" FROM "table_27291" WHERE "Incumbent" = 'Spencer Bachus'
0.071289
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) 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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
did patient 004-28929 excreted any urine until 11/01/2103?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-28929')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2103-11-01'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '004-28929' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'urine' AND "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m-%d', "intakeoutput"."intakeoutputtime") <= '2103-11-01'
0.643555
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER) CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
How long has the HBEHED 900 course been offered for ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HBEHED' AND course.number = 900 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
SELECT DISTINCT "semester"."year" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" WHERE "course"."department" = 'HBEHED' AND "course"."number" = 900 ORDER BY "semester"."year" FETCH FIRST 1 ROWS ONLY
0.311523
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, 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, value NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
had patient 30763 until 1 year ago been diagnosed with delirium d/t other cond?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'delirium d/t other cond') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30763) AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')
WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 30763 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'delirium d/t other cond' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE DATETIME("diagnoses_icd"."charttime") <= DATETIME(CURRENT_TIME(), '-1 year') AND NOT "_u_1"."" IS NULL
0.476563
CREATE TABLE table_42028 ("Rank" FLOAT, "Mark" FLOAT, "Athlete" CLOB, "Place" CLOB, "Date" CLOB)
What is the lowest mark of the rank 8 record?
SELECT MIN("Mark") FROM table_42028 WHERE "Rank" = '8'
SELECT MIN("Mark") FROM "table_42028" WHERE "Rank" = '8'
0.054688
CREATE TABLE table_12146068_2 (gt1_winning_team VARCHAR2, rnd VARCHAR2)
What is the number of gt1 winning team for rnd 5?
SELECT COUNT(gt1_winning_team) FROM table_12146068_2 WHERE rnd = 5
SELECT COUNT("gt1_winning_team") FROM "table_12146068_2" WHERE "rnd" = 5
0.070313
CREATE TABLE table_name_15 (player VARCHAR2, to_par VARCHAR2, score VARCHAR2)
Which player has a to par of e and a score of 67-73=140?
SELECT player FROM table_name_15 WHERE to_par = "e" AND score = 67 - 73 = 140
SELECT "player" FROM "table_name_15" WHERE "e" = "to_par" AND "score" = FALSE
0.075195
CREATE TABLE table_14350 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" FLOAT, "To par" CLOB)
What did billy andrade to par?
SELECT "To par" FROM table_14350 WHERE "Player" = 'billy andrade'
SELECT "To par" FROM "table_14350" WHERE "Player" = 'billy andrade'
0.06543
CREATE TABLE table_19401346_1 (title VARCHAR2, production_code VARCHAR2)
What's the title of the episode with production code 10018?
SELECT title FROM table_19401346_1 WHERE production_code = 10018
SELECT "title" FROM "table_19401346_1" WHERE "production_code" = 10018
0.068359
CREATE TABLE table_70167 ("Year" FLOAT, "Team" CLOB, "Chassis" CLOB, "Engine" CLOB, "Points" FLOAT)
What is the average Points for a year before 1955?
SELECT AVG("Points") FROM table_70167 WHERE "Year" < '1955'
SELECT AVG("Points") FROM "table_70167" WHERE "Year" < '1955'
0.05957
CREATE TABLE table_name_75 (time VARCHAR2, team VARCHAR2, rider VARCHAR2)
What was the time for Peter Berwick of Team Suzuki?
SELECT time FROM table_name_75 WHERE team = "suzuki" AND rider = "peter berwick"
SELECT "time" FROM "table_name_75" WHERE "peter berwick" = "rider" AND "suzuki" = "team"
0.085938
CREATE TABLE table_61545 ("Round" FLOAT, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "College/junior/club team ( league ) " CLOB)
What is the Position, when Player is 'Magnus Nygren'?
SELECT "Position" FROM table_61545 WHERE "Player" = 'magnus nygren'
SELECT "Position" FROM "table_61545" WHERE "Player" = 'magnus nygren'
0.067383