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_37173 ("Club" CLOB, "Played" CLOB, "Drawn" CLOB, "Lost" CLOB, "Points for" CLOB, "Points against" CLOB, "Tries for" CLOB, "Tries against" CLOB, "Try bonus" CLOB, "Losing bonus" CLOB, "Points" CLOB)
| What points have 1 for drawn, and 16 as a try bonus? | SELECT "Points for" FROM table_37173 WHERE "Drawn" = '1' AND "Try bonus" = '16' | SELECT "Points for" FROM "table_37173" WHERE "Drawn" = '1' AND "Try bonus" = '16' | 0.079102 |
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)
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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime 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 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)
| how many times has patient 035-2205 visited the intensive care unit since 2104? | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205') AND STRFTIME('%y', patient.unitadmittime) >= '2104' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '035-2205' GROUP BY "patienthealthsystemstayid") SELECT COUNT(DISTINCT "patient"."patientunitstayid") FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "patient"."unitadmittime") >= '2104' | 0.374023 |
CREATE TABLE table_name_67 (reg_season VARCHAR2, avg_attendance NUMBER)
| What regular season result had an average attendance bigger than 3,170? | SELECT reg_season FROM table_name_67 WHERE avg_attendance > 3 OFFSET 170 | SELECT "reg_season" FROM "table_name_67" WHERE "avg_attendance" > 3 OFFSET 170 ROWS | 0.081055 |
CREATE TABLE table_10609 ("Week" CLOB, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Channel" CLOB, "Attendance" CLOB)
| What was the attendance on week 12? | SELECT "Attendance" FROM table_10609 WHERE "Week" = '12' | SELECT "Attendance" FROM "table_10609" WHERE "Week" = '12' | 0.056641 |
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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
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 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)
| how many hours have passed since patient 018-20179 had last received a procedure on the current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '018-20179' 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "treatment"."treatmenttime")) FROM "treatment" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL ORDER BY "treatment"."treatmenttime" DESC FETCH FIRST 1 ROWS ONLY | 0.657227 |
CREATE TABLE table_name_74 (connection_with_australia VARCHAR2, connection_with_america VARCHAR2)
| What is the connection with Australia when the connection with America shows born in the u.s.; mother is u.s. citizen? | SELECT connection_with_australia FROM table_name_74 WHERE connection_with_america = "born in the u.s.; mother is u.s. citizen" | SELECT "connection_with_australia" FROM "table_name_74" WHERE "born in the u.s.; mother is u.s. citizen" = "connection_with_america" | 0.128906 |
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, visualize a scatter chart about the correlation between manufacturer and revenue , and group by attribute name. | SELECT T1.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | SELECT "T1"."Manufacturer", "T2"."Revenue" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Name" | 0.138672 |
CREATE TABLE table_name_96 (crowd NUMBER, venue VARCHAR2)
| Which game at Arden Street Oval had the lowest attendance? | SELECT MIN(crowd) FROM table_name_96 WHERE venue = "arden street oval" | SELECT MIN("crowd") FROM "table_name_96" WHERE "arden street oval" = "venue" | 0.074219 |
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
| Find All_Home and Team_ID , and group by attribute ACC_Home, and visualize them by a bar chart, and list in desc by the y-axis. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID DESC | SELECT "All_Home", "Team_ID" FROM "basketball_match" GROUP BY "ACC_Home", "All_Home" ORDER BY "Team_ID" DESC | 0.105469 |
CREATE TABLE table_67553 ("Player" CLOB, "Country" CLOB, "Year ( s ) won" CLOB, "Total" FLOAT, "To par" FLOAT)
| What was Mark Brooks total score when he finished more than 2 above par? | SELECT AVG("Total") FROM table_67553 WHERE "To par" > '2' AND "Player" = 'mark brooks' | SELECT AVG("Total") FROM "table_67553" WHERE "Player" = 'mark brooks' AND "To par" > '2' | 0.085938 |
CREATE TABLE table_30313 ("Year Location" CLOB, "Mens Singles" CLOB, "Womens Singles" CLOB, "Mens Doubles" CLOB, "Womens Doubles" CLOB)
| Where was the tour when jing junhong li jiawei played womens doubles? | SELECT "Year Location" FROM table_30313 WHERE "Womens Doubles" = 'Jing Junhong Li Jiawei' | SELECT "Year Location" FROM "table_30313" WHERE "Womens Doubles" = 'Jing Junhong Li Jiawei' | 0.088867 |
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
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 PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
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 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 FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId 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 Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name 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 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 ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
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 PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
| Number of users which made their last post in a given month (only users with at least 10 posts). | WITH last_cte AS (SELECT OwnerUserId, MAX(Id) AS MaxId, COUNT(Id) AS num FROM Posts GROUP BY OwnerUserId), dates_cte AS (SELECT p.OwnerUserId AS odn, p.Id AS pid, p.CreationDate AS CDate FROM Posts AS p INNER JOIN last_cte AS l ON p.Id = maxid WHERE l.num >= '##min?10##') SELECT LAST_DATE_OF_MONTH(CDate), COUNT(odn) FROM dates_cte GROUP BY LAST_DATE_OF_MONTH(CDate) ORDER BY LAST_DATE_OF_MONTH(CDate) | WITH "last_cte" AS (SELECT COUNT("Id") AS "num" FROM "Posts" GROUP BY "OwnerUserId") SELECT LAST_DATE_OF_MONTH("CDate"), COUNT("odn") FROM "Posts" "p" JOIN "last_cte" "l" ON "l"."num" >= '##min?10##' AND "maxid" = "p"."Id" GROUP BY LAST_DATE_OF_MONTH("CDate") ORDER BY LAST_DATE_OF_MONTH("CDate") | 0.289063 |
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE medication (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 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 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 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 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)
| had a peep lab test patient 017-13959 received since 06/2104? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-13959')) AND lab.labname = 'peep' AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-06' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '017-13959' 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 "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'peep' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "lab"."labresulttime") >= '2104-06' | 0.551758 |
CREATE TABLE table_12962773_16 (player VARCHAR2, year_born VARCHAR2)
| What player was born in 1983? | SELECT player FROM table_12962773_16 WHERE year_born = 1983 | SELECT "player" FROM "table_12962773_16" WHERE "year_born" = 1983 | 0.063477 |
CREATE TABLE table_13781 ("Team 1" CLOB, "Agg." CLOB, "Team 2" CLOB, "1st leg" CLOB, "2nd leg" CLOB)
| What is the 2nd leg when Ermis Aradippou is the first team? | SELECT "2nd leg" FROM table_13781 WHERE "Team 1" = 'ermis aradippou' | SELECT "2nd leg" FROM "table_13781" WHERE "Team 1" = 'ermis aradippou' | 0.068359 |
CREATE TABLE table_name_67 (nominated_work VARCHAR2, category VARCHAR2, year VARCHAR2)
| Which nominated work is in the category of best performance by a leading actress in a play earlier than 2007? | SELECT nominated_work FROM table_name_67 WHERE category = "best performance by a leading actress in a play" AND year < 2007 | SELECT "nominated_work" FROM "table_name_67" WHERE "best performance by a leading actress in a play" = "category" AND "year" < 2007 | 0.12793 |
CREATE TABLE table_78902 ("Name" CLOB, "Pos." CLOB, "Height" CLOB, "Weight" CLOB, "Date of Birth" CLOB, "Club" CLOB)
| What is the weight of the entry that has a date of birth of 1981-11-21? | SELECT "Weight" FROM table_78902 WHERE "Date of Birth" = '1981-11-21' | SELECT "Weight" FROM "table_78902" WHERE "Date of Birth" = '1981-11-21' | 0.069336 |
CREATE TABLE table_name_70 (novelty VARCHAR2, location VARCHAR2, name VARCHAR2)
| What novelty has USA as the location, and coryloides as the name? | SELECT novelty FROM table_name_70 WHERE location = "usa" AND name = "coryloides" | SELECT "novelty" FROM "table_name_70" WHERE "coryloides" = "name" AND "location" = "usa" | 0.085938 |
CREATE TABLE table_name_23 (partner VARCHAR2, edition VARCHAR2)
| Who was partner for the 1988 world group i edition? | SELECT partner FROM table_name_23 WHERE edition = "1988 world group i" | SELECT "partner" FROM "table_name_23" WHERE "1988 world group i" = "edition" | 0.074219 |
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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 diagnoses_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 procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
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 chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
| when was patient 3929's arterial bp mean the last time measured greater than 73.0 on this month/23? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND chartevents.valuenum > 73.0 AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', chartevents.charttime) = '23' ORDER BY chartevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 3929 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp mean' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT "chartevents"."charttime" FROM "chartevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE "chartevents"."valuenum" > 73.0 AND DATETIME("chartevents"."charttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%d', "chartevents"."charttime") = '23' ORDER BY "chartevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY | 0.928711 |
CREATE TABLE table_203_497 (id NUMBER, "rank" NUMBER, "nation" CLOB, "gold" NUMBER, "silver" NUMBER, "bronze" NUMBER, "total" NUMBER)
| who has won the most bronze medals ? | SELECT "nation" FROM table_203_497 ORDER BY "bronze" DESC LIMIT 1 | SELECT "nation" FROM "table_203_497" ORDER BY "bronze" DESC FETCH FIRST 1 ROWS ONLY | 0.081055 |
CREATE TABLE Problems (problem_id NUMBER, product_id NUMBER, closure_authorised_by_staff_id NUMBER, reported_by_staff_id NUMBER, date_problem_reported DATETIME, date_problem_closed DATETIME, problem_description VARCHAR2, other_problem_details VARCHAR2)
CREATE TABLE Product (product_id NUMBER, product_name VARCHAR2, product_details VARCHAR2)
CREATE TABLE Problem_Category_Codes (problem_category_code VARCHAR2, problem_category_description VARCHAR2)
CREATE TABLE Problem_Status_Codes (problem_status_code VARCHAR2, problem_status_description VARCHAR2)
CREATE TABLE Problem_Log (problem_log_id NUMBER, assigned_to_staff_id NUMBER, problem_id NUMBER, problem_category_code VARCHAR2, problem_status_code VARCHAR2, log_entry_date DATETIME, log_entry_description VARCHAR2, log_entry_fix VARCHAR2, other_log_details VARCHAR2)
CREATE TABLE Staff (staff_id NUMBER, staff_first_name VARCHAR2, staff_last_name VARCHAR2, other_staff_details VARCHAR2)
| Bar chart x axis log entry description y axis the number of log entry description | SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description | SELECT "log_entry_description", COUNT("log_entry_description") FROM "Problem_Log" GROUP BY "log_entry_description" | 0.111328 |
CREATE TABLE table_41140 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" FLOAT)
| When was the last time, since December 14, 1986, that the attendance was lower than 47,096? | SELECT MAX("Week") FROM table_41140 WHERE "Date" = 'december 14, 1986' AND "Attendance" < '47,096' | SELECT MAX("Week") FROM "table_41140" WHERE "Attendance" < '47,096' AND "Date" = 'december 14, 1986' | 0.097656 |
CREATE TABLE table_32908 ("Date" CLOB, "Venue" CLOB, "Opposition" CLOB, "Att." FLOAT, "Result" CLOB, "Goals" FLOAT)
| Which date had less than 3 goals and a result of (w) 2-0? | SELECT "Date" FROM table_32908 WHERE "Goals" < '3' AND "Result" = '(w) 2-0' | SELECT "Date" FROM "table_32908" WHERE "Goals" < '3' AND "Result" = '(w) 2-0' | 0.075195 |
CREATE TABLE table_70453 ("Year" FLOAT, "Chassis" CLOB, "Engine" CLOB, "Tyres" CLOB, "Points" FLOAT)
| Name the sum of points for 1992 | SELECT SUM("Points") FROM table_70453 WHERE "Year" = '1992' | SELECT SUM("Points") FROM "table_70453" WHERE "Year" = '1992' | 0.05957 |
CREATE TABLE table_25241 ("Year" CLOB, "Date" CLOB, "Driver" CLOB, "Team" CLOB, "Manufacturer" CLOB, "Laps" CLOB, "Miles ( km ) " CLOB, "Race Time" CLOB, "Average Speed ( mph ) " CLOB, "Report" CLOB)
| What driver achieved a 3:50:12 race time? | SELECT "Driver" FROM table_25241 WHERE "Race Time" = '3:50:12' | SELECT "Driver" FROM "table_25241" WHERE "Race Time" = '3:50:12' | 0.0625 |
CREATE TABLE table_name_80 (swimming VARCHAR2, tennis VARCHAR2, indoor_track VARCHAR2, soccer VARCHAR2)
| What is th eswimming status for the school that has yes on indoor track, soccer and tennis? | SELECT swimming FROM table_name_80 WHERE indoor_track = "yes" AND soccer = "yes" AND tennis = "yes" | SELECT "swimming" FROM "table_name_80" WHERE "indoor_track" = "yes" AND "soccer" = "yes" AND "tennis" = "yes" | 0.106445 |
CREATE TABLE table_24819 ("Condition" CLOB, "Prothrombin time" CLOB, "Partial thromboplastin time" CLOB, "Bleeding time" CLOB, "Platelet count" CLOB)
| What is the result for partial thromboplastin time when prothrombin time and bleeding time are prolonged? | SELECT "Partial thromboplastin time" FROM table_24819 WHERE "Prothrombin time" = 'Prolonged' AND "Bleeding time" = 'Prolonged' | SELECT "Partial thromboplastin time" FROM "table_24819" WHERE "Bleeding time" = 'Prolonged' AND "Prothrombin time" = 'Prolonged' | 0.125 |
CREATE TABLE table_294 ("Player" CLOB, "Position" CLOB, "School" CLOB, "Hometown" CLOB, "MLB Draft" CLOB)
| What school did the catcher attend? | SELECT "School" FROM table_294 WHERE "Position" = 'Catcher' | SELECT "School" FROM "table_294" WHERE "Position" = 'Catcher' | 0.05957 |
CREATE TABLE table_53567 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| What was the attendance when the VFL played Arden Street Oval? | SELECT COUNT("Crowd") FROM table_53567 WHERE "Venue" = 'arden street oval' | SELECT COUNT("Crowd") FROM "table_53567" WHERE "Venue" = 'arden street oval' | 0.074219 |
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| count the number of patients who have had a enteral pivot 1.5cal intake. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'enteral pivot 1.5cal' AND intakeoutput.cellpath LIKE '%input%') | WITH "_u_0" AS (SELECT "intakeoutput"."patientunitstayid" FROM "intakeoutput" WHERE "intakeoutput"."celllabel" = 'enteral pivot 1.5cal' AND "intakeoutput"."cellpath" LIKE '%input%' GROUP BY "patientunitstayid") SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL | 0.358398 |
CREATE TABLE table_name_48 (highest_finish VARCHAR2, most_recent_finish VARCHAR2)
| What is the Highest finish with a Most recent finish that was 2nd? | SELECT highest_finish FROM table_name_48 WHERE most_recent_finish = "2nd" | SELECT "highest_finish" FROM "table_name_48" WHERE "2nd" = "most_recent_finish" | 0.077148 |
CREATE TABLE table_name_10 (method VARCHAR2, record VARCHAR2, round VARCHAR2, res VARCHAR2)
| What method did Mikhail Ilyukhin win the fight in round 1 when his record was 13-5? | SELECT method FROM table_name_10 WHERE round = "1" AND res = "win" AND record = "13-5" | SELECT "method" FROM "table_name_10" WHERE "1" = "round" AND "13-5" = "record" AND "res" = "win" | 0.09375 |
CREATE TABLE diagnoses (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 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 lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| what is maximum age of patients whose marital status is widowed and age is greater than or equal to 47? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "47" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "47" <= "demographic"."age" AND "WIDOWED" = "demographic"."marital_status" | 0.12793 |
CREATE TABLE procedures_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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_diagnoses (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_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom 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 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)
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 chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom 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)
| did patient 94229 come into an er during this hospital encounter? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 94229 AND admissions.admission_location = 'emergency room admit' AND admissions.dischtime IS NULL | SELECT COUNT(*) > 0 FROM "admissions" WHERE "admissions"."admission_location" = 'emergency room admit' AND "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 94229 | 0.172852 |
CREATE TABLE table_train_165 ("id" NUMBER, "gender" CLOB, "hemoglobin_a1c_hba1c" FLOAT, "visual_impairment" BOOLEAN, "blood_glucose" NUMBER, "body_mass_index_bmi" FLOAT, "a1c" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
| must have a bmi equal to or greater than 30 | SELECT * FROM table_train_165 WHERE body_mass_index_bmi >= 30 | SELECT * FROM "table_train_165" WHERE "body_mass_index_bmi" >= 30 | 0.063477 |
CREATE TABLE table_18382 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
| What is the highest year that a candidate was first elected? | SELECT MAX("First elected") FROM table_18382 | SELECT MAX("First elected") FROM "table_18382" | 0.044922 |
CREATE TABLE table_58302 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
| Which entry has the highest laps of those with constructor Minardi - Fondmetal, driver Marc Gen , and a grid larger than 20? | SELECT MAX("Laps") FROM table_58302 WHERE "Constructor" = 'minardi - fondmetal' AND "Driver" = 'marc gené' AND "Grid" > '20' | SELECT MAX("Laps") FROM "table_58302" WHERE "Constructor" = 'minardi - fondmetal' AND "Driver" = 'marc gené' AND "Grid" > '20' | 0.123047 |
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime 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 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 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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
| tell me the total 8 hr total fluid removed output that patient 030-28944 has had on this month/26? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-28944')) AND intakeoutput.celllabel = '8 hr total fluid removed' AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '26' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '030-28944' 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 SUM("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = '8 hr total fluid removed' AND "intakeoutput"."cellpath" LIKE '%output%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL AND STRFTIME('%d', "intakeoutput"."intakeoutputtime") = '26' | 0.792969 |
CREATE TABLE table_name_79 (enrollment VARCHAR2, ihsaa_class VARCHAR2, mascot VARCHAR2)
| How much Enrollment has an IHSAA Class of aaaaa, and a Mascot of spartans? | SELECT COUNT(enrollment) FROM table_name_79 WHERE ihsaa_class = "aaaaa" AND mascot = "spartans" | SELECT COUNT("enrollment") FROM "table_name_79" WHERE "aaaaa" = "ihsaa_class" AND "mascot" = "spartans" | 0.100586 |
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime 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 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 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 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
| what are the top four most common procedures that were followed in the same month for patients who had received vasopressors in 2105? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors' AND STRFTIME('%y', treatment.treatmenttime) = '2105') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', treatment.treatmenttime) = '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.treatmenttime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "treatment"."treatmentname", "treatment"."treatmenttime" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE STRFTIME('%y', "treatment"."treatmenttime") = '2105'), "t3" AS (SELECT "t2"."treatmentname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."treatmenttime" > "treatment"."treatmenttime" AND DATETIME("t2"."treatmenttime", 'start of month') = DATETIME("treatment"."treatmenttime", 'start of month') WHERE "treatment"."treatmentname" = 'vasopressors' AND STRFTIME('%y', "treatment"."treatmenttime") = '2105' GROUP BY "t2"."treatmentname") SELECT "t3"."treatmentname" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.855469 |
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
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 d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE diagnoses_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 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 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 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 procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 d_icd_diagnoses (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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
| when did patient 77987 receive venous cath nec the first time a year before? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77987) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY procedures_icd.charttime LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 77987 GROUP BY "hadm_id") SELECT "procedures_icd"."charttime" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'venous cath nec' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL ORDER BY "procedures_icd"."charttime" FETCH FIRST 1 ROWS ONLY | 0.583984 |
CREATE TABLE table_79559 ("Date" CLOB, "Location" CLOB, "Lineup" CLOB, "Assist/pass" CLOB, "Score" CLOB, "Result" CLOB, "Competition" CLOB)
| which Score has a Competition of match reports? | SELECT "Score" FROM table_79559 WHERE "Competition" = 'match reports' | SELECT "Score" FROM "table_79559" WHERE "Competition" = 'match reports' | 0.069336 |
CREATE TABLE table_name_93 (city VARCHAR2, expected_completion VARCHAR2)
| Which city expects their project completion in 2017? | SELECT city FROM table_name_93 WHERE expected_completion = "2017" | SELECT "city" FROM "table_name_93" WHERE "2017" = "expected_completion" | 0.069336 |
CREATE TABLE table_name_91 (nation VARCHAR2, bronze VARCHAR2)
| Which nation had 3 bronze? | SELECT nation FROM table_name_91 WHERE bronze = 3 | SELECT "nation" FROM "table_name_91" WHERE "bronze" = 3 | 0.053711 |
CREATE TABLE table_66616 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" FLOAT)
| What is the total attendance before week 1? | SELECT SUM("Attendance") FROM table_66616 WHERE "Week" < '1' | SELECT SUM("Attendance") FROM "table_66616" WHERE "Week" < '1' | 0.060547 |
CREATE TABLE Course_Authors_and_Tutors (author_id NUMBER, author_tutor_ATB VARCHAR2, login_name VARCHAR2, password VARCHAR2, personal_name VARCHAR2, middle_name VARCHAR2, family_name VARCHAR2, gender_mf VARCHAR2, address_line_1 VARCHAR2)
CREATE TABLE Subjects (subject_id NUMBER, subject_name VARCHAR2)
CREATE TABLE Courses (course_id NUMBER, author_id NUMBER, subject_id NUMBER, course_name VARCHAR2, course_description VARCHAR2)
CREATE TABLE Student_Course_Enrolment (registration_id NUMBER, student_id NUMBER, course_id NUMBER, date_of_enrolment DATETIME, date_of_completion DATETIME)
CREATE TABLE Students (student_id NUMBER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR2, password VARCHAR2, personal_name VARCHAR2, middle_name VARCHAR2, family_name VARCHAR2)
CREATE TABLE Student_Tests_Taken (registration_id NUMBER, date_test_taken DATETIME, test_result VARCHAR2)
| How many completion students in each month? Return a bar chart binning date of completion by month interval. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment | SELECT "date_of_completion", COUNT("date_of_completion") FROM "Student_Course_Enrolment" | 0.085938 |
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 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 flight_fare (flight_id NUMBER, fare_id 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 days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
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)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
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 (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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare 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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
| what are the flights from DALLAS to SAN FRANCISCO on tuesday 10 1 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 10 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code 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 "date_day" ON "date_day"."day_number" = 1 AND "date_day"."month_number" = 10 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DALLAS' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'SAN FRANCISCO' | 0.698242 |
CREATE TABLE Settlements (Settlement_ID NUMBER, Claim_ID NUMBER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed NUMBER, Amount_Settled NUMBER, Customer_Policy_ID NUMBER)
CREATE TABLE Claims (Claim_ID NUMBER, Policy_ID NUMBER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed NUMBER, Amount_Settled NUMBER)
CREATE TABLE Payments (Payment_ID NUMBER, Settlement_ID NUMBER, Payment_Method_Code VARCHAR2, Date_Payment_Made DATE, Amount_Payment NUMBER)
CREATE TABLE Customers (Customer_ID NUMBER, Customer_Details VARCHAR2)
CREATE TABLE Customer_Policies (Policy_ID NUMBER, Customer_ID NUMBER, Policy_Type_Code CHAR, Start_Date DATE, End_Date DATE)
| For those payments processed with Visa, bin the payment day into Year interval and compute the total amount payment as the Y-axis, and sort by the y axis in descending please. | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment) DESC | SELECT "Date_Payment_Made", SUM("Amount_Payment") FROM "Payments" WHERE "Payment_Method_Code" = 'Visa' ORDER BY SUM("Amount_Payment") DESC | 0.134766 |
CREATE TABLE table_14460937_2 (pos NUMBER, clubs VARCHAR2)
| what is the minimum pos with clubs being 16 | SELECT MIN(pos) FROM table_14460937_2 WHERE clubs = "16" | SELECT MIN("pos") FROM "table_14460937_2" WHERE "16" = "clubs" | 0.060547 |
CREATE TABLE table_42819 ("Date" CLOB, "Home captain" CLOB, "Away captain" CLOB, "Venue" CLOB, "Result" CLOB)
| What was the result of the game that was played on 29,30 31 May 1902? | SELECT "Result" FROM table_42819 WHERE "Date" = '29,30–31 may 1902' | SELECT "Result" FROM "table_42819" WHERE "Date" = '29,30–31 may 1902' | 0.067383 |
CREATE TABLE table_name_41 (poll_source VARCHAR2, date VARCHAR2, republican VARCHAR2, democrat VARCHAR2, margin_of_error VARCHAR2)
| Where is the poll source when Hillary clinton was the democrat, john mccain was the republican, and the margin of error was less than 4.5 on May 2-7, 2007? | SELECT poll_source FROM table_name_41 WHERE democrat = "hillary clinton" AND margin_of_error < 4.5 AND republican = "john mccain" AND date = "may 2-7, 2007" | SELECT "poll_source" FROM "table_name_41" WHERE "date" = "may 2-7, 2007" AND "democrat" = "hillary clinton" AND "john mccain" = "republican" AND "margin_of_error" < 4.5 | 0.164063 |
CREATE TABLE table_65436 ("Rank" CLOB, "Nation" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| what is the least silver when gold is 0? | SELECT MIN("Silver") FROM table_65436 WHERE "Gold" < '0' | SELECT MIN("Silver") FROM "table_65436" WHERE "Gold" < '0' | 0.056641 |
CREATE TABLE table_48510 ("Year" FLOAT, "Award" CLOB, "Nominated Work" CLOB, "Category" CLOB, "Result" CLOB)
| What is Award, when Category is Cabello Maluco? | SELECT "Award" FROM table_48510 WHERE "Category" = 'cabello maluco' | SELECT "Award" FROM "table_48510" WHERE "Category" = 'cabello maluco' | 0.067383 |
CREATE TABLE table_name_18 (win_percentage NUMBER, losses VARCHAR2)
| What is the highest win percentage when there were 23 losses? | SELECT MAX(win_percentage) FROM table_name_18 WHERE losses = 23 | SELECT MAX("win_percentage") FROM "table_name_18" WHERE "losses" = 23 | 0.067383 |
CREATE TABLE table_66053 ("Year" FLOAT, "Category" CLOB, "Film" CLOB, "Result" CLOB, "Lost to" CLOB)
| Who was the loss to for the film Chicago? | SELECT "Lost to" FROM table_66053 WHERE "Film" = 'chicago' | SELECT "Lost to" FROM "table_66053" WHERE "Film" = 'chicago' | 0.058594 |
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 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age 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 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 d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what are the total number of open liver biopsy procedures performed? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open liver biopsy') | SELECT COUNT(*) FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'open liver biopsy' | 0.180664 |
CREATE TABLE table_53494 ("Year" FLOAT, "Western champion" CLOB, "Result" CLOB, "Eastern champion" CLOB, "Finals MVP" CLOB)
| What is the result from 2013? | SELECT "Result" FROM table_53494 WHERE "Year" = '2013' | SELECT "Result" FROM "table_53494" WHERE "Year" = '2013' | 0.054688 |
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 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 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)
| what is days of hospital stay and primary disease of subject id 8323? | SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "8323" | SELECT "demographic"."days_stay", "demographic"."diagnosis" FROM "demographic" WHERE "8323" = "demographic"."subject_id" | 0.117188 |
CREATE TABLE table_64762 ("Rank" FLOAT, "Rower" CLOB, "Country" CLOB, "Time" CLOB, "Notes" CLOB)
| What is the Rank of the rower with a Time of 8:23.02? | SELECT COUNT("Rank") FROM table_64762 WHERE "Time" = '8:23.02' | SELECT COUNT("Rank") FROM "table_64762" WHERE "Time" = '8:23.02' | 0.0625 |
CREATE TABLE table_45494 ("Company name" CLOB, "Network brand name" CLOB, "Country" CLOB, "Accreditation type" CLOB, "Accreditation level" CLOB, "Date" CLOB)
| What is Deutsche Telekom's accreditation type? | SELECT "Accreditation type" FROM table_45494 WHERE "Network brand name" = 'deutsche telekom' | SELECT "Accreditation type" FROM "table_45494" WHERE "Network brand name" = 'deutsche telekom' | 0.091797 |
CREATE TABLE table_7912 ("Team 1" CLOB, "Score" CLOB, "Team 2" CLOB, "1st round" CLOB, "2nd round" CLOB)
| what is team 1 when team 2 is gaz lec ajaccio (d3)? | SELECT "Team 1" FROM table_7912 WHERE "Team 2" = 'gazélec ajaccio (d3)' | SELECT "Team 1" FROM "table_7912" WHERE "Team 2" = 'gazélec ajaccio (d3)' | 0.071289 |
CREATE TABLE settlements (settlement_id NUMBER, claim_id NUMBER, effective_date TIME, settlement_amount NUMBER)
CREATE TABLE first_notification_of_loss (fnol_id NUMBER, customer_id NUMBER, policy_id NUMBER, service_id NUMBER)
CREATE TABLE customers (customer_id NUMBER, customer_name CLOB)
CREATE TABLE services (service_id NUMBER, service_name CLOB)
CREATE TABLE claims (claim_id NUMBER, fnol_id NUMBER, effective_date TIME)
CREATE TABLE customers_policies (customer_id NUMBER, policy_id NUMBER, date_opened TIME, date_closed TIME)
CREATE TABLE available_policies (policy_id NUMBER, policy_type_code CLOB, customer_phone CLOB)
| How many services are there? | SELECT COUNT(*) FROM services | SELECT COUNT(*) FROM "services" | 0.030273 |
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
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)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE days (days_code VARCHAR2, 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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
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 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 code_description (code VARCHAR2, description CLOB)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt 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 flight_fare (flight_id NUMBER, fare_id NUMBER)
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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
| show me all flights from ATLANTA to SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.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" = 'ATLANTA' 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 "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'SAN FRANCISCO' | 0.488281 |
CREATE TABLE postseason (year NUMBER, round CLOB, team_id_winner CLOB, league_id_winner CLOB, team_id_loser CLOB, league_id_loser CLOB, wins NUMBER, losses NUMBER, ties NUMBER)
CREATE TABLE manager_half (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, inseason NUMBER, half NUMBER, g NUMBER, w NUMBER, l NUMBER, rank NUMBER)
CREATE TABLE fielding (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, pos CLOB, g NUMBER, gs NUMBER, inn_outs NUMBER, po NUMBER, a NUMBER, e NUMBER, dp NUMBER, pb NUMBER, wp NUMBER, sb NUMBER, cs NUMBER, zr 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 NUMBER)
CREATE TABLE batting_postseason (year NUMBER, round CLOB, player_id CLOB, team_id CLOB, league_id CLOB, g NUMBER, ab NUMBER, r NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, rbi NUMBER, sb NUMBER, cs NUMBER, bb NUMBER, so NUMBER, ibb NUMBER, hbp NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE all_star (player_id CLOB, year NUMBER, game_num NUMBER, game_id CLOB, team_id CLOB, league_id CLOB, gp NUMBER, starting_pos NUMBER)
CREATE TABLE player_college (player_id CLOB, college_id CLOB, year NUMBER)
CREATE TABLE manager_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first NUMBER)
CREATE TABLE salary (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, salary NUMBER)
CREATE TABLE pitching (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, w NUMBER, l NUMBER, g NUMBER, gs NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, h NUMBER, er NUMBER, hr NUMBER, bb NUMBER, so NUMBER, baopp NUMBER, era NUMBER, ibb NUMBER, wp NUMBER, hbp NUMBER, bk NUMBER, bfp NUMBER, gf NUMBER, r NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE manager (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, inseason NUMBER, g NUMBER, w NUMBER, l NUMBER, rank NUMBER, plyr_mgr CLOB)
CREATE TABLE team_half (year NUMBER, league_id CLOB, team_id CLOB, half NUMBER, div_id CLOB, div_win CLOB, rank NUMBER, g NUMBER, w NUMBER, l NUMBER)
CREATE TABLE manager_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes NUMBER)
CREATE TABLE hall_of_fame (player_id CLOB, yearid NUMBER, votedby CLOB, ballots NUMBER, needed NUMBER, votes NUMBER, inducted CLOB, category CLOB, needed_note CLOB)
CREATE TABLE team_franchise (franchise_id CLOB, franchise_name CLOB, active CLOB, na_assoc CLOB)
CREATE TABLE team (year NUMBER, league_id CLOB, team_id CLOB, franchise_id CLOB, div_id CLOB, rank NUMBER, g NUMBER, ghome NUMBER, w NUMBER, l NUMBER, div_win CLOB, wc_win CLOB, lg_win CLOB, ws_win CLOB, r NUMBER, ab NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, bb NUMBER, so NUMBER, sb NUMBER, cs NUMBER, hbp NUMBER, sf NUMBER, ra NUMBER, er NUMBER, era NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, ha NUMBER, hra NUMBER, bba NUMBER, soa NUMBER, e NUMBER, dp NUMBER, fp NUMBER, name CLOB, park CLOB, attendance NUMBER, bpf NUMBER, ppf NUMBER, team_id_br CLOB, team_id_lahman45 CLOB, team_id_retro CLOB)
CREATE TABLE home_game (year NUMBER, league_id CLOB, team_id CLOB, park_id CLOB, span_first CLOB, span_last CLOB, games NUMBER, openings NUMBER, attendance NUMBER)
CREATE TABLE fielding_postseason (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, round CLOB, pos CLOB, g NUMBER, gs NUMBER, inn_outs NUMBER, po NUMBER, a NUMBER, e NUMBER, dp NUMBER, tp NUMBER, pb NUMBER, sb NUMBER, cs NUMBER)
CREATE TABLE park (park_id CLOB, park_name CLOB, park_alias CLOB, city CLOB, state CLOB, country CLOB)
CREATE TABLE player (player_id CLOB, birth_year NUMBER, birth_month NUMBER, birth_day NUMBER, birth_country CLOB, birth_state CLOB, birth_city CLOB, death_year NUMBER, death_month NUMBER, death_day NUMBER, death_country CLOB, death_state CLOB, death_city CLOB, name_first CLOB, name_last CLOB, name_given CLOB, weight NUMBER, height NUMBER, bats CLOB, throws CLOB, debut CLOB, final_game CLOB, retro_id CLOB, bbref_id CLOB)
CREATE TABLE appearances (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, g_all NUMBER, gs NUMBER, g_batting NUMBER, g_defense NUMBER, g_p NUMBER, g_c NUMBER, g_1b NUMBER, g_2b NUMBER, g_3b NUMBER, g_ss NUMBER, g_lf NUMBER, g_cf NUMBER, g_rf NUMBER, g_of NUMBER, g_dh NUMBER, g_ph NUMBER, g_pr NUMBER)
CREATE TABLE batting (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, g NUMBER, ab NUMBER, r NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, rbi NUMBER, sb NUMBER, cs NUMBER, bb NUMBER, so NUMBER, ibb NUMBER, hbp NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE pitching_postseason (player_id CLOB, year NUMBER, round CLOB, team_id CLOB, league_id CLOB, w NUMBER, l NUMBER, g NUMBER, gs NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, h NUMBER, er NUMBER, hr NUMBER, bb NUMBER, so NUMBER, baopp CLOB, era NUMBER, ibb NUMBER, wp NUMBER, hbp NUMBER, bk NUMBER, bfp NUMBER, gf NUMBER, r NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE player_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes CLOB)
CREATE TABLE fielding_outfield (player_id CLOB, year NUMBER, stint NUMBER, glf NUMBER, gcf NUMBER, grf NUMBER)
CREATE TABLE college (college_id CLOB, name_full CLOB, city CLOB, state CLOB, country CLOB)
| What is the number of wins the team Boston Red Stockings got in the postseasons each year in history Show the tendency, and list from low to high by the X. | SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year ORDER BY year | SELECT "year", COUNT(*) FROM "postseason" "T1" JOIN "team" "T2" ON "T1"."team_id_winner" = "T2"."team_id_br" AND "T2"."name" = 'Boston Red Stockings' GROUP BY "T1"."year" ORDER BY "year" | 0.181641 |
CREATE TABLE table_204_888 (id NUMBER, "location" CLOB, "mile" NUMBER, "destinations" CLOB, "notes" CLOB)
| which location has the most destinations ? | SELECT "location" FROM table_204_888 GROUP BY "location" ORDER BY COUNT("destinations") DESC LIMIT 1 | SELECT "location" FROM "table_204_888" GROUP BY "location" ORDER BY COUNT("destinations") DESC FETCH FIRST 1 ROWS ONLY | 0.115234 |
CREATE TABLE table_22902 ("Series No." FLOAT, "Season No." FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "U.K. viewers ( million ) " CLOB)
| How many different original air dates does the episode with series number 13 have? | SELECT COUNT("Original air date") FROM table_22902 WHERE "Series No." = '13' | SELECT COUNT("Original air date") FROM "table_22902" WHERE "Series No." = '13' | 0.076172 |
CREATE TABLE table_26398 ("Series #" FLOAT, "Season #" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB)
| Who directed the 'Out with the Old, in with the new' episode? | SELECT "Directed by" FROM table_26398 WHERE "Title" = 'Out with the Old, in with the New' | SELECT "Directed by" FROM "table_26398" WHERE "Title" = 'Out with the Old, in with the New' | 0.088867 |
CREATE TABLE table_name_80 (rank VARCHAR2, player VARCHAR2)
| What rank has andy bichel (qld) as the player? | SELECT rank FROM table_name_80 WHERE player = "andy bichel (qld)" | SELECT "rank" FROM "table_name_80" WHERE "andy bichel (qld)" = "player" | 0.069336 |
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 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 diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| find the number of patients who are protestant quaker by religion and the lab test name is ferritin. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND lab.label = "Ferritin" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Ferritin" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "PROTESTANT QUAKER" = "demographic"."religion" | 0.203125 |
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
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 code_description (code VARCHAR2, description CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
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 flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight 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 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)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
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)
| do you have ground transportation between airport and downtown in BOS | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airport_code = airport.airport_code AND ground_service.city_code = CITY_0.city_code | SELECT DISTINCT "ground_service"."transport_type" FROM "airport" JOIN "airport_service" ON "airport"."airport_code" = "airport_service"."airport_code" JOIN "ground_service" ON "airport"."airport_code" = "ground_service"."airport_code" JOIN "city" "CITY_0" ON "CITY_0"."city_code" = "ground_service"."city_code" AND "CITY_0"."city_name" = 'BOSTON' JOIN "city" "CITY_1" ON "CITY_1"."city_code" = "airport_service"."city_code" AND "CITY_1"."city_name" = 'BOSTON' | 0.448242 |
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
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_fare (flight_id NUMBER, fare_id NUMBER)
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)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_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 ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
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 month (month_number NUMBER, month_name CLOB)
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 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 state (state_code CLOB, state_name CLOB, country_name CLOB)
| what flights go from LONG BEACH to ST. LOUIS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. LOUIS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.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" = 'LONG BEACH' 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 "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'ST. LOUIS' | 0.487305 |
CREATE TABLE View_Unit_Status (apt_id NUMBER, apt_booking_id NUMBER, status_date DATETIME, available_yn BIT)
CREATE TABLE Apartment_Buildings (building_id NUMBER, building_short_name CHAR, building_full_name VARCHAR2, building_description VARCHAR2, building_address VARCHAR2, building_manager VARCHAR2, building_phone VARCHAR2)
CREATE TABLE Apartment_Facilities (apt_id NUMBER, facility_code CHAR)
CREATE TABLE Guests (guest_id NUMBER, gender_code CHAR, guest_first_name VARCHAR2, guest_last_name VARCHAR2, date_of_birth DATETIME)
CREATE TABLE Apartment_Bookings (apt_booking_id NUMBER, apt_id NUMBER, guest_id NUMBER, booking_status_code CHAR, booking_start_date DATETIME, booking_end_date DATETIME)
CREATE TABLE Apartments (apt_id NUMBER, building_id NUMBER, apt_type_code CHAR, apt_number CHAR, bathroom_count NUMBER, bedroom_count NUMBER, room_count CHAR)
| How many apartment bookings in each weekday? Show me a bar chart binning booking start date by weekday, and order total number in ascending order. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) | SELECT "booking_start_date", COUNT("booking_start_date") FROM "Apartment_Bookings" ORDER BY COUNT("booking_start_date") | 0.116211 |
CREATE TABLE body_builder (Body_Builder_ID NUMBER, People_ID NUMBER, Snatch FLOAT, Clean_Jerk FLOAT, Total FLOAT)
CREATE TABLE people (People_ID NUMBER, Name CLOB, Height FLOAT, Weight FLOAT, Birth_Date CLOB, Birth_Place CLOB)
| A scatter chart shows the correlation between People_ID and Total . | SELECT People_ID, Total FROM body_builder | SELECT "People_ID", "Total" FROM "body_builder" | 0.045898 |
CREATE TABLE table_name_45 (position NUMBER, losses VARCHAR2, played VARCHAR2)
| Which Position has Losses of 11, and a Played larger than 22? | SELECT SUM(position) FROM table_name_45 WHERE losses = 11 AND played > 22 | SELECT SUM("position") FROM "table_name_45" WHERE "losses" = 11 AND "played" > 22 | 0.079102 |
CREATE TABLE table_48043 ("Round" FLOAT, "Pick" CLOB, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "Club Team" CLOB)
| Which Round has a Nationality of united states, and a Player of jimmy hayes? | SELECT MAX("Round") FROM table_48043 WHERE "Nationality" = 'united states' AND "Player" = 'jimmy hayes' | SELECT MAX("Round") FROM "table_48043" WHERE "Nationality" = 'united states' AND "Player" = 'jimmy hayes' | 0.102539 |
CREATE TABLE table_53905 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Attendance" CLOB, "Record" CLOB)
| Name the record for may 31 | SELECT "Record" FROM table_53905 WHERE "Date" = 'may 31' | SELECT "Record" FROM "table_53905" WHERE "Date" = 'may 31' | 0.056641 |
CREATE TABLE table_name_80 (date VARCHAR2, opponent VARCHAR2)
| When did the Browns play the Pittsburgh Steelers? | SELECT date FROM table_name_80 WHERE opponent = "pittsburgh steelers" | SELECT "date" FROM "table_name_80" WHERE "opponent" = "pittsburgh steelers" | 0.073242 |
CREATE TABLE EMPLOYEE (EMP_NUM NUMBER, EMP_LNAME VARCHAR2, EMP_FNAME VARCHAR2, EMP_INITIAL VARCHAR2, EMP_JOBCODE VARCHAR2, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
CREATE TABLE ENROLL (CLASS_CODE VARCHAR2, STU_NUM NUMBER, ENROLL_GRADE VARCHAR2)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR2, DEPT_NAME VARCHAR2, SCHOOL_CODE VARCHAR2, EMP_NUM NUMBER, DEPT_ADDRESS VARCHAR2, DEPT_EXTENSION VARCHAR2)
CREATE TABLE CLASS (CLASS_CODE VARCHAR2, CRS_CODE VARCHAR2, CLASS_SECTION VARCHAR2, CLASS_TIME VARCHAR2, CLASS_ROOM VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE COURSE (CRS_CODE VARCHAR2, DEPT_CODE VARCHAR2, CRS_DESCRIPTION VARCHAR2, CRS_CREDIT FLOAT)
CREATE TABLE STUDENT (STU_NUM NUMBER, STU_LNAME VARCHAR2, STU_FNAME VARCHAR2, STU_INIT VARCHAR2, STU_DOB DATETIME, STU_HRS NUMBER, STU_CLASS VARCHAR2, STU_GPA FLOAT, STU_TRANSFER NUMBER, DEPT_CODE VARCHAR2, STU_PHONE VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE PROFESSOR (EMP_NUM NUMBER, DEPT_CODE VARCHAR2, PROF_OFFICE VARCHAR2, PROF_EXTENSION VARCHAR2, PROF_HIGH_DEGREE VARCHAR2)
| Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by office name, and sort in asc by the y-axis. | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) | SELECT "CRS_DESCRIPTION", COUNT("CRS_DESCRIPTION") FROM "CLASS" "T1" JOIN "EMPLOYEE" "T2" ON "T1"."PROF_NUM" = "T2"."EMP_NUM" JOIN "COURSE" "T3" ON "T1"."CRS_CODE" = "T3"."CRS_CODE" JOIN "PROFESSOR" "T4" ON "T2"."EMP_NUM" = "T4"."EMP_NUM" GROUP BY "PROF_OFFICE", "CRS_DESCRIPTION" ORDER BY COUNT("CRS_DESCRIPTION") | 0.306641 |
CREATE TABLE table_30245 ("Entrant" CLOB, "Constructor" CLOB, "Car" CLOB, "Driver" CLOB, "Co-driver" CLOB, "Rounds" CLOB)
| what are all the people where the entries is peugeot sport polska | SELECT "Driver" FROM table_30245 WHERE "Entrant" = 'Peugeot Sport Polska' | SELECT "Driver" FROM "table_30245" WHERE "Entrant" = 'Peugeot Sport Polska' | 0.073242 |
CREATE TABLE table_61986 ("Official Name" CLOB, "Status" CLOB, "Area km 2" FLOAT, "Population" FLOAT, "Census Ranking" CLOB)
| What is the area of the village with a census ranking of 1,442 of 5,008 and a population less than 1,778? | SELECT MAX("Area km 2") FROM table_61986 WHERE "Status" = 'village' AND "Census Ranking" = '1,442 of 5,008' AND "Population" < '1,778' | SELECT MAX("Area km 2") FROM "table_61986" WHERE "Census Ranking" = '1,442 of 5,008' AND "Population" < '1,778' AND "Status" = 'village' | 0.132813 |
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
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 medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime 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)
| when was the last time that patient 006-172277 had a intake of intake, tube feeding amount on this month/26? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'intake, tube feeding amount' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '26' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-172277' 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 "intakeoutput"."intakeoutputtime" FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'intake, tube feeding amount' AND "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL AND STRFTIME('%d', "intakeoutput"."intakeoutputtime") = '26' ORDER BY "intakeoutput"."intakeoutputtime" DESC FETCH FIRST 1 ROWS ONLY | 0.862305 |
CREATE TABLE table_21575 ("No." FLOAT, "Date" CLOB, "Tournament" CLOB, "Winning score" CLOB, "To par" CLOB, "Margin of victory" CLOB, "Runner ( s ) -up" CLOB, "Winners share ( $ ) " FLOAT)
| What was the winner's share in the wegmans lpga championship? | SELECT MAX("Winners share ( $ )") FROM table_21575 WHERE "Tournament" = 'Wegmans LPGA Championship' | SELECT MAX("Winners share ( $ )") FROM "table_21575" WHERE "Tournament" = 'Wegmans LPGA Championship' | 0.098633 |
CREATE TABLE table_78888 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Results" CLOB)
| In what year was the republican incumbent from Kentucky 2 district first elected? | SELECT SUM("First elected") FROM table_78888 WHERE "Party" = 'republican' AND "District" = 'kentucky 2' | SELECT SUM("First elected") FROM "table_78888" WHERE "District" = 'kentucky 2' AND "Party" = 'republican' | 0.102539 |
CREATE TABLE table_name_81 (soap_opera VARCHAR2, rank VARCHAR2, character VARCHAR2)
| What soap opera has a rank larger than 1, and a Character named Emily Bishop? | SELECT soap_opera FROM table_name_81 WHERE rank > 1 AND character = "emily bishop" | SELECT "soap_opera" FROM "table_name_81" WHERE "character" = "emily bishop" AND "rank" > 1 | 0.087891 |
CREATE TABLE table_name_63 (points NUMBER, goals_for VARCHAR2, goal_average VARCHAR2, draws VARCHAR2)
| What is the highest amount of points with a goal average larger than 4, less than 12 draws, and a goal of 63? | SELECT MAX(points) FROM table_name_63 WHERE goal_average > 4 AND draws < 12 AND goals_for = 63 | SELECT MAX("points") FROM "table_name_63" WHERE "draws" < 12 AND "goal_average" > 4 AND "goals_for" = 63 | 0.101563 |
CREATE TABLE table_326 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" CLOB, "U.S. viewers ( millions ) " CLOB)
| What episode was writted by John A. Norris? | SELECT "Title" FROM table_326 WHERE "Written by" = 'John A. Norris' | SELECT "Title" FROM "table_326" WHERE "Written by" = 'John A. Norris' | 0.067383 |
CREATE TABLE table_71915 ("Player" CLOB, "Country" CLOB, "Year ( s ) won" CLOB, "Total" FLOAT, "To par" FLOAT)
| What is the winning total from 1976? | SELECT MAX("Total") FROM table_71915 WHERE "Year(s) won" = '1976' | SELECT MAX("Total") FROM "table_71915" WHERE "Year(s) won" = '1976' | 0.06543 |
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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose days of hospital stay is greater than 7 and lab test name is carboxyhemoglobin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Carboxyhemoglobin" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Carboxyhemoglobin" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "7" < "demographic"."days_stay" | 0.197266 |
CREATE TABLE table_name_42 (location VARCHAR2, aircraft VARCHAR2, tail_number VARCHAR2)
| What was the location that had an accident by the F-27-600RF aircraft with tail number 6O-SAZ? | SELECT location FROM table_name_42 WHERE aircraft = "f-27-600rf" AND tail_number = "6o-saz" | SELECT "location" FROM "table_name_42" WHERE "6o-saz" = "tail_number" AND "aircraft" = "f-27-600rf" | 0.09668 |
CREATE TABLE table_5374 ("Game" FLOAT, "January" FLOAT, "Opponent" CLOB, "Score" CLOB, "Record" CLOB, "Points" FLOAT)
| Which Points have an Opponent of calgary flames, and a January larger than 22? | SELECT AVG("Points") FROM table_5374 WHERE "Opponent" = 'calgary flames' AND "January" > '22' | SELECT AVG("Points") FROM "table_5374" WHERE "January" > '22' AND "Opponent" = 'calgary flames' | 0.092773 |
CREATE TABLE table_name_80 (fa_cup_goals NUMBER, position VARCHAR2, fa_cup_apps VARCHAR2, total_goals VARCHAR2)
| what is the average fa cup goals when the fa cup apps is 0, total goals is less than 1 and position is df? | SELECT AVG(fa_cup_goals) FROM table_name_80 WHERE fa_cup_apps = "0" AND total_goals < 1 AND position = "df" | SELECT AVG("fa_cup_goals") FROM "table_name_80" WHERE "0" = "fa_cup_apps" AND "df" = "position" AND "total_goals" < 1 | 0.114258 |
CREATE TABLE table_name_63 (general_classification VARCHAR2, stage VARCHAR2)
| What is the general classification with a 13 stage? | SELECT general_classification FROM table_name_63 WHERE stage = "13" | SELECT "general_classification" FROM "table_name_63" WHERE "13" = "stage" | 0.071289 |
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_icd_diagnoses (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 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value 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 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 d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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)
| has patient 97733 had been diagnosed with herpetic encephalitis? | 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 = 'herpetic encephalitis') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733) | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 97733 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" = 'herpetic encephalitis' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL | 0.395508 |
CREATE TABLE table_19844 ("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)
| How many entries are shown for winnings for team #07 robby gordon motorsports? | SELECT COUNT("Winnings") FROM table_19844 WHERE "Team(s)" = '#07 Robby Gordon Motorsports' | SELECT COUNT("Winnings") FROM "table_19844" WHERE "Team(s)" = '#07 Robby Gordon Motorsports' | 0.089844 |
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
| For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of last_name and salary , and show by the total number in ascending. | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY | SELECT "LAST_NAME", "SALARY" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "SALARY" | 0.181641 |
CREATE TABLE table_name_17 (circuit VARCHAR2, winning_driver VARCHAR2)
| Which circuit did Raymond Mays win? | SELECT circuit FROM table_name_17 WHERE winning_driver = "raymond mays" | SELECT "circuit" FROM "table_name_17" WHERE "raymond mays" = "winning_driver" | 0.075195 |
CREATE TABLE table_35610 ("Rank" CLOB, "Margin" CLOB, "Opponent" CLOB, "Venue" CLOB, "Season" CLOB)
| What season has 195 runs as a margin? | SELECT "Season" FROM table_35610 WHERE "Margin" = '195 runs' | SELECT "Season" FROM "table_35610" WHERE "Margin" = '195 runs' | 0.060547 |
CREATE TABLE table_19730892_1 (nation VARCHAR2, name VARCHAR2)
| Name the nation where jeff barker is from | SELECT nation FROM table_19730892_1 WHERE name = "Jeff Barker" | SELECT "nation" FROM "table_19730892_1" WHERE "Jeff Barker" = "name" | 0.066406 |
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 FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description 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 PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
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 ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment 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 ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
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 PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
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 ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
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 Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskStates (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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
| Getting all users from Cuba. | SELECT Reputation, DisplayName, Location FROM Users ORDER BY Reputation DESC | SELECT "Reputation", "DisplayName", "Location" FROM "Users" ORDER BY "Reputation" DESC | 0.083984 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.