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_20549 ("Season" CLOB, "1st Place" CLOB, "2nd Place" CLOB, "3rd Place" CLOB, "4th Place" CLOB)
| What team finished in 1st when tau cer mica was in 3rd? | SELECT "1st Place" FROM table_20549 WHERE "3rd Place" = 'TAU Cerámica' | SELECT "1st Place" FROM "table_20549" WHERE "3rd Place" = 'TAU Cerámica' | 0.070313 |
CREATE TABLE table_201_38 (id NUMBER, "season" CLOB, "winner" CLOB, "team" CLOB, "position" CLOB, "age" NUMBER)
| who was the first calder memorial trophy winner from the boston bruins ? | SELECT "winner" FROM table_201_38 WHERE "team" = 'boston bruins' ORDER BY "season" LIMIT 1 | SELECT "winner" FROM "table_201_38" WHERE "team" = 'boston bruins' ORDER BY "season" FETCH FIRST 1 ROWS ONLY | 0.105469 |
CREATE TABLE table_name_86 (name VARCHAR2, date_from VARCHAR2)
| What was the name for the row with Date From of 2008-02-21? | SELECT name FROM table_name_86 WHERE date_from = "2008-02-21" | SELECT "name" FROM "table_name_86" WHERE "2008-02-21" = "date_from" | 0.06543 |
CREATE TABLE table_45695 ("Election" FLOAT, "Candidates fielded" FLOAT, "# of seats won" FLOAT, "Total votes" FLOAT, "% of popular vote" CLOB, "Place" CLOB)
| Can you tell me the average Total votes that has the # of seats won smaller than 0? | SELECT AVG("Total votes") FROM table_45695 WHERE "# of seats won" < '0' | SELECT AVG("Total votes") FROM "table_45695" WHERE "# of seats won" < '0' | 0.071289 |
CREATE TABLE table_70704 ("Model" CLOB, "Floating point" CLOB, "Decimal" CLOB, "Byte string" CLOB, "Memory map" CLOB, "Max memory ( kwords ) " FLOAT)
| On a Sigma 9 with a standard byte string and more than 128 max memory, what is the value of the memory map? | SELECT "Memory map" FROM table_70704 WHERE "Byte string" = 'standard' AND "Max memory (kwords)" > '128' AND "Model" = 'sigma 9' | SELECT "Memory map" FROM "table_70704" WHERE "Byte string" = 'standard' AND "Max memory (kwords)" > '128' AND "Model" = 'sigma 9' | 0.125977 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE 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)
| give the number of patients whose diagnosis long title is major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior and the drug route is ou. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior" AND prescriptions.route = "OU" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "OU" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.37207 |
CREATE TABLE table_name_86 (country VARCHAR2, author VARCHAR2)
| Which Country's Author is based on Sophocles and Euripides? | SELECT country FROM table_name_86 WHERE author = "based on sophocles and euripides" | SELECT "country" FROM "table_name_86" WHERE "author" = "based on sophocles and euripides" | 0.086914 |
CREATE TABLE table_name_37 (wins NUMBER, poles VARCHAR2, season VARCHAR2, podiums VARCHAR2)
| What is the lowest Wins, when Season is 2011, when Podiums is 1, and when Poles is less than 0? | SELECT MIN(wins) FROM table_name_37 WHERE season = "2011" AND podiums = 1 AND poles < 0 | SELECT MIN("wins") FROM "table_name_37" WHERE "2011" = "season" AND "podiums" = 1 AND "poles" < 0 | 0.094727 |
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto 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 d_labitems (row_id NUMBER, itemid NUMBER, label 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 icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
| what are the numbers of patients who had po pe28 intake? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'po pe28' AND d_items.linksto = 'inputevents_cv'))) | WITH "_u_0" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'po pe28' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid"), "_u_1" AS (SELECT "inputevents_cv"."icustay_id" FROM "inputevents_cv" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "inputevents_cv"."itemid" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "icustays"."hadm_id" FROM "icustays" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "icustays"."icustay_id" WHERE NOT "_u_1"."" IS NULL GROUP BY "hadm_id") SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "admissions"."hadm_id" WHERE NOT "_u_2"."" IS NULL | 0.649414 |
CREATE TABLE table_train_162 ("id" NUMBER, "gender" CLOB, "pregnancy_or_lactation" BOOLEAN, "serum_potassium" FLOAT, "systolic_blood_pressure_sbp" NUMBER, "hemoglobin_a1c_hba1c" FLOAT, "diastolic_blood_pressure_dbp" NUMBER, "NOUSE" FLOAT)
| subject with serum potassium between 5 _ 5.5 meq / l | SELECT * FROM table_train_162 WHERE serum_potassium >= 5 AND serum_potassium <= 5.5 | SELECT * FROM "table_train_162" WHERE "serum_potassium" <= 5.5 AND "serum_potassium" >= 5 | 0.086914 |
CREATE TABLE table_name_52 (opponent VARCHAR2, record VARCHAR2)
| Who was the opponent when the record was 55-14? | SELECT opponent FROM table_name_52 WHERE record = "55-14" | SELECT "opponent" FROM "table_name_52" WHERE "55-14" = "record" | 0.061523 |
CREATE TABLE table_50612 ("Athlete" CLOB, "Time" CLOB, "Country" CLOB, "Year" FLOAT, "Place" FLOAT)
| Which Year is the lowest one that has a Time of 24:55:58, and a Place larger than 3? | SELECT MIN("Year") FROM table_50612 WHERE "Time" = '24:55:58' AND "Place" > '3' | SELECT MIN("Year") FROM "table_50612" WHERE "Place" > '3' AND "Time" = '24:55:58' | 0.079102 |
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskStates (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 FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange 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 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 Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name 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 ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE 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 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 PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
| Percent of questions tagged with [tag] that had it removed. | SELECT COUNT(Posts.Id) AS Removed, @totalPosted AS "total_posted", COUNT(Posts.Id) * 100 / @totalPosted AS Percentage FROM Posts INNER JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND PH.PostHistoryTypeId = @reTag AND (STR_POSITION(PH.Text, '<' + @tagToSearch + '>') <= 0 AND Posts.Tags LIKE ('%<' + @tagToSearch + '>%')) | SELECT COUNT("Posts"."Id") AS "Removed", @totalPosted AS "total_posted", COUNT("Posts"."Id") * 100 / NULLIF(@totalPosted, 0) AS "Percentage" FROM "Posts" JOIN "PostHistory" "PH" ON "PH"."PostHistoryTypeId" = @reTag AND "PH"."PostId" = "Posts"."Id" AND STR_POSITION("PH"."Text", '<' + @tagToSearch + '>') <= 0 WHERE "Posts"."PostTypeId" = 1 AND "Posts"."Tags" LIKE ('%<' + @tagToSearch + '>%') | 0.382813 |
CREATE TABLE table_16846 ("Player" CLOB, "No." FLOAT, "Nationality" CLOB, "Position" CLOB, "Years for Jazz" CLOB, "School/Club Team" CLOB)
| What is the player that played 2004-05? | SELECT "Player" FROM table_16846 WHERE "Years for Jazz" = '2004-05' | SELECT "Player" FROM "table_16846" WHERE "Years for Jazz" = '2004-05' | 0.067383 |
CREATE TABLE table_29004 ("District" FLOAT, "Municipalities served" CLOB, "Judge of probate" CLOB, "Judges residence" CLOB, "Location of court" CLOB)
| Where does the judge whose court is in Groton reside? | SELECT "Judges residence" FROM table_29004 WHERE "Location of court" = 'Groton' | SELECT "Judges residence" FROM "table_29004" WHERE "Location of court" = 'Groton' | 0.079102 |
CREATE TABLE table_name_97 (venue VARCHAR2, competition VARCHAR2)
| What's the venue of the 1995 Southeast Asian Games? | SELECT venue FROM table_name_97 WHERE competition = "1995 southeast asian games" | SELECT "venue" FROM "table_name_97" WHERE "1995 southeast asian games" = "competition" | 0.083984 |
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
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 locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
| For those employees who was hired before 2002-06-21, show me the trend about salary over hire_date with a line chart, and show from high to low by the HIRE_DATE. | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | SELECT "HIRE_DATE", "SALARY" FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' ORDER BY "HIRE_DATE" DESC | 0.101563 |
CREATE TABLE table_name_28 (current_streak VARCHAR2, last_10_meetings VARCHAR2)
| For what current streak is KU, 8-2 under last 10 meetings? | SELECT current_streak FROM table_name_28 WHERE last_10_meetings = "ku, 8-2" | SELECT "current_streak" FROM "table_name_28" WHERE "ku, 8-2" = "last_10_meetings" | 0.079102 |
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
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 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| what was patient 002-55218's first output time of other until 1481 days ago? | 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 = '002-55218')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'other' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1481 day') ORDER BY intakeoutput.intakeoutputtime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '002-55218' 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" = 'other' AND "intakeoutput"."cellpath" LIKE '%output%' AND DATETIME("intakeoutput"."intakeoutputtime") <= DATETIME(CURRENT_TIME(), '-1481 day') AND NOT "_u_1"."" IS NULL ORDER BY "intakeoutput"."intakeoutputtime" FETCH FIRST 1 ROWS ONLY | 0.742188 |
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 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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
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)
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 prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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 d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
| in 2105, had lorazepam ever been prescribed to patient 11095? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11095) AND prescriptions.drug = 'lorazepam' AND STRFTIME('%y', prescriptions.startdate) = '2105' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 11095 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'lorazepam' AND NOT "_u_0"."" IS NULL AND STRFTIME('%y', "prescriptions"."startdate") = '2105' | 0.34668 |
CREATE TABLE table_203_467 (id NUMBER, "year" NUMBER, "numer of jamaicans\ granted british\ citizenship" NUMBER, "naturalisation\ by residence" NUMBER, "naturalisation\ by marriage" NUMBER, "registration\ of a minor child" NUMBER, "registration\ by other means" NUMBER)
| how many jamaicans were granted british citizenship in 1998 ? | SELECT "numer of jamaicans\ngranted british\ncitizenship" FROM table_203_467 WHERE "year" = 1998 | SELECT "numer of jamaicans\ngranted british\ncitizenship" FROM "table_203_467" WHERE "year" = 1998 | 0.095703 |
CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
CREATE TABLE voting_record (stuid NUMBER, registration_date CLOB, election_cycle CLOB, president_vote NUMBER, vice_president_vote NUMBER, secretary_vote NUMBER, treasurer_vote NUMBER, class_president_vote NUMBER, class_senator_vote NUMBER)
| How many male (sex is M) students have class senator votes in the fall election cycle? | SELECT COUNT(*) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = class_senator_vote WHERE T1.sex = "M" AND T2.election_cycle = "Fall" | SELECT COUNT(*) FROM "student" "T1" JOIN "voting_record" "T2" ON "Fall" = "T2"."election_cycle" AND "T1"."stuid" = "class_senator_vote" WHERE "M" = "T1"."sex" | 0.154297 |
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
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 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 intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
| what time did patient 002-68632 get his last output (ml)-urethral catheter straight-tip;temperature probe 16 fr. output on the first icu visit? | 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 = '002-68632') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output (ml)-urethral catheter straight-tip;temperature probe 16 fr.' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '002-68632' 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 AND NOT "patient"."unitdischargetime" IS NULL GROUP BY "patientunitstayid" ORDER BY "patient"."unitadmittime" FETCH FIRST 1 ROWS ONLY) SELECT "intakeoutput"."intakeoutputtime" FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'output (ml)-urethral catheter straight-tip;temperature probe 16 fr.' AND "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL ORDER BY "intakeoutput"."intakeoutputtime" DESC FETCH FIRST 1 ROWS ONLY | 0.823242 |
CREATE TABLE table_train_147 ("id" NUMBER, "pregnancy_or_lactation" BOOLEAN, "systolic_blood_pressure_sbp" NUMBER, "hemoglobin_a1c_hba1c" FLOAT, "obesity" BOOLEAN, "fasting_blood_glucose_fbg" FLOAT, "heart_rate" NUMBER, "body_mass_index_bmi" FLOAT, "underweight" BOOLEAN, "NOUSE" FLOAT)
| hemoglobin < 8.5 g / dl or > or = to 17 g / dl | SELECT * FROM table_train_147 WHERE hemoglobin_a1c_hba1c < 8.5 OR hemoglobin_a1c_hba1c >= 17 | SELECT * FROM "table_train_147" WHERE "hemoglobin_a1c_hba1c" < 8.5 OR "hemoglobin_a1c_hba1c" >= 17 | 0.095703 |
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 Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId 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 ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskTypes (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 TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE 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 CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE FlagTypes (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 Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
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 PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
| Top 100 users with most CW posts. | SELECT OwnerUserId AS "user_link", OwnerDisplayName, COUNT(Id) FROM Posts WHERE (NOT CommunityOwnedDate IS NULL) GROUP BY OwnerUserId, OwnerDisplayName ORDER BY COUNT(Id) DESC LIMIT 100 | SELECT "OwnerUserId" AS "user_link", "OwnerDisplayName", COUNT("Id") FROM "Posts" WHERE NOT "CommunityOwnedDate" IS NULL GROUP BY "OwnerUserId", "OwnerDisplayName" ORDER BY COUNT("Id") DESC FETCH FIRST 100 ROWS ONLY | 0.209961 |
CREATE TABLE table_3051 ("Seed" FLOAT, "Rank" FLOAT, "Player" CLOB, "Points" FLOAT, "Points defending" FLOAT, "Points won" FLOAT, "New points" FLOAT, "Status" CLOB)
| What is the highest points won when the player is aravane reza ? | SELECT MAX("Points won") FROM table_3051 WHERE "Player" = 'Aravane Rezaï' | SELECT MAX("Points won") FROM "table_3051" WHERE "Player" = 'Aravane Rezaï' | 0.073242 |
CREATE TABLE table_28588 ("Engine Family" CLOB, "Cylinder Layout" CLOB, "Displacement ( s ) " CLOB, "Injection type" CLOB, "Years produced" CLOB)
| For the engine family MaxxForce 11, what is the years produced? | SELECT "Years produced" FROM table_28588 WHERE "Engine Family" = 'MaxxForce 11' | SELECT "Years produced" FROM "table_28588" WHERE "Engine Family" = 'MaxxForce 11' | 0.079102 |
CREATE TABLE table_65381 ("Nation" CLOB, "Birth date" CLOB, "Height ( m ) " CLOB, "Weight ( kg ) " CLOB, "World Rank" CLOB)
| what is the nation when the height (m) is 1.91 and the weight (kg) is 99? | SELECT "Nation" FROM table_65381 WHERE "Height (m)" = '1.91' AND "Weight (kg)" = '99' | SELECT "Nation" FROM "table_65381" WHERE "Height (m)" = '1.91' AND "Weight (kg)" = '99' | 0.084961 |
CREATE TABLE table_274117_5 (year_of_induction_into_pro_football_hall_of_fame VARCHAR2, player VARCHAR2)
| When was Will Shields inducted into the Pro Football Hall of Fame? | SELECT year_of_induction_into_pro_football_hall_of_fame FROM table_274117_5 WHERE player = "Will Shields" | SELECT "year_of_induction_into_pro_football_hall_of_fame" FROM "table_274117_5" WHERE "Will Shields" = "player" | 0.108398 |
CREATE TABLE table_name_96 (total NUMBER, player VARCHAR2)
| How many totals have andy north as the player? | SELECT SUM(total) FROM table_name_96 WHERE player = "andy north" | SELECT SUM("total") FROM "table_name_96" WHERE "andy north" = "player" | 0.068359 |
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
| Are 8 credits given to all upper-level classes ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 8 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | SELECT COUNT(*) = 0 FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' WHERE "course"."credits" <> 8 AND "course"."department" = 'EECS' | 0.21582 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| tell me the age and admission type of jerry deberry. | SELECT demographic.age, demographic.admission_type FROM demographic WHERE demographic.name = "Jerry Deberry" | SELECT "demographic"."age", "demographic"."admission_type" FROM "demographic" WHERE "Jerry Deberry" = "demographic"."name" | 0.119141 |
CREATE TABLE Investors (investor_id NUMBER, Investor_details VARCHAR2)
CREATE TABLE Lots (lot_id NUMBER, investor_id NUMBER, lot_details VARCHAR2)
CREATE TABLE Purchases (purchase_transaction_id NUMBER, purchase_details VARCHAR2)
CREATE TABLE Transactions_Lots (transaction_id NUMBER, lot_id NUMBER)
CREATE TABLE Transactions (transaction_id NUMBER, investor_id NUMBER, transaction_type_code VARCHAR2, date_of_transaction DATETIME, amount_of_transaction NUMBER, share_count VARCHAR2, other_details VARCHAR2)
CREATE TABLE Sales (sales_transaction_id NUMBER, sales_details VARCHAR2)
CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR2, transaction_type_description VARCHAR2)
| Show the number of the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000, could you list from high to low by the Y? | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000 ORDER BY COUNT(date_of_transaction) DESC | SELECT "date_of_transaction", COUNT("date_of_transaction") FROM "Transactions" WHERE "amount_of_transaction" > 1000 OR "share_count" > 100 ORDER BY COUNT("date_of_transaction") DESC | 0.176758 |
CREATE TABLE customers_policies (customer_id NUMBER, policy_id NUMBER, date_opened TIME, date_closed TIME)
CREATE TABLE first_notification_of_loss (fnol_id NUMBER, customer_id NUMBER, policy_id NUMBER, service_id NUMBER)
CREATE TABLE settlements (settlement_id NUMBER, claim_id NUMBER, effective_date TIME, settlement_amount 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 available_policies (policy_id NUMBER, policy_type_code CLOB, customer_phone CLOB)
| How many policies are listed for the customer named 'Dayana Robel'? | SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel" | SELECT COUNT(*) FROM "customers" "t1" JOIN "customers_policies" "t2" ON "t1"."customer_id" = "t2"."customer_id" WHERE "Dayana Robel" = "t1"."customer_name" | 0.151367 |
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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| calculate the maximum age of unmarried patients who have gangrene primary disease. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "GANGRENE" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "GANGRENE" = "demographic"."diagnosis" AND "SINGLE" = "demographic"."marital_status" | 0.137695 |
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 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 compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description 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_leg (flight_id NUMBER, leg_number NUMBER, leg_flight 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 airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
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 month (month_number NUMBER, month_name CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name 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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_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 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 airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code 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)
| i'd like to book a flight from COLUMBUS to NASHVILLE please | 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 = 'COLUMBUS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NASHVILLE' 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" = 'COLUMBUS' 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" = 'NASHVILLE' | 0.485352 |
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 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 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 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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| tell me the difference between the total amount of input and output from patient 027-203413 today? | SELECT (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 = '027-203413')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day')) - (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 = '027-203413')) AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day')) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '027-203413' 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"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT SUM("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') AND NOT "_u_1"."" IS NULL) - (SELECT SUM("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_4" "_u_4" ON "_u_4"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."cellpath" LIKE '%output%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') AND NOT "_u_4"."" IS NULL) | 1.200195 |
CREATE TABLE table_name_68 (capacity VARCHAR2, name VARCHAR2)
| what is the capacity when the name is 1.2 16v? | SELECT capacity FROM table_name_68 WHERE name = "1.2 16v" | SELECT "capacity" FROM "table_name_68" WHERE "1.2 16v" = "name" | 0.061523 |
CREATE TABLE happy_hour (hh_id NUMBER, shop_id NUMBER, month CLOB, num_of_shaff_in_charge NUMBER)
CREATE TABLE shop (shop_id NUMBER, address CLOB, num_of_staff CLOB, score NUMBER, open_year CLOB)
CREATE TABLE happy_hour_member (hh_id NUMBER, member_id NUMBER, total_amount NUMBER)
CREATE TABLE member (member_id NUMBER, name CLOB, membership_card CLOB, age NUMBER, time_of_purchase NUMBER, level_of_membership NUMBER, address CLOB)
| Which months have more than 2 happy hours? | SELECT month FROM happy_hour GROUP BY month HAVING COUNT(*) > 2 | SELECT "month" FROM "happy_hour" GROUP BY "month" HAVING COUNT(*) > 2 | 0.067383 |
CREATE TABLE table_66472 ("Rank:" FLOAT, "State:" CLOB, "Premier:" CLOB, "Party:" CLOB, "Assumed office:" CLOB, "Left office:" CLOB, "TOTAL Time in office:" CLOB)
| Premier Sir Charles Cowper (1807-1875) KCMG left office 2 October 1856, when did he assume office? | SELECT "Assumed office:" FROM table_66472 WHERE "Premier:" = 'sir charles cowper (1807-1875) kcmg' AND "Left office:" = '2 october 1856' | SELECT "Assumed office:" FROM "table_66472" WHERE "Left office:" = '2 october 1856' AND "Premier:" = 'sir charles cowper (1807-1875) kcmg' | 0.134766 |
CREATE TABLE table_name_15 (total VARCHAR2, rank VARCHAR2, gold VARCHAR2, silver VARCHAR2)
| What is the total medal count when there are more than 1 gold and more than 2 silver medals won and the rank is less than 1? | SELECT total FROM table_name_15 WHERE gold > 1 AND silver > 2 AND rank < 2 | SELECT "total" FROM "table_name_15" WHERE "gold" > 1 AND "rank" < 2 AND "silver" > 2 | 0.082031 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| provide the number of patients whose diagnoses icd9 code is 6140 and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "6140" AND lab.flag = "abnormal" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "6140" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "abnormal" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.25293 |
CREATE TABLE table_203_354 (id NUMBER, "party" CLOB, "candidate ( s ) " CLOB, "votes" NUMBER, "percentage" NUMBER)
| which party received the least votes | SELECT "party" FROM table_203_354 ORDER BY "votes" LIMIT 1 | SELECT "party" FROM "table_203_354" ORDER BY "votes" FETCH FIRST 1 ROWS ONLY | 0.074219 |
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto 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 d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE 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 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)
| when for the first time patient 23061 has had foley output until 10/25/2101? | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23061)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) <= '2101-10-25' ORDER BY outputevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 23061 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" = 'foley' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT "outputevents"."charttime" FROM "outputevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") <= '2101-10-25' ORDER BY "outputevents"."charttime" FETCH FIRST 1 ROWS ONLY | 0.788086 |
CREATE TABLE table_17627 ("Municipality" CLOB, "Population" FLOAT, "Police officers" FLOAT, "Residents per officer" FLOAT, "Total costs ( 2005 ) " CLOB, "Cost per capita" CLOB, "Case burden" FLOAT, "Crime rate per 1 , 000 people" FLOAT, "Police force" CLOB)
| What is the cost per capita in the Courtenay municipality? | SELECT "Cost per capita" FROM table_17627 WHERE "Municipality" = 'Courtenay' | SELECT "Cost per capita" FROM "table_17627" WHERE "Municipality" = 'Courtenay' | 0.076172 |
CREATE TABLE table_name_38 (points NUMBER, name VARCHAR2, drawn VARCHAR2)
| What's the most points for Ea Schongau with more than 1 drawn? | SELECT MAX(points) FROM table_name_38 WHERE name = "ea schongau" AND drawn > 1 | SELECT MAX("points") FROM "table_name_38" WHERE "drawn" > 1 AND "ea schongau" = "name" | 0.083984 |
CREATE TABLE table_name_26 (rank NUMBER, bronze VARCHAR2, total VARCHAR2, gold VARCHAR2)
| What was the average rank for team with more than 44 gold, more and 76 bronze and a higher total than 73? | SELECT AVG(rank) FROM table_name_26 WHERE total > 73 AND gold > 44 AND bronze > 76 | SELECT AVG("rank") FROM "table_name_26" WHERE "bronze" > 76 AND "gold" > 44 AND "total" > 73 | 0.089844 |
CREATE TABLE table_56272 ("Driver" CLOB, "Entrant" CLOB, "Constructor" CLOB, "Chassis" CLOB, "Engine" CLOB, "Tyre" CLOB)
| what is the engine when the tyre is d, the constructor is era and the driver is bob gerard? | SELECT "Engine" FROM table_56272 WHERE "Tyre" = 'd' AND "Constructor" = 'era' AND "Driver" = 'bob gerard' | SELECT "Engine" FROM "table_56272" WHERE "Constructor" = 'era' AND "Driver" = 'bob gerard' AND "Tyre" = 'd' | 0.104492 |
CREATE TABLE table_79976 ("Date" CLOB, "Home captain" CLOB, "Away captain" CLOB, "Venue" CLOB, "Result" CLOB)
| Who is the away captain for Kingsmead? | SELECT "Away captain" FROM table_79976 WHERE "Venue" = 'kingsmead' | SELECT "Away captain" FROM "table_79976" WHERE "Venue" = 'kingsmead' | 0.066406 |
CREATE TABLE game (stadium_id VARCHAR2, id VARCHAR2)
CREATE TABLE stadium (id VARCHAR2, name VARCHAR2)
CREATE TABLE injury_accident (game_id VARCHAR2)
| What are the id and name of the stadium where the most injury accidents happened? | SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "T1"."id", "T1"."name" FROM "stadium" "T1" JOIN "game" "T2" ON "T1"."id" = "T2"."stadium_id" JOIN "injury_accident" "T3" ON "T2"."id" = "T3"."game_id" GROUP BY "T1"."id" ORDER BY COUNT(*) DESC FETCH FIRST 1 ROWS ONLY | 0.217773 |
CREATE TABLE table_203_344 (id NUMBER, "#" NUMBER, "date" CLOB, "opponent" CLOB, "score" CLOB, "win" CLOB, "loss" CLOB, "save" CLOB, "attendance" NUMBER, "record" CLOB, "other info" CLOB)
| how many games did the 1987 chicago cubs play in august ? | SELECT COUNT(*) FROM table_203_344 | SELECT COUNT(*) FROM "table_203_344" | 0.035156 |
CREATE TABLE table_203_263 (id NUMBER, "alumni chapters and clubs" CLOB, "location" CLOB, "founding date" CLOB, "years active" CLOB, "province" CLOB)
| how many chapters were founded in ohio ? | SELECT COUNT("alumni chapters and clubs") FROM table_203_263 WHERE "location" = 'oh' | SELECT COUNT("alumni chapters and clubs") FROM "table_203_263" WHERE "location" = 'oh' | 0.083984 |
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)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
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 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 month (month_number NUMBER, month_name CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
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 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 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 compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
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 airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
| is there ground transportation from the ATL airport to downtown ATLANTA | 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 = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' 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" = 'ATLANTA' JOIN "city" "CITY_1" ON "CITY_1"."city_code" = "airport_service"."city_code" AND "CITY_1"."city_name" = 'ATLANTA' | 0.450195 |
CREATE TABLE Customers (customer_id NUMBER, customer_first_name VARCHAR2, customer_middle_initial VARCHAR2, customer_last_name VARCHAR2, gender VARCHAR2, email_address VARCHAR2, login_name VARCHAR2, login_password VARCHAR2, phone_number VARCHAR2, town_city VARCHAR2, state_county_province VARCHAR2, country VARCHAR2)
CREATE TABLE Orders (order_id NUMBER, customer_id NUMBER, date_order_placed DATETIME, order_details VARCHAR2)
CREATE TABLE Accounts (account_id NUMBER, customer_id NUMBER, date_account_opened DATETIME, account_name VARCHAR2, other_account_details VARCHAR2)
CREATE TABLE Invoices (invoice_number NUMBER, order_id NUMBER, invoice_date DATETIME)
CREATE TABLE Invoice_Line_Items (order_item_id NUMBER, invoice_number NUMBER, product_id NUMBER, product_title VARCHAR2, product_quantity VARCHAR2, product_price NUMBER, derived_product_cost NUMBER, derived_vat_payable NUMBER, derived_total_cost NUMBER)
CREATE TABLE Order_Items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, product_quantity VARCHAR2, other_order_item_details VARCHAR2)
CREATE TABLE Product_Categories (production_type_code VARCHAR2, product_type_description VARCHAR2, vat_rating NUMBER)
CREATE TABLE Financial_Transactions (transaction_id NUMBER, account_id NUMBER, invoice_number NUMBER, transaction_type VARCHAR2, transaction_date DATETIME, transaction_amount NUMBER, transaction_comment VARCHAR2, other_transaction_details VARCHAR2)
CREATE TABLE Products (product_id NUMBER, parent_product_id NUMBER, production_type_code VARCHAR2, unit_price NUMBER, product_name VARCHAR2, product_color VARCHAR2, product_size VARCHAR2)
| Give me a histogram for what are teh names of the different products, as well as the number of customers who have ordered each product. | SELECT product_name, COUNT(*) FROM Order_Items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name | SELECT "product_name", COUNT(*) FROM "Order_Items" "T1" JOIN "Products" "T2" ON "T1"."product_id" = "T2"."product_id" JOIN "Orders" "T3" ON "T1"."order_id" = "T3"."order_id" GROUP BY "T2"."product_name" | 0.197266 |
CREATE TABLE table_204_954 (id NUMBER, "no." NUMBER, "country" CLOB, "2009 winter\ universiade" NUMBER, "2007 wjcc" NUMBER, "2007 wwcc" NUMBER, "2008 wjcc" NUMBER, "2008 wwcc" NUMBER, "points" NUMBER)
| which team had the same amount of qualification points as latvia ? | SELECT "country" FROM table_204_954 WHERE "country" <> 'latvia' AND "points" = (SELECT "points" FROM table_204_954 WHERE "country" = 'latvia') | SELECT "country" FROM "table_204_954" WHERE "country" <> 'latvia' AND "points" = (SELECT "points" FROM "table_204_954" WHERE "country" = 'latvia') | 0.142578 |
CREATE TABLE table_204_236 (id NUMBER, "title" CLOB, "release date" CLOB, "developer ( s ) " CLOB, "publisher ( s ) " CLOB, "genre ( s ) " CLOB)
| what was the first game released ? | SELECT "title" FROM table_204_236 ORDER BY "release date" LIMIT 1 | SELECT "title" FROM "table_204_236" ORDER BY "release date" FETCH FIRST 1 ROWS ONLY | 0.081055 |
CREATE TABLE table_12176 ("Country" CLOB, "Date" CLOB, "Label" CLOB, "Format" CLOB, "Catalogue #" CLOB)
| What country has the label Control? | SELECT "Country" FROM table_12176 WHERE "Label" = 'control' | SELECT "Country" FROM "table_12176" WHERE "Label" = 'control' | 0.05957 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE 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 primary disease and admission time of subject name michael witt? | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Michael Witt" | SELECT "demographic"."diagnosis", "demographic"."admittime" FROM "demographic" WHERE "Michael Witt" = "demographic"."name" | 0.119141 |
CREATE TABLE table_22251 ("Canton" CLOB, "Years of Kindergarten" FLOAT, "Years of Kindergarten provided" CLOB, "Years of Kindergarten legally required" CLOB, "Length of Primary School" FLOAT, "Length of mandatory Secondary School" FLOAT, "Separate Secondary Schools?" CLOB, "Cooperative Secondary Schools?" CLOB, "Integrated Secondary Schools?" CLOB)
| How many years of kindergarten is provided in Ticino? | SELECT "Years of Kindergarten provided" FROM table_22251 WHERE "Canton" = 'Ticino' | SELECT "Years of Kindergarten provided" FROM "table_22251" WHERE "Canton" = 'Ticino' | 0.082031 |
CREATE TABLE table_16409745_1 (interface VARCHAR2, pages_per_minute__color_ VARCHAR2)
| What interface is used on the scanner that has a 36 pages per minute? | SELECT interface FROM table_16409745_1 WHERE pages_per_minute__color_ = 36 | SELECT "interface" FROM "table_16409745_1" WHERE "pages_per_minute__color_" = 36 | 0.078125 |
CREATE TABLE table_75114 ("Flat" CLOB, "Threaded" CLOB, "User-selectable themes" CLOB, "Calendar" CLOB, "Image attachment" CLOB, "Unread message tracking" CLOB, "WYSIWYG Editor" CLOB)
| Which Calendar has a User-selectable themes of user-selectable themes? | SELECT "Calendar" FROM table_75114 WHERE "User-selectable themes" = 'user-selectable themes' | SELECT "Calendar" FROM "table_75114" WHERE "User-selectable themes" = 'user-selectable themes' | 0.091797 |
CREATE TABLE injury_accident (game_id NUMBER, id NUMBER, Player CLOB, Injury CLOB, Number_of_matches CLOB, Source CLOB)
CREATE TABLE stadium (id NUMBER, name CLOB, Home_Games NUMBER, Average_Attendance FLOAT, Total_Attendance FLOAT, Capacity_Percentage FLOAT)
CREATE TABLE game (stadium_id NUMBER, id NUMBER, Season NUMBER, Date CLOB, Home_team CLOB, Away_team CLOB, Score CLOB, Competition CLOB)
| Bar chart x axis away team y axis the number of away team | SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team | SELECT "Away_team", COUNT("Away_team") FROM "game" GROUP BY "Away_team" | 0.069336 |
CREATE TABLE table_name_17 (championship VARCHAR2, year VARCHAR2, winning_score VARCHAR2)
| Which championship after 1985 had a winning score of 8 (68-72-69-71=280)? | SELECT championship FROM table_name_17 WHERE year > 1985 AND winning_score = –8(68 - 72 - 69 - 71 = 280) | SELECT "championship" FROM "table_name_17" WHERE "winning_score" = –8(FALSE) AND "year" > 1985 | 0.091797 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| count the number of emergency hospital admission patients who stayed in hospital for more than 11 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay > "11" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "11" < "demographic"."days_stay" AND "EMERGENCY" = "demographic"."admission_type" | 0.152344 |
CREATE TABLE table_12280396_1 (county VARCHAR2, isolation__km_ VARCHAR2)
| What county is in isolation of 29? | SELECT county FROM table_12280396_1 WHERE isolation__km_ = 29 | SELECT "county" FROM "table_12280396_1" WHERE "isolation__km_" = 29 | 0.06543 |
CREATE TABLE genres (name VARCHAR2, id VARCHAR2)
CREATE TABLE tracks (genre_id VARCHAR2)
| Find number of tracks in each genre? | SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name | SELECT COUNT(*), "T1"."name" FROM "genres" "T1" JOIN "tracks" "T2" ON "T1"."id" = "T2"."genre_id" GROUP BY "T1"."name" | 0.115234 |
CREATE TABLE table_name_94 (score VARCHAR2, record VARCHAR2)
| When the record was 7-2, what was the score for the game? | SELECT score FROM table_name_94 WHERE record = "7-2" | SELECT "score" FROM "table_name_94" WHERE "7-2" = "record" | 0.056641 |
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 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 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 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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
| until 12 months ago what was the first value of the total bilirubin-lab test of patient 006-21388? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-21388')) AND lab.labname = 'total bilirubin' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-12 month') ORDER BY lab.labresulttime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-21388' 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 "lab"."labresult" FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'total bilirubin' AND DATETIME("lab"."labresulttime") <= DATETIME(CURRENT_TIME(), '-12 month') AND NOT "_u_1"."" IS NULL ORDER BY "lab"."labresulttime" FETCH FIRST 1 ROWS ONLY | 0.639648 |
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
| I want an easy BIOLOGY class . | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%BIOLOGY%' AND program_course.course_id = course.course_id AND program_course.workload < 3 | SELECT DISTINCT "course"."name", "course"."number", "program_course"."workload" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."workload" < 3 WHERE "course"."department" LIKE '%BIOLOGY%' | 0.245117 |
CREATE TABLE table_train_79 ("id" NUMBER, "fasting_triglycerides" NUMBER, "fasting_total_cholesterol" NUMBER, "fasting_glucose" NUMBER, "age" FLOAT, "NOUSE" FLOAT)
| laboratory findings of fasting total cholesterol greater than or equal to 240 mg / dl | SELECT * FROM table_train_79 WHERE fasting_total_cholesterol >= 240 | SELECT * FROM "table_train_79" WHERE "fasting_total_cholesterol" >= 240 | 0.069336 |
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_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE diagnoses_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 procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE 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 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)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value 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 icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| what date is patient 76327's birthday? | SELECT patients.dob FROM patients WHERE patients.subject_id = 76327 | SELECT "patients"."dob" FROM "patients" WHERE "patients"."subject_id" = 76327 | 0.075195 |
CREATE TABLE stadium (ID NUMBER, name CLOB, Capacity NUMBER, City CLOB, Country CLOB, Opening_year NUMBER)
CREATE TABLE record (ID NUMBER, Result CLOB, Swimmer_ID NUMBER, Event_ID NUMBER)
CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB)
CREATE TABLE swimmer (ID NUMBER, name CLOB, Nationality CLOB, meter_100 FLOAT, meter_200 CLOB, meter_300 CLOB, meter_400 CLOB, meter_500 CLOB, meter_600 CLOB, meter_700 CLOB, Time CLOB)
| Return a bar chart about the distribution of meter_300 and ID , and show y axis from high to low order. | SELECT meter_300, ID FROM swimmer ORDER BY ID DESC | SELECT "meter_300", "ID" FROM "swimmer" ORDER BY "ID" DESC | 0.056641 |
CREATE TABLE table_204_915 (id NUMBER, "draw" NUMBER, "artist" CLOB, "song" CLOB, "points" NUMBER, "place" CLOB)
| which artist earned the least number of points ? | SELECT "artist" FROM table_204_915 ORDER BY "points" LIMIT 1 | SELECT "artist" FROM "table_204_915" ORDER BY "points" FETCH FIRST 1 ROWS ONLY | 0.076172 |
CREATE TABLE table_name_62 (arrival VARCHAR2, station_name VARCHAR2)
| What is the Arrival time of the Patna Junction Station? | SELECT arrival FROM table_name_62 WHERE station_name = "patna junction" | SELECT "arrival" FROM "table_name_62" WHERE "patna junction" = "station_name" | 0.075195 |
CREATE TABLE table_name_73 (school VARCHAR2, indoor_track VARCHAR2, soccer VARCHAR2, tennis VARCHAR2)
| Which school has yes for soccer, tennis and indoor track. | SELECT school FROM table_name_73 WHERE soccer = "yes" AND tennis = "yes" AND indoor_track = "yes" | SELECT "school" FROM "table_name_73" WHERE "indoor_track" = "yes" AND "soccer" = "yes" AND "tennis" = "yes" | 0.104492 |
CREATE TABLE addresses (address_id NUMBER, line_1_number_building CLOB, city CLOB, zip_postcode CLOB, state_province_county CLOB, country CLOB)
CREATE TABLE customer_payments (customer_id NUMBER, datetime_payment TIME, payment_method_code CLOB, amount_payment NUMBER)
CREATE TABLE vehicles (vehicle_id NUMBER, vehicle_details CLOB)
CREATE TABLE staff (staff_id NUMBER, staff_address_id NUMBER, nickname CLOB, first_name CLOB, middle_name CLOB, last_name CLOB, date_of_birth TIME, date_joined_staff TIME, date_left_staff TIME)
CREATE TABLE customers (customer_id NUMBER, customer_address_id NUMBER, customer_status_code CLOB, date_became_customer TIME, date_of_birth TIME, first_name CLOB, last_name CLOB, amount_outstanding NUMBER, email_address CLOB, phone_number CLOB, cell_mobile_phone_number CLOB)
CREATE TABLE lessons (lesson_id NUMBER, customer_id NUMBER, lesson_status_code CLOB, staff_id NUMBER, vehicle_id NUMBER, lesson_date TIME, lesson_time CLOB, price NUMBER)
| List first name and last name of customers that have more than 2 payments. | SELECT T2.first_name, T2.last_name FROM customer_payments AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2 | SELECT "T2"."first_name", "T2"."last_name" FROM "customer_payments" "T1" JOIN "customers" "T2" ON "T1"."customer_id" = "T2"."customer_id" GROUP BY "T1"."customer_id" HAVING COUNT(*) > 2 | 0.180664 |
CREATE TABLE table_name_72 (name VARCHAR2, rank VARCHAR2)
| Who is at rank 9? | SELECT name FROM table_name_72 WHERE rank = 9 | SELECT "name" FROM "table_name_72" WHERE "rank" = 9 | 0.049805 |
CREATE TABLE table_57247 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| What was the average amount of spectators when the home team scored 11.14 (80)? | SELECT AVG("Crowd") FROM table_57247 WHERE "Home team score" = '11.14 (80)' | SELECT AVG("Crowd") FROM "table_57247" WHERE "Home team score" = '11.14 (80)' | 0.075195 |
CREATE TABLE table_name_45 (height__m_ NUMBER, peak VARCHAR2, class VARCHAR2, prom__m_ VARCHAR2)
| What is the average height for hewitt class, with prom less than 86, and a Peak of gragareth? | SELECT AVG(height__m_) FROM table_name_45 WHERE class = "hewitt" AND prom__m_ < 86 AND peak = "gragareth" | SELECT AVG("height__m_") FROM "table_name_45" WHERE "class" = "hewitt" AND "gragareth" = "peak" AND "prom__m_" < 86 | 0.112305 |
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)
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 intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
| had patient 004-28929 had the urine output until 11/01/2103? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-28929')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2103-11-01' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '004-28929' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'urine' AND "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m-%d', "intakeoutput"."intakeoutputtime") <= '2103-11-01' | 0.643555 |
CREATE TABLE 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 Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
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 ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description 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 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 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 PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId 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 PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
| Top 500 Users in India. It will gives you Top 500 Users who belongs to India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 5000 | SELECT ROW_NUMBER() OVER (ORDER BY "Reputation" DESC) AS "#", "Id" AS "user_link", "Reputation" FROM "Users" WHERE LOWER("Location") LIKE '%india%' OR UPPER("Location") LIKE '%IND' ORDER BY "Reputation" DESC FETCH FIRST 5000 ROWS ONLY | 0.228516 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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)
| how many patients whose insurance is private and admission year is less than 2166? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2166" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2166" > "demographic"."admityear" AND "Private" = "demographic"."insurance" | 0.147461 |
CREATE TABLE table_name_72 (date_of_appointment VARCHAR2, team VARCHAR2)
| When was the appointment date for VFL Wolfsburg? | SELECT date_of_appointment FROM table_name_72 WHERE team = "vfl wolfsburg" | SELECT "date_of_appointment" FROM "table_name_72" WHERE "team" = "vfl wolfsburg" | 0.078125 |
CREATE TABLE table_name_52 (goals NUMBER, assists VARCHAR2, apps VARCHAR2)
| What is the total goals with 12 assists, and less than 291 apps? | SELECT SUM(goals) FROM table_name_52 WHERE assists = 12 AND apps < 291 | SELECT SUM("goals") FROM "table_name_52" WHERE "apps" < 291 AND "assists" = 12 | 0.076172 |
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
| Does Educ Multicult Soc have a class ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Educ Multicult Soc%' OR name LIKE '%Educ Multicult Soc%') AND department = 'EECS' | SELECT DISTINCT "department", "name", "number" FROM "course" WHERE "department" = 'EECS' AND ("description" LIKE '%Educ Multicult Soc%' OR "name" LIKE '%Educ Multicult Soc%') | 0.169922 |
CREATE TABLE table_name_6 (goals_for VARCHAR2, games VARCHAR2, pct__percentage VARCHAR2, points VARCHAR2)
| How many Goals have a Pct % larger than 0.557, a points value smaller than 90, and a games value larger than 68? | SELECT COUNT(goals_for) FROM table_name_6 WHERE pct__percentage > 0.557 AND points < 90 AND games > 68 | SELECT COUNT("goals_for") FROM "table_name_6" WHERE "games" > 68 AND "pct__percentage" > 0.557 AND "points" < 90 | 0.109375 |
CREATE TABLE table_25619 ("Player" CLOB, "Class Year" FLOAT, "Position" CLOB, "Teams" CLOB, "Career" CLOB, "Highlight ( s ) " CLOB)
| What class year was Vencie Glenn from? | SELECT MIN("Class Year") FROM table_25619 WHERE "Player" = 'Vencie Glenn' | SELECT MIN("Class Year") FROM "table_25619" WHERE "Player" = 'Vencie Glenn' | 0.073242 |
CREATE TABLE table_77100 ("Player" CLOB, "Country" CLOB, "Year ( s ) won" CLOB, "Total" FLOAT, "To par" FLOAT)
| What is the To par of Player Andy North with a Total larger than 153? | SELECT COUNT("To par") FROM table_77100 WHERE "Player" = 'andy north' AND "Total" > '153' | SELECT COUNT("To par") FROM "table_77100" WHERE "Player" = 'andy north' AND "Total" > '153' | 0.088867 |
CREATE TABLE table_15125 ("Year" FLOAT, "Entrant" CLOB, "Chassis" CLOB, "Engine" CLOB, "Points" FLOAT)
| Name the points with chassis of march 751 | SELECT "Points" FROM table_15125 WHERE "Chassis" = 'march 751' | SELECT "Points" FROM "table_15125" WHERE "Chassis" = 'march 751' | 0.0625 |
CREATE TABLE table_11435 ("Date" CLOB, "Name" CLOB, "Nationality" CLOB, "Casualties" CLOB, "Tonnage" FLOAT, "Sunk by\\u2026" CLOB)
| What is the name of the ship sunk on 5 May 1943 from the United Kingdom sunk by an u-266 with 0 casualties? | SELECT "Name" FROM table_11435 WHERE "Date" = '5 may 1943' AND "Nationality" = 'united kingdom' AND "Sunk by\u2026" = 'u-266' AND "Casualties" = '0' | SELECT "Name" FROM "table_11435" WHERE "Casualties" = '0' AND "Date" = '5 may 1943' AND "Nationality" = 'united kingdom' AND "Sunk by\u2026" = 'u-266' | 0.146484 |
CREATE TABLE table_name_23 (span_metres NUMBER, span_feet VARCHAR2, rank VARCHAR2, year_opened VARCHAR2, country VARCHAR2)
| What is the lowest amount of Span metres when the year opened is 2007, the country is China, rank is less than 13, and the span feet is less than 1378? | SELECT MIN(span_metres) FROM table_name_23 WHERE year_opened = "2007" AND country = "china" AND rank < 13 AND span_feet < 1378 | SELECT MIN("span_metres") FROM "table_name_23" WHERE "2007" = "year_opened" AND "china" = "country" AND "rank" < 13 AND "span_feet" < 1378 | 0.134766 |
CREATE TABLE table_35382 ("Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Partnering" CLOB, "Opponents" CLOB, "Score" CLOB)
| Surface of clay, and a Partnering of j lio silva had what score? | SELECT "Score" FROM table_35382 WHERE "Surface" = 'clay' AND "Partnering" = 'júlio silva' | SELECT "Score" FROM "table_35382" WHERE "Partnering" = 'júlio silva' AND "Surface" = 'clay' | 0.088867 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid 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)
| give me the number of patients whose admission location is emergency room admit and primary disease is transient ischemic attack? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "EMERGENCY ROOM ADMIT" = "demographic"."admission_location" AND "TRANSIENT ISCHEMIC ATTACK" = "demographic"."diagnosis" | 0.189453 |
CREATE TABLE table_13246 ("Country" CLOB, "Airport" CLOB, "City" CLOB, "2009" FLOAT, "Change ( 09/08 ) " CLOB, "Worldwide ranking" CLOB)
| Which Country has a 2009 larger than 527,180, and a Worldwide ranking of 666? | SELECT "Country" FROM table_13246 WHERE "2009" > '527,180' AND "Worldwide ranking" = '666' | SELECT "Country" FROM "table_13246" WHERE "2009" > '527,180' AND "Worldwide ranking" = '666' | 0.089844 |
CREATE TABLE table_name_3 (away_team VARCHAR2)
| What did the Melbourne team score in their away game? | SELECT away_team AS score FROM table_name_3 WHERE away_team = "melbourne" | SELECT "away_team" AS "score" FROM "table_name_3" WHERE "away_team" = "melbourne" | 0.079102 |
CREATE TABLE table_name_21 (ranking VARCHAR2, ep__number VARCHAR2, rating VARCHAR2)
| What was the ranking for the episode number before 24 that had a rating of 25.7? | SELECT ranking FROM table_name_21 WHERE ep__number < 24 AND rating = "25.7" | SELECT "ranking" FROM "table_name_21" WHERE "25.7" = "rating" AND "ep__number" < 24 | 0.081055 |
CREATE TABLE table_name_59 (visiting_team VARCHAR2, date VARCHAR2)
| Which Visiting Team is on december 23? | SELECT visiting_team FROM table_name_59 WHERE date = "december 23" | SELECT "visiting_team" FROM "table_name_59" WHERE "date" = "december 23" | 0.070313 |
CREATE TABLE table_75920 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| What is the Team with a game of more than 56, and the score is l 85 90 (ot)? | SELECT "Team" FROM table_75920 WHERE "Game" > '56' AND "Score" = 'l 85–90 (ot)' | SELECT "Team" FROM "table_75920" WHERE "Game" > '56' AND "Score" = 'l 85–90 (ot)' | 0.079102 |
CREATE TABLE table_16647 ("#" FLOAT, "Episode" CLOB, "Air Date" CLOB, "Rating" CLOB, "Share" FLOAT, "Rating/Share 18\\u201349" CLOB, "Viewers ( m ) " CLOB, "Timeslot Rank" FLOAT, "Night Rank" CLOB, "Overall Rank" FLOAT)
| what's the night rank with viewers (m) of 6.63 | SELECT "Night Rank" FROM table_16647 WHERE "Viewers (m)" = '6.63' | SELECT "Night Rank" FROM "table_16647" WHERE "Viewers (m)" = '6.63' | 0.06543 |
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
| What upper-level PORTUG courses are available this Spring-Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PORTUG' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Spring-Summer' AND "semester"."year" = 2016 WHERE "course"."department" = 'PORTUG' | 0.464844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.