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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose year of birth is less than 2041 and drug code is cefx1f? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.formulary_drug_cd = "CEFX1F" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "CEFX1F" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2041" > "demographic"."dob_year" | 0.229492 |
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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
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 VoteTypes (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 ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE ReviewTaskResultTypes (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 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 PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
| Unique combinations of tags from questions posted with [tag]. | SELECT DISTINCT COUNT(Tags) AS "question_number" FROM Posts WHERE PostTypeId = 1 AND STR_POSITION(Tags, @tagToSearch) > 0 AND (Tags LIKE '%<teamcity>%' OR Tags LIKE '%<c#>%' OR Tags LIKE '%<mysql>%' OR Tags LIKE '%<oracle>%' OR Tags LIKE '%<java (via spring / mockito)>%' OR Tags LIKE '%<sql-server>%' OR Tags LIKE '%<wpf>%' OR Tags LIKE '%<c++>%' OR Tags LIKE '%<windows>%' OR Tags LIKE '%<postgresql>%' OR Tags LIKE '%<h2>%' OR Tags LIKE '%<mariadb>%' OR Tags LIKE '%<javascript>%' OR Tags LIKE '%<back4app>%' OR Tags LIKE '%<google-sheets>%' OR Tags LIKE '%<asp.net>%') | SELECT DISTINCT COUNT("Tags") AS "question_number" FROM "Posts" WHERE "PostTypeId" = 1 AND ("Tags" LIKE '%<asp.net>%' OR "Tags" LIKE '%<back4app>%' OR "Tags" LIKE '%<c#>%' OR "Tags" LIKE '%<c++>%' OR "Tags" LIKE '%<google-sheets>%' OR "Tags" LIKE '%<h2>%' OR "Tags" LIKE '%<java (via spring / mockito)>%' OR "Tags" LIKE '%<javascript>%' OR "Tags" LIKE '%<mariadb>%' OR "Tags" LIKE '%<mysql>%' OR "Tags" LIKE '%<oracle>%' OR "Tags" LIKE '%<postgresql>%' OR "Tags" LIKE '%<sql-server>%' OR "Tags" LIKE '%<teamcity>%' OR "Tags" LIKE '%<windows>%' OR "Tags" LIKE '%<wpf>%') AND STR_POSITION("Tags", @tagToSearch) > 0 | 0.597656 |
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 ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
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 requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
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 course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname 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 program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
| Does Political Sociology have only one teacher , Prof. Men ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Political Sociology%' AND NOT instructor.name LIKE '%Men%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number", "instructor"."name" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND NOT "instructor"."name" LIKE '%Men%' WHERE "course"."name" LIKE '%Political Sociology%' | 0.458008 |
CREATE TABLE Ship (Ship_ID NUMBER, Name CLOB, Type CLOB, Built_Year FLOAT, Class CLOB, Flag CLOB)
CREATE TABLE captain (Captain_ID NUMBER, Name CLOB, Ship_ID NUMBER, age CLOB, Class CLOB, Rank CLOB)
| Return the average age of captains in each class with a pie chart. | SELECT Class, AVG(age) FROM captain GROUP BY Class | SELECT "Class", AVG("age") FROM "captain" GROUP BY "Class" | 0.056641 |
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 PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId 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 ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description 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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE ReviewTaskStates (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 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 SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTypes (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)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId 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 CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE 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 ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
| Tags in which an user meets the Generalist badge requirements. | SELECT T.TagName, COUNT(PA.Id) AS AnswerCount FROM Tags AS T INNER JOIN PostTags AS PT ON PT.TagId = T.Id INNER JOIN Posts AS PQ ON PQ.Id = PT.PostId INNER JOIN Posts AS PA ON PA.ParentId = PQ.Id WHERE PA.OwnerUserId = '##UserId##' AND PA.CommunityOwnedDate IS NULL AND PA.Score >= 15 GROUP BY T.Id, T.TagName ORDER BY AnswerCount | SELECT "T"."TagName", COUNT("PA"."Id") AS "AnswerCount" FROM "Tags" "T" JOIN "PostTags" "PT" ON "PT"."TagId" = "T"."Id" JOIN "Posts" "PQ" ON "PQ"."Id" = "PT"."PostId" JOIN "Posts" "PA" ON "PA"."CommunityOwnedDate" IS NULL AND "PA"."OwnerUserId" = '##UserId##' AND "PA"."ParentId" = "PQ"."Id" AND "PA"."Score" >= 15 GROUP BY "T"."Id", "T"."TagName" ORDER BY "AnswerCount" | 0.361328 |
CREATE TABLE table_name_4 (grid VARCHAR2, driver VARCHAR2)
| Tell me the total number of Grid for Rubens Barrichello | SELECT COUNT(grid) FROM table_name_4 WHERE driver = "rubens barrichello" | SELECT COUNT("grid") FROM "table_name_4" WHERE "driver" = "rubens barrichello" | 0.076172 |
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 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)
| how many patients aged below 36 years have stayed in the hospital for more than 14 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "36" AND demographic.days_stay > "14" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "14" < "demographic"."days_stay" AND "36" > "demographic"."age" | 0.134766 |
CREATE TABLE table_name_37 (goals NUMBER, player VARCHAR2, rank VARCHAR2)
| What is the highest number of goals for robbie findley ranked above 10? | SELECT MAX(goals) FROM table_name_37 WHERE player = "robbie findley" AND rank < 10 | SELECT MAX("goals") FROM "table_name_37" WHERE "player" = "robbie findley" AND "rank" < 10 | 0.087891 |
CREATE TABLE table_203_783 (id NUMBER, "season" CLOB, "tier" NUMBER, "division" CLOB, "place" CLOB)
| how many seasons did internacional de madrid cf play in the preferente division ? | SELECT COUNT("season") FROM table_203_783 WHERE "division" = 'preferente' | SELECT COUNT("season") FROM "table_203_783" WHERE "division" = 'preferente' | 0.073242 |
CREATE TABLE table_name_91 (college_junior_club_team__league_ VARCHAR2, player VARCHAR2)
| what is the school that hosts mikael renberg | SELECT college_junior_club_team__league_ FROM table_name_91 WHERE player = "mikael renberg" | SELECT "college_junior_club_team__league_" FROM "table_name_91" WHERE "mikael renberg" = "player" | 0.094727 |
CREATE TABLE table_name_41 (rocket VARCHAR2, block VARCHAR2, cospar_id VARCHAR2)
| What rocket has a Block of block i and a COSPAR ID of 1995-060a? | SELECT rocket FROM table_name_41 WHERE block = "block i" AND cospar_id = "1995-060a" | SELECT "rocket" FROM "table_name_41" WHERE "1995-060a" = "cospar_id" AND "block i" = "block" | 0.089844 |
CREATE TABLE table_46375 ("Tournament" CLOB, "Surface" CLOB, "Week" CLOB, "Winner" CLOB, "Finalist" CLOB, "Semifinalists" CLOB)
| What is the Semifinalists that has a Tournament of Cincinnati? | SELECT "Semifinalists" FROM table_46375 WHERE "Tournament" = 'cincinnati' | SELECT "Semifinalists" FROM "table_46375" WHERE "Tournament" = 'cincinnati' | 0.073242 |
CREATE TABLE table_name_30 (year_began_making_autos NUMBER, year_joined_gm VARCHAR2)
| What is the average year to begin making autos for a brand that joined GM in 1917? | SELECT AVG(year_began_making_autos) FROM table_name_30 WHERE year_joined_gm = 1917 | SELECT AVG("year_began_making_autos") FROM "table_name_30" WHERE "year_joined_gm" = 1917 | 0.085938 |
CREATE TABLE table_name_94 (recipient VARCHAR2, award VARCHAR2, film VARCHAR2)
| Name the recipient for jamaica and award of 6,947 | SELECT recipient FROM table_name_94 WHERE award = "£6,947" AND film = "jamaica" | SELECT "recipient" FROM "table_name_94" WHERE "award" = "£6,947" AND "film" = "jamaica" | 0.084961 |
CREATE TABLE table_name_72 (year NUMBER, theatre VARCHAR2)
| Tell me the lowest year for shubert theatre | SELECT MIN(year) FROM table_name_72 WHERE theatre = "shubert theatre" | SELECT MIN("year") FROM "table_name_72" WHERE "shubert theatre" = "theatre" | 0.073242 |
CREATE TABLE table_name_37 (extra VARCHAR2, result VARCHAR2)
| What is the extra result of the 4th game? | SELECT extra FROM table_name_37 WHERE result = "4th" | SELECT "extra" FROM "table_name_37" WHERE "4th" = "result" | 0.056641 |
CREATE TABLE table_name_54 (Id VARCHAR2)
| What is 2007, when 2003 is 1R? | SELECT 2007 FROM table_name_54 WHERE 2003 = "1r" | SELECT 2007 FROM "table_name_54" WHERE "1r" = 2003 | 0.048828 |
CREATE TABLE table_name_92 (hanzi VARCHAR2, regional_population_2010_ VARCHAR2)
| Which Hanzi has a Regional Population of 4,591,972 in 2010? | SELECT hanzi FROM table_name_92 WHERE regional_population_2010_ = "4,591,972" | SELECT "hanzi" FROM "table_name_92" WHERE "4,591,972" = "regional_population_2010_" | 0.081055 |
CREATE TABLE table_80236 ("Tournament" CLOB, "Wins" FLOAT, "Top-5" FLOAT, "Top-10" FLOAT, "Top-25" FLOAT, "Events" FLOAT, "Cuts made" FLOAT)
| what is the number of wins that is in the Top 10 and larger than 13? | SELECT SUM("Wins") FROM table_80236 WHERE "Top-10" > '13' | SELECT SUM("Wins") FROM "table_80236" WHERE "Top-10" > '13' | 0.057617 |
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod 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 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 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
| how many patients had docusate sodium (liquid) prescriptions in the same hospital visit after being diagnosed with chf nos, the previous year? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chf nos') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'docusate sodium (liquid)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."startdate", "admissions"."hadm_id" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'docusate sodium (liquid)' AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'chf nos' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."startdate" WHERE DATETIME("diagnoses_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | 0.894531 |
CREATE TABLE table_15428 ("Team 1" CLOB, "Agg." CLOB, "Team 2" CLOB, "1st leg" CLOB, "2nd leg" CLOB)
| Which team 2 has a 2nd leg of 0-2? | SELECT "Team 2" FROM table_15428 WHERE "2nd leg" = '0-2' | SELECT "Team 2" FROM "table_15428" WHERE "2nd leg" = '0-2' | 0.056641 |
CREATE TABLE table_42928 ("Rank" CLOB, "Nation" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| What is the least amount of silver medals won by Total with more than 1 bronze and more than 18 total medals won? | SELECT MIN("Silver") FROM table_42928 WHERE "Bronze" > '1' AND "Nation" = 'total' AND "Total" > '18' | SELECT MIN("Silver") FROM "table_42928" WHERE "Bronze" > '1' AND "Nation" = 'total' AND "Total" > '18' | 0.099609 |
CREATE TABLE university (school_id VARCHAR2)
CREATE TABLE basketball_match (school_id VARCHAR2)
| How many schools do not participate in the basketball match? | SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match) | SELECT COUNT(*) FROM "university" WHERE NOT "school_id" IN (SELECT "school_id" FROM "basketball_match") | 0.100586 |
CREATE TABLE table_225200_4 (successor VARCHAR2, date_successor_seated VARCHAR2)
| Name the successor for not filled this congress | SELECT successor FROM table_225200_4 WHERE date_successor_seated = "Not filled this congress" | SELECT "successor" FROM "table_225200_4" WHERE "Not filled this congress" = "date_successor_seated" | 0.09668 |
CREATE TABLE table_name_66 (date__from_ VARCHAR2, location VARCHAR2)
| On what date did the event at Zaltbommel begin? | SELECT date__from_ FROM table_name_66 WHERE location = "zaltbommel" | SELECT "date__from_" FROM "table_name_66" WHERE "location" = "zaltbommel" | 0.071289 |
CREATE TABLE appellations (No NUMBER, Appelation CLOB, County CLOB, State CLOB, Area CLOB, isAVA CLOB)
CREATE TABLE wine (No NUMBER, Grape CLOB, Winery CLOB, Appelation CLOB, State CLOB, Name CLOB, Year NUMBER, Price NUMBER, Score NUMBER, Cases NUMBER, Drink CLOB)
CREATE TABLE grapes (ID NUMBER, Grape CLOB, Color CLOB)
| What are the wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart, list x axis from high to low order. | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC | SELECT "Name", COUNT("Name") FROM "appellations" "T1" JOIN "wine" "T2" ON "T1"."Appelation" = "T2"."Appelation" AND "T2"."Price" < 50 WHERE "Monterey" = "T1"."County" GROUP BY "Name" ORDER BY "Name" DESC | 0.198242 |
CREATE TABLE table_name_84 (touchdowns VARCHAR2, extra_points VARCHAR2, points VARCHAR2)
| How many Touchdowns have Extra points larger than 0, and Points of 48? | SELECT COUNT(touchdowns) FROM table_name_84 WHERE extra_points > 0 AND points = 48 | SELECT COUNT("touchdowns") FROM "table_name_84" WHERE "extra_points" > 0 AND "points" = 48 | 0.087891 |
CREATE TABLE table_name_87 (transmitter_location VARCHAR2, station VARCHAR2)
| Where is the transmitter located for the station voice of vietnam | SELECT transmitter_location FROM table_name_87 WHERE station = "voice of vietnam" | SELECT "transmitter_location" FROM "table_name_87" WHERE "station" = "voice of vietnam" | 0.084961 |
CREATE TABLE table_17115950_2 (replaced_by VARCHAR2, team VARCHAR2)
| Who replaced the manager on Team Cfr Cluj? | SELECT replaced_by FROM table_17115950_2 WHERE team = "CFR Cluj" | SELECT "replaced_by" FROM "table_17115950_2" WHERE "CFR Cluj" = "team" | 0.068359 |
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE diagnoses_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 procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 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 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
| how many times has patient 55360 been at the intensive care unit on this hospital encounter? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 55360 GROUP BY "hadm_id") SELECT COUNT(DISTINCT "icustays"."icustay_id") FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL | 0.303711 |
CREATE TABLE table_11678 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
| Which Time/Retired has less than 77 laps, and a Grid of 16? | SELECT "Time/Retired" FROM table_11678 WHERE "Laps" < '77' AND "Grid" = '16' | SELECT "Time/Retired" FROM "table_11678" WHERE "Grid" = '16' AND "Laps" < '77' | 0.076172 |
CREATE TABLE table_203_400 (id NUMBER, "district" CLOB, "vacator" CLOB, "reason for change" CLOB, "successor" CLOB, "date successor\ seated" CLOB)
| what are the total number of successors that are listed as being a democrat -lrb- d -rrb- ? | SELECT COUNT(*) FROM table_203_400 WHERE "successor" = 'd' | SELECT COUNT(*) FROM "table_203_400" WHERE "successor" = 'd' | 0.058594 |
CREATE TABLE table_name_39 (record VARCHAR2, score VARCHAR2)
| What is the record of the game with a score of 1 5? | SELECT record FROM table_name_39 WHERE score = "1 – 5" | SELECT "record" FROM "table_name_39" WHERE "1 – 5" = "score" | 0.058594 |
CREATE TABLE table_name_3 (date VARCHAR2, result VARCHAR2)
| What was the date of the game with a result of 3 2? | SELECT date FROM table_name_3 WHERE result = "3–2" | SELECT "date" FROM "table_name_3" WHERE "3–2" = "result" | 0.054688 |
CREATE TABLE table_name_78 (name VARCHAR2, overall VARCHAR2)
| Which Name has an Overall of 235? | SELECT name FROM table_name_78 WHERE overall = 235 | SELECT "name" FROM "table_name_78" WHERE "overall" = 235 | 0.054688 |
CREATE TABLE table_name_29 (score VARCHAR2, record VARCHAR2)
| What is the score of the game that has a record of 1-2-1? | SELECT score FROM table_name_29 WHERE record = "1-2-1" | SELECT "score" FROM "table_name_29" WHERE "1-2-1" = "record" | 0.058594 |
CREATE TABLE table_27657 ("English" CLOB, "Latin" CLOB, "Proto-Italo-Western 1" CLOB, "Conservative Central Italian 1" CLOB, "Italian" CLOB, "Spanish" CLOB, "Catalan" CLOB, "Old French" CLOB)
| What is every entry for Proto-Italo-Western 1 when door is English? | SELECT "Proto-Italo-Western 1" FROM table_27657 WHERE "English" = 'door' | SELECT "Proto-Italo-Western 1" FROM "table_27657" WHERE "English" = 'door' | 0.072266 |
CREATE TABLE table_name_23 (label VARCHAR2, catalog VARCHAR2, date VARCHAR2, region VARCHAR2)
| What is the label for 2002, in Germany, Catalog Dos 195? | SELECT label FROM table_name_23 WHERE date = "2002" AND region = "germany" AND catalog = "dos 195" | SELECT "label" FROM "table_name_23" WHERE "2002" = "date" AND "catalog" = "dos 195" AND "germany" = "region" | 0.105469 |
CREATE TABLE files (f_id NUMBER, artist_name VARCHAR2, file_size VARCHAR2, duration VARCHAR2, formats VARCHAR2)
CREATE TABLE genre (g_name VARCHAR2, rating VARCHAR2, most_popular_in VARCHAR2)
CREATE TABLE song (song_name VARCHAR2, artist_name VARCHAR2, country VARCHAR2, f_id NUMBER, genre_is VARCHAR2, rating NUMBER, languages VARCHAR2, releasedate DATE, resolution NUMBER)
CREATE TABLE artist (artist_name VARCHAR2, country VARCHAR2, gender VARCHAR2, preferred_genre VARCHAR2)
| Show the shortest duration and lowest rating of songs grouped by genre using a bar chart, and display y axis in desc order. | SELECT MIN(T1.duration), MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY MIN(T1.duration) ORDER BY MIN(T2.rating) DESC | SELECT MIN("T1"."duration"), MIN("T2"."rating") FROM "files" "T1" JOIN "song" "T2" ON "T1"."f_id" = "T2"."f_id" GROUP BY MIN("T1"."duration") ORDER BY MIN("T2"."rating") DESC | 0.169922 |
CREATE TABLE table_1342292_42 (candidates VARCHAR2, incumbent VARCHAR2)
| Who are all the candidates when Sam Rayburn was incumbent? | SELECT candidates FROM table_1342292_42 WHERE incumbent = "Sam Rayburn" | SELECT "candidates" FROM "table_1342292_42" WHERE "Sam Rayburn" = "incumbent" | 0.075195 |
CREATE TABLE table_12792 ("Location" CLOB, "Year" FLOAT, "Champion" CLOB, "Runner-up" CLOB, "Score" CLOB)
| In 1979 when Jimmy Connors was the runner-up what was the score? | SELECT "Score" FROM table_12792 WHERE "Runner-up" = 'jimmy connors' AND "Year" < '1979' | SELECT "Score" FROM "table_12792" WHERE "Runner-up" = 'jimmy connors' AND "Year" < '1979' | 0.086914 |
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)
| count the number of patients whose procedure icd9 code is 252? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "252" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "252" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" | 0.170898 |
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
| For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of revenue , and group by attribute founder, and rank y axis in ascending order. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue) | SELECT "Founder", AVG("Revenue") FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder" ORDER BY AVG("Revenue") | 0.155273 |
CREATE TABLE table_46622 ("Player" CLOB, "Nationality" CLOB, "Position" CLOB, "Years for Grizzlies" CLOB, "School/Club Team" CLOB)
| What are the years when the grizzlies had a point guard who attended the school/club Florida? | SELECT "Years for Grizzlies" FROM table_46622 WHERE "Position" = 'point guard' AND "School/Club Team" = 'florida' | SELECT "Years for Grizzlies" FROM "table_46622" WHERE "Position" = 'point guard' AND "School/Club Team" = 'florida' | 0.112305 |
CREATE TABLE table_29716 ("Team" CLOB, "Outgoing manager" CLOB, "Manner of departure" CLOB, "Date of vacancy" CLOB, "Table" CLOB, "Incoming manager" CLOB, "Date of appointment" CLOB)
| What is the date of appointment when the date of vacancy is 24 november 2010? | SELECT "Date of appointment" FROM table_29716 WHERE "Date of vacancy" = '24 November 2010' | SELECT "Date of appointment" FROM "table_29716" WHERE "Date of vacancy" = '24 November 2010' | 0.089844 |
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE FlagTypes (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 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 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 PostTags (PostId NUMBER, TagId 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 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 Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId 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 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 ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
| Find edit by a user with text. | SELECT PostId AS "post_link", * FROM PostHistory WHERE UserId = '##userId:int##' AND Text LIKE '%' + '##text##' + '%' | SELECT "PostId" AS "post_link", * FROM "PostHistory" WHERE "Text" LIKE '%##text##%' AND "UserId" = '##userId:int##' | 0.112305 |
CREATE TABLE table_name_53 (label VARCHAR2, country VARCHAR2, format VARCHAR2)
| Which Label has a Country of canada, and a Format of cd/digital download? | SELECT label FROM table_name_53 WHERE country = "canada" AND format = "cd/digital download" | SELECT "label" FROM "table_name_53" WHERE "canada" = "country" AND "cd/digital download" = "format" | 0.09668 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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)
| let me know the long title of diagnoses for patient with patient id 18372. | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18372" | SELECT "diagnoses"."long_title" FROM "diagnoses" WHERE "18372" = "diagnoses"."subject_id" | 0.086914 |
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)
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)
| Which patients have the lope2 drug code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LOPE2" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "LOPE2" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.189453 |
CREATE TABLE table_1341453_12 (candidates VARCHAR2, incumbent VARCHAR2)
| Who were the candidates in the election where Saxby Chambliss was the incumbent? | SELECT candidates FROM table_1341453_12 WHERE incumbent = "Saxby Chambliss" | SELECT "candidates" FROM "table_1341453_12" WHERE "Saxby Chambliss" = "incumbent" | 0.079102 |
CREATE TABLE table_5190 ("Maryland Counties" CLOB, "Fall 05" FLOAT, "Fall 06" FLOAT, "Fall 07" FLOAT, "Fall 08" FLOAT, "Fall 09" FLOAT)
| What is the largest value for Fall 08 when Fall 07 is less than 242? | SELECT MAX("Fall 08") FROM table_5190 WHERE "Fall 07" < '242' | SELECT MAX("Fall 08") FROM "table_5190" WHERE "Fall 07" < '242' | 0.061523 |
CREATE TABLE table_78836 ("Class" CLOB, "Number ( s ) " CLOB, "Quantity" FLOAT, "Year ( s ) of Manufacture" CLOB, "Type" CLOB)
| Which Class has a Year(s) of Manufacture of 1899? | SELECT "Class" FROM table_78836 WHERE "Year(s) of Manufacture" = '1899' | SELECT "Class" FROM "table_78836" WHERE "Year(s) of Manufacture" = '1899' | 0.071289 |
CREATE TABLE reservations (code NUMBER, room CLOB, checkin CLOB, checkout CLOB, rate NUMBER, lastname CLOB, firstname CLOB, adults NUMBER, kids NUMBER)
CREATE TABLE rooms (roomid CLOB, roomname CLOB, beds NUMBER, bedtype CLOB, maxoccupancy NUMBER, baseprice NUMBER, decor CLOB)
| Which rooms cost between 120 and 150? Give me the room names. | SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 | SELECT "roomname" FROM "rooms" WHERE "baseprice" <= 150 AND "baseprice" >= 120 | 0.076172 |
CREATE TABLE table_21661 ("Club" CLOB, "Played" CLOB, "Won" CLOB, "Drawn" CLOB, "Lost" CLOB, "Points for" CLOB, "Points against" CLOB, "Tries for" CLOB, "Tries against" CLOB, "Try bonus" CLOB, "Losing bonus" CLOB, "Points" CLOB)
| How many were won when there were 49 points? | SELECT "Won" FROM table_21661 WHERE "Points" = '49' | SELECT "Won" FROM "table_21661" WHERE "Points" = '49' | 0.051758 |
CREATE TABLE table_34992 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Record" CLOB, "Game Site" CLOB, "Attendance" FLOAT)
| Who was the opponent at the game at Sullivan Stadium before week 11? | SELECT "Opponent" FROM table_34992 WHERE "Week" < '11' AND "Game Site" = 'sullivan stadium' | SELECT "Opponent" FROM "table_34992" WHERE "Game Site" = 'sullivan stadium' AND "Week" < '11' | 0.09082 |
CREATE TABLE table_name_90 (richmond_ VARCHAR2, staten_is VARCHAR2, the_bronx VARCHAR2)
| How many voters were in Manhattan when 181,639 people voted in the Bronx? | SELECT richmond_ AS "staten_is" FROM table_name_90 WHERE the_bronx = "181,639" | SELECT "richmond_" AS "staten_is" FROM "table_name_90" WHERE "181,639" = "the_bronx" | 0.082031 |
CREATE TABLE table_24341 ("Type of Record" CLOB, "Attendance" FLOAT, "Date/Year" CLOB, "Stadium" CLOB, "Result/Games" CLOB)
| Name the result/games for 54530 | SELECT "Result/Games" FROM table_24341 WHERE "Attendance" = '54530' | SELECT "Result/Games" FROM "table_24341" WHERE "Attendance" = '54530' | 0.067383 |
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 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 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)
| give me the number of patients whose admission location is transfer from hosp/extram and procedure short title is suture of artery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.short_title = "Suture of artery" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Suture of artery" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "TRANSFER FROM HOSP/EXTRAM" = "demographic"."admission_location" | 0.254883 |
CREATE TABLE table_9063 ("Event" CLOB, "Time" CLOB, "Club" CLOB, "Date" CLOB, "Meet" CLOB, "Location" CLOB)
| Which Location has a Club of delfines ucv? | SELECT "Location" FROM table_9063 WHERE "Club" = 'delfines ucv' | SELECT "Location" FROM "table_9063" WHERE "Club" = 'delfines ucv' | 0.063477 |
CREATE TABLE table_62190 ("Tie no" CLOB, "Home team" CLOB, "Score" CLOB, "Away team" CLOB, "Date" CLOB)
| What was the score when the way team was Wrexham? | SELECT "Score" FROM table_62190 WHERE "Away team" = 'wrexham' | SELECT "Score" FROM "table_62190" WHERE "Away team" = 'wrexham' | 0.061523 |
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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE 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 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_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| calculate the total intake of or ffp of patient 24921. | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or ffp' AND d_items.linksto = 'inputevents_cv') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 24921 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" = 'or ffp' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid") SELECT SUM("inputevents_cv"."amount") FROM "inputevents_cv" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "inputevents_cv"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL | 0.674805 |
CREATE TABLE table_name_67 (canterbury VARCHAR2, central_districts VARCHAR2)
| Which of the Canterbury has a Central District of 276* M.D. Crowe & P.S. Briasco V (C) 1986/87? | SELECT canterbury FROM table_name_67 WHERE central_districts = "276* m.d. crowe & p.s. briasco v (c) 1986/87" | SELECT "canterbury" FROM "table_name_67" WHERE "276* m.d. crowe & p.s. briasco v (c) 1986/87" = "central_districts" | 0.112305 |
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 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)
CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB)
| Show me about the distribution of Time and ID in a bar chart. | SELECT Time, ID FROM swimmer | SELECT "Time", "ID" FROM "swimmer" | 0.033203 |
CREATE TABLE table_name_8 (fastest_laps NUMBER, podiums VARCHAR2, poles VARCHAR2, season VARCHAR2)
| Which the Fastest Laps that have Poles of 0, and a Season of 2002, and a Podiums smaller than 0? | SELECT AVG(fastest_laps) FROM table_name_8 WHERE poles = 0 AND season = "2002" AND podiums < 0 | SELECT AVG("fastest_laps") FROM "table_name_8" WHERE "2002" = "season" AND "podiums" < 0 AND "poles" = 0 | 0.101563 |
CREATE TABLE table_59448 ("Outcome" CLOB, "Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Partner" CLOB, "Opponents in the final" CLOB, "Score in the final" CLOB)
| What was the score where Olga Lugina played in the Tournament of poitiers , france itf $25,000? | SELECT "Score in the final" FROM table_59448 WHERE "Partner" = 'olga lugina' AND "Tournament" = 'poitiers , france itf $25,000' | SELECT "Score in the final" FROM "table_59448" WHERE "Partner" = 'olga lugina' AND "Tournament" = 'poitiers , france itf $25,000' | 0.125977 |
CREATE TABLE table_name_45 (production_company VARCHAR2, year VARCHAR2)
| Which production company has the year of 2005 listed? | SELECT production_company FROM table_name_45 WHERE year = "2005" | SELECT "production_company" FROM "table_name_45" WHERE "2005" = "year" | 0.068359 |
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 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)
| give the number of patients whose diagnosis icd9 code is v4987. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "V4987" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "V4987" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" | 0.169922 |
CREATE TABLE table_52676 ("Name" CLOB, "Title" CLOB, "Start term" FLOAT, "End term" FLOAT, "House" CLOB)
| What is the average Start term with a 1912 end term? | SELECT AVG("Start term") FROM table_52676 WHERE "End term" = '1912' | SELECT AVG("Start term") FROM "table_52676" WHERE "End term" = '1912' | 0.067383 |
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE 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 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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)
| what is the insurance in patient 17667 during this hospital visit? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 17667 AND admissions.dischtime IS NULL | SELECT "admissions"."insurance" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 17667 | 0.123047 |
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime 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 intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| has patient 021-95970 had any allergies in their current hospital visit? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitaldischargetime IS NULL)) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '021-95970' 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 "allergy" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "allergy"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL | 0.519531 |
CREATE TABLE table_48735 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| Which Date has a Location Attendance of madison square garden 19,763, and a High rebounds of david lee (12)? | SELECT "Date" FROM table_48735 WHERE "Location Attendance" = 'madison square garden 19,763' AND "High rebounds" = 'david lee (12)' | SELECT "Date" FROM "table_48735" WHERE "High rebounds" = 'david lee (12)' AND "Location Attendance" = 'madison square garden 19,763' | 0.128906 |
CREATE TABLE table_25433 ("Year" FLOAT, "Tournaments played" FLOAT, "Cuts made" FLOAT, "Wins" FLOAT, "2nd" FLOAT, "Top 10s" FLOAT, "Best finish" CLOB, "Earnings ( $ ) " FLOAT, "Money list rank" FLOAT, "Scoring average" CLOB, "Scoring rank" FLOAT)
| If the scoring average is 72.46, what is the best finish? | SELECT "Best finish" FROM table_25433 WHERE "Scoring average" = '72.46' | SELECT "Best finish" FROM "table_25433" WHERE "Scoring average" = '72.46' | 0.071289 |
CREATE TABLE table_203_296 (id NUMBER, "country" CLOB, "total gdp ( nominal ) \ ( billion us$ ) " CLOB, "gdp per capita\ ( us$ , ppp ) " CLOB, "gdp growth , \ 2007-2011\ ( in % ) " NUMBER, "hdi" CLOB)
| which country has the least gdp growth where gdp nominal is more than 5 and gdp per capita is less than 5000 | SELECT "country" FROM table_203_296 WHERE "total gdp (nominal)\n(billion us$)" > 5 AND "gdp per capita\n(us$, ppp)" < 5000 ORDER BY "gdp growth,\n2007-2011\n(in %)" LIMIT 1 | SELECT "country" FROM "table_203_296" WHERE "gdp per capita\n(us$, ppp)" < 5000 AND "total gdp (nominal)\n(billion us$)" > 5 ORDER BY "gdp growth,\n2007-2011\n(in %)" FETCH FIRST 1 ROWS ONLY | 0.185547 |
CREATE TABLE table_12236 ("Rank" FLOAT, "Athlete" CLOB, "Nanquan" FLOAT, "Nangun" FLOAT, "Total" FLOAT)
| WHAT IS THE AVERAGE NANGUN WITH A RANK LARGER THAN 2, TOTAL OF 17.85? | SELECT AVG("Nangun") FROM table_12236 WHERE "Rank" > '2' AND "Total" = '17.85' | SELECT AVG("Nangun") FROM "table_12236" WHERE "Rank" > '2' AND "Total" = '17.85' | 0.078125 |
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE 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 flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE flight (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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
| i want to travel from PITTSBURGH to OAKLAND around midnight could you give me the flights | 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 ((flight.departure_time >= 2330 OR flight.departure_time < 30) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'PITTSBURGH' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND ("flight"."departure_time" < 30 OR "flight"."departure_time" >= 2330) 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" = 'OAKLAND' | 0.557617 |
CREATE TABLE table_204_577 (id NUMBER, "name" CLOB, "first operational" CLOB, "numeral system" CLOB, "computing mechanism" CLOB, "programming" CLOB, "turing complete" CLOB)
| how many dates are listed ? | SELECT COUNT("first operational") FROM table_204_577 | SELECT COUNT("first operational") FROM "table_204_577" | 0.052734 |
CREATE TABLE table_name_53 (song_title VARCHAR2, track VARCHAR2, release_date VARCHAR2)
| What is the title of the song with a track less than 8 released on 3/22/57? | SELECT song_title FROM table_name_53 WHERE track < 8 AND release_date = "3/22/57" | SELECT "song_title" FROM "table_name_53" WHERE "3/22/57" = "release_date" AND "track" < 8 | 0.086914 |
CREATE TABLE table_43857 ("Year" FLOAT, "Men's singles" CLOB, "Women's singles" CLOB, "Men's doubles" CLOB, "Women's doubles" CLOB, "Mixed doubles" CLOB)
| Which men's singles has mixed doubles with Chen Hung-Ling Chou Chia-Chi? | SELECT "Men's singles" FROM table_43857 WHERE "Mixed doubles" = 'chen hung-ling chou chia-chi' | SELECT "Men's singles" FROM "table_43857" WHERE "Mixed doubles" = 'chen hung-ling chou chia-chi' | 0.09375 |
CREATE TABLE table_61829 ("School" CLOB, "Location" CLOB, "Nickname ( s ) " CLOB, "Colors" CLOB, "Years Member" CLOB)
| What Colors has a School of zeigler high school? | SELECT "Colors" FROM table_61829 WHERE "School" = 'zeigler high school' | SELECT "Colors" FROM "table_61829" WHERE "School" = 'zeigler high school' | 0.071289 |
CREATE TABLE table_204_785 (id NUMBER, "rank" NUMBER, "nation" CLOB, "gold" NUMBER, "silver" NUMBER, "bronze" NUMBER, "total" NUMBER)
| which nation received the least number of gold medals ? | SELECT "nation" FROM table_204_785 ORDER BY "gold" LIMIT 1 | SELECT "nation" FROM "table_204_785" ORDER BY "gold" FETCH FIRST 1 ROWS ONLY | 0.074219 |
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
| count the number of times patient 3369 has had an intake of ultracal until 01/16/2102. | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3369)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ultracal' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2102-01-16' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 3369 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" = 'ultracal' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid") SELECT COUNT(*) FROM "inputevents_cv" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "inputevents_cv"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "inputevents_cv"."charttime") <= '2102-01-16' | 0.723633 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE 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 jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
| For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, rank sum salary in ascending order. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) | SELECT "HIRE_DATE", SUM("SALARY") FROM "employees" WHERE NOT "EMPLOYEE_ID" IN (SELECT "EMPLOYEE_ID" FROM "job_history") ORDER BY SUM("SALARY") | 0.138672 |
CREATE TABLE cinema (Cinema_ID NUMBER, Name CLOB, Openning_year NUMBER, Capacity NUMBER, Location CLOB)
CREATE TABLE film (Film_ID NUMBER, Rank_in_series NUMBER, Number_in_season NUMBER, Title CLOB, Directed_by CLOB, Original_air_date CLOB, Production_code CLOB)
CREATE TABLE schedule (Cinema_ID NUMBER, Film_ID NUMBER, Date CLOB, Show_times_per_day NUMBER, Price FLOAT)
| Give me the title and highest price for each film in a bar chart. | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title | SELECT "Title", MAX("T1"."Price") FROM "schedule" "T1" JOIN "film" "T2" ON "T1"."Film_ID" = "T2"."Film_ID" GROUP BY "Title" | 0.120117 |
CREATE TABLE table_23575 ("Story #" FLOAT, "Target #" CLOB, "Title" CLOB, "Author" CLOB, "Reader" CLOB, "Format" CLOB, "Company" CLOB, "Release Date" CLOB, "Notes" CLOB)
| How many different release dates are there for the audio book with a story number 7? | SELECT COUNT("Release Date") FROM table_23575 WHERE "Story #" = '7' | SELECT COUNT("Release Date") FROM "table_23575" WHERE "Story #" = '7' | 0.067383 |
CREATE TABLE table_6135 ("Year" FLOAT, "Winner" CLOB, "Jockey" CLOB, "Trainer" CLOB, "Owner" CLOB, "Time" CLOB, "Purse" CLOB)
| Who was the trainer in 2013? | SELECT "Trainer" FROM table_6135 WHERE "Year" = '2013' | SELECT "Trainer" FROM "table_6135" WHERE "Year" = '2013' | 0.054688 |
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE 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 icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
| what insurance plan was there in their current hospital encounter for patient 1561? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 1561 AND admissions.dischtime IS NULL | SELECT "admissions"."insurance" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 1561 | 0.12207 |
CREATE TABLE table_27537870_6 (record VARCHAR2, opponent VARCHAR2)
| If the opponent was the Philadelphia flyers, what was the record? | SELECT record FROM table_27537870_6 WHERE opponent = "Philadelphia Flyers" | SELECT "record" FROM "table_27537870_6" WHERE "Philadelphia Flyers" = "opponent" | 0.078125 |
CREATE TABLE table_10932739_2 (orbital_period VARCHAR2, semimajor_axis___au__ VARCHAR2)
| How long is the orbital period for the planet that has a semimajor axis of 5.20 au? | SELECT orbital_period FROM table_10932739_2 WHERE semimajor_axis___au__ = "5.20" | SELECT "orbital_period" FROM "table_10932739_2" WHERE "5.20" = "semimajor_axis___au__" | 0.083984 |
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE 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_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
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 d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
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)
| how many days have there been since patient 57050's last sec mal neo brain/spine diagnosis during this hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'sec mal neo brain/spine') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime DESC LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 57050 GROUP BY "hadm_id") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "diagnoses_icd"."charttime")) FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'sec mal neo brain/spine' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL ORDER BY "diagnoses_icd"."charttime" DESC FETCH FIRST 1 ROWS ONLY | 0.566406 |
CREATE TABLE table_2429942_2 (third_place VARCHAR2, champions VARCHAR2)
| Who had third place when the champions is ban k ostrava (1)? | SELECT third_place FROM table_2429942_2 WHERE champions = "Baník Ostrava (1)" | SELECT "third_place" FROM "table_2429942_2" WHERE "Baník Ostrava (1)" = "champions" | 0.081055 |
CREATE TABLE table_17326036_6 (location_attendance VARCHAR2, date VARCHAR2)
| What was the attendance and location on December 15? | SELECT location_attendance FROM table_17326036_6 WHERE date = "December 15" | SELECT "location_attendance" FROM "table_17326036_6" WHERE "December 15" = "date" | 0.079102 |
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE 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_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
| tell me the top five most common diagnoses in patients in the age of 60 or above this year? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 5) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."age" >= 60 GROUP BY "hadm_id"), "t1" AS (SELECT "diagnoses_icd"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnoses_icd" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "diagnoses_icd"."hadm_id" WHERE DATETIME("diagnoses_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL GROUP BY "diagnoses_icd"."icd9_code"), "_u_1" AS (SELECT "t1"."icd9_code" FROM "t1" "t1" WHERE "t1"."c1" <= 5 GROUP BY "icd9_code") SELECT "d_icd_diagnoses"."short_title" FROM "d_icd_diagnoses" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_icd_diagnoses"."icd9_code" WHERE NOT "_u_1"."" IS NULL | 0.712891 |
CREATE TABLE table_name_86 (innings NUMBER, runs VARCHAR2, matches VARCHAR2)
| What is the largest number of innings with less than 342 runs and more than 4 matches? | SELECT MAX(innings) FROM table_name_86 WHERE runs < 342 AND matches > 4 | SELECT MAX("innings") FROM "table_name_86" WHERE "matches" > 4 AND "runs" < 342 | 0.077148 |
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
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 month (month_number NUMBER, month_name CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight 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 airline (airline_code VARCHAR2, airline_name CLOB, note 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 restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE flight (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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare 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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
| find me a flight on UA from BOSTON to SAN FRANCISCO with a stopover in DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DENVER' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'UA' | 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" = 'BOSTON' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "flight"."airline_code" = 'UA' JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "flight_stop" ON "flight"."flight_id" = "flight_stop"."flight_id" JOIN "airport_service" "AIRPORT_SERVICE_2" ON "AIRPORT_SERVICE_2"."airport_code" = "flight_stop"."stop_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'SAN FRANCISCO' JOIN "city" "CITY_2" ON "AIRPORT_SERVICE_2"."city_code" = "CITY_2"."city_code" AND "CITY_2"."city_name" = 'DENVER' | 0.8125 |
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE VoteTypes (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 PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
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 Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
| Vetrans Query Tag combinations Counts. | SELECT COUNT(QuestionPost.Id) AS size, QuestionPost.Tags AS tagName FROM Posts AS QuestionPost WHERE (QuestionPost.Tags LIKE '%<string>%') AND QuestionPost.PostTypeId = (SELECT Id FROM PostTypes WHERE Name = 'Question') AND NOT QuestionPost.Tags LIKE '%<%<%<%' GROUP BY (QuestionPost.Tags) ORDER BY size DESC | SELECT COUNT("QuestionPost"."Id") AS "size", "QuestionPost"."Tags" AS "tagName" FROM "Posts" "QuestionPost" WHERE "QuestionPost"."PostTypeId" = (SELECT "Id" FROM "PostTypes" WHERE "Name" = 'Question') AND "QuestionPost"."Tags" LIKE '%<string>%' AND NOT "QuestionPost"."Tags" LIKE '%<%<%<%' GROUP BY ("QuestionPost"."Tags") ORDER BY "size" DESC | 0.334961 |
CREATE TABLE table_75655 ("Outcome" CLOB, "Event" CLOB, "Year" CLOB, "Venue" CLOB, "Partner" CLOB)
| In what Year did the German Open have Yoo Sang-Hee as Partner? | SELECT "Year" FROM table_75655 WHERE "Partner" = 'yoo sang-hee' AND "Venue" = 'german open' | SELECT "Year" FROM "table_75655" WHERE "Partner" = 'yoo sang-hee' AND "Venue" = 'german open' | 0.09082 |
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE 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 prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
| when was the last time that patient 81461 had the chloride minimum value since 12/2105? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND STRFTIME('%y-%m', labevents.charttime) >= '2105-12' ORDER BY labevents.valuenum, labevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 81461 GROUP BY "hadm_id"), "_u_1" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'chloride' GROUP BY "itemid") SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."hadm_id" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."itemid" WHERE NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "labevents"."charttime") >= '2105-12' ORDER BY "labevents"."valuenum", "labevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY | 0.595703 |
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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
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)
| how many patients have received a minoxidil in 2105 two or more times? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'minoxidil' AND STRFTIME('%y', treatment.treatmenttime) = '2105') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2 | WITH "t1" AS (SELECT "patient"."uniquepid", COUNT(*) AS "c1" FROM "patient" JOIN "treatment" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" AND "treatment"."treatmentname" = 'minoxidil' AND STRFTIME('%y', "treatment"."treatmenttime") = '2105' GROUP BY "patient"."uniquepid") SELECT COUNT(DISTINCT "t1"."uniquepid") FROM "t1" "t1" WHERE "t1"."c1" >= 2 | 0.361328 |
CREATE TABLE table_261954_1 (institution VARCHAR2, nickname VARCHAR2)
| What is every institution with the nickname of Wildcats? | SELECT institution FROM table_261954_1 WHERE nickname = "WildCats" | SELECT "institution" FROM "table_261954_1" WHERE "WildCats" = "nickname" | 0.070313 |
CREATE TABLE table_202_224 (id NUMBER, "party" CLOB, "candidate" CLOB, "votes" NUMBER, "%" NUMBER)
| did the snp or the conservative party get a greater percentage of the vote in the 2001 general election in ochil ? | SELECT "party" FROM table_202_224 WHERE "party" IN ('snp', 'conservative') ORDER BY "%" DESC LIMIT 1 | SELECT "party" FROM "table_202_224" WHERE "party" IN ('snp', 'conservative') ORDER BY "%" DESC FETCH FIRST 1 ROWS ONLY | 0.115234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.