schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
| For those employees who was hired before 2002-06-21, a scatter chart shows the correlation between salary and manager_id . | SELECT SALARY, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | SELECT "SALARY", "MANAGER_ID" FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' | 0.077148 |
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
| How many 9 -credit , upper-level classes are there ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 9 AND program_course.category LIKE 'ULCS' | SELECT COUNT(DISTINCT "course"."course_id") FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE 'ULCS' WHERE "course"."credits" = 9 | 0.202148 |
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
| CSV compliant excel export of posts. http://meta.stackexchange.com/questions/194150/parsing-csv-file-with-posts-body-as-a-column-on-data-explorer | SELECT * FROM PendingFlags WHERE FlagTypeId = 14 | SELECT * FROM "PendingFlags" WHERE "FlagTypeId" = 14 | 0.050781 |
CREATE TABLE table_4176 ("Episode" TEXT, "First broadcast" TEXT, "Andrew and Georgies guest" TEXT, "Jamie and Johns guest" TEXT, "Scores" TEXT)
| Who was Andrew and Georgies guest when Jamie and Johns guest was Jessica Ennis? | SELECT "Andrew and Georgies guest" FROM table_4176 WHERE "Jamie and Johns guest" = 'Jessica Ennis' | SELECT "Andrew and Georgies guest" FROM "table_4176" WHERE "Jamie and Johns guest" = 'Jessica Ennis' | 0.097656 |
CREATE TABLE table_name_18 (team VARCHAR, ratt VARCHAR)
| What was the team with a ratt of 57? | SELECT team FROM table_name_18 WHERE ratt = "57" | SELECT "team" FROM "table_name_18" WHERE "57" = "ratt" | 0.052734 |
CREATE TABLE table_train_260 ("id" INT, "leukocyte_deficiencies" BOOLEAN, "bleeding" INT, "hemoglobin_a1c_hba1c" FLOAT, "leukocyte_dysfunction" BOOLEAN, "renal_disease" BOOLEAN, "hba1c" FLOAT, "serum_creatinine" FLOAT, "NOUSE" FLOAT)
| glycated hemoglobin a1c ( hba1c ) levels of at least 8 % up to and including 12 % as reported within 4 weeks of implant placement | SELECT * FROM table_train_260 WHERE hba1c >= 8 AND hemoglobin_a1c_hba1c <= 12 | SELECT * FROM "table_train_260" WHERE "hba1c" >= 8 AND "hemoglobin_a1c_hba1c" <= 12 | 0.081055 |
CREATE TABLE table_2850912_1 (nationality VARCHAR, nhl_team VARCHAR)
| What nationality is the draft pick player going to Minnesota North Stars? | SELECT nationality FROM table_2850912_1 WHERE nhl_team = "Minnesota North Stars" | SELECT "nationality" FROM "table_2850912_1" WHERE "Minnesota North Stars" = "nhl_team" | 0.083984 |
CREATE TABLE PROFESSOR (EMP_NUM INT, DEPT_CODE VARCHAR, PROF_OFFICE VARCHAR, PROF_EXTENSION VARCHAR, PROF_HIGH_DEGREE VARCHAR)
CREATE TABLE COURSE (CRS_CODE VARCHAR, DEPT_CODE VARCHAR, CRS_DESCRIPTION VARCHAR, CRS_CREDIT FLOAT)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR, DEPT_NAME VARCHAR, SCHOOL_CODE VARCHAR, EMP_NUM INT, DEPT_ADDRESS VARCHAR, DEPT_EXTENSION VARCHAR)
CREATE TABLE EMPLOYEE (EMP_NUM INT, EMP_LNAME VARCHAR, EMP_FNAME VARCHAR, EMP_INITIAL VARCHAR, EMP_JOBCODE VARCHAR, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
CREATE TABLE CLASS (CLASS_CODE VARCHAR, CRS_CODE VARCHAR, CLASS_SECTION VARCHAR, CLASS_TIME VARCHAR, CLASS_ROOM VARCHAR, PROF_NUM INT)
CREATE TABLE ENROLL (CLASS_CODE VARCHAR, STU_NUM INT, ENROLL_GRADE VARCHAR)
CREATE TABLE STUDENT (STU_NUM INT, STU_LNAME VARCHAR, STU_FNAME VARCHAR, STU_INIT VARCHAR, STU_DOB DATETIME, STU_HRS INT, STU_CLASS VARCHAR, STU_GPA FLOAT, STU_TRANSFER DECIMAL, DEPT_CODE VARCHAR, STU_PHONE VARCHAR, PROF_NUM INT)
| Show me a bar chart for what is the total credit does each department offer?, I want to list X in desc order. | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC | SELECT "DEPT_CODE", SUM("CRS_CREDIT") FROM "COURSE" GROUP BY "DEPT_CODE" ORDER BY "DEPT_CODE" DESC NULLS LAST | 0.106445 |
CREATE TABLE book (book_id DECIMAL, title TEXT, issues DECIMAL, writer TEXT)
CREATE TABLE publication (publication_id DECIMAL, book_id DECIMAL, publisher TEXT, publication_date TEXT, price DECIMAL)
| How many distinct publication dates are there in our record? | SELECT COUNT(DISTINCT publication_date) FROM publication | SELECT COUNT(DISTINCT "publication_date") FROM "publication" | 0.058594 |
CREATE TABLE county (County_name VARCHAR, Population VARCHAR)
| Show the name of the county with the biggest population. | SELECT County_name FROM county ORDER BY Population DESC LIMIT 1 | SELECT "County_name" FROM "county" ORDER BY "Population" DESC NULLS LAST LIMIT 1 | 0.078125 |
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
| since 2101, what are the three most frequently taken lab tests for patients of age 50s? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND STRFTIME('%y', labevents.charttime) >= '2101' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."age" <= 59 AND "admissions"."age" >= 50 GROUP BY "hadm_id"), "t1" AS (SELECT "labevents"."itemid", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "labevents"."charttime") >= '2101' GROUP BY "labevents"."itemid"), "_u_1" AS (SELECT "t1"."itemid" FROM "t1" AS "t1" WHERE "t1"."c1" <= 3 GROUP BY "itemid") SELECT "d_labitems"."label" FROM "d_labitems" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_labitems"."itemid" WHERE NOT "_u_1"."" IS NULL | 0.651367 |
CREATE TABLE table_74680 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Which venue hosted a home team with a score of 13.15 (93)? | SELECT "Venue" FROM table_74680 WHERE "Home team score" = '13.15 (93)' | SELECT "Venue" FROM "table_74680" WHERE "Home team score" = '13.15 (93)' | 0.070313 |
CREATE TABLE table_27902171_9 (score VARCHAR, record VARCHAR)
| What were the scores of the games with a record of 47-34? | SELECT score FROM table_27902171_9 WHERE record = "47-34" | SELECT "score" FROM "table_27902171_9" WHERE "47-34" = "record" | 0.061523 |
CREATE TABLE table_13564637_4 (Id VARCHAR)
| What is the name of the column points against? | SELECT "points" AS _against FROM table_13564637_4 WHERE "points" = "points" | SELECT "points" AS "_against" FROM "table_13564637_4" WHERE "points" = "points" | 0.077148 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| count the number of patients whose year of birth is less than 2112 and procedure short title is oth periton adhesiolysis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2112" AND procedures.short_title = "Oth periton adhesiolysis" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Oth periton adhesiolysis" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "2112" > "demographic"."dob_year" | 0.232422 |
CREATE TABLE table_name_3 (result VARCHAR, latin_commander VARCHAR)
| What is the Result of the battle with Latin Commander Boniface of Montferrat? | SELECT result FROM table_name_3 WHERE latin_commander = "boniface of montferrat" | SELECT "result" FROM "table_name_3" WHERE "boniface of montferrat" = "latin_commander" | 0.083984 |
CREATE TABLE table_74943 ("Club" TEXT, "Played" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Tries against" TEXT, "Try bonus" TEXT, "Losing bonus" TEXT, "Points" TEXT)
| If the losing bonus was 6, what is the tries for? | SELECT "Tries for" FROM table_74943 WHERE "Losing bonus" = '6' | SELECT "Tries for" FROM "table_74943" WHERE "Losing bonus" = '6' | 0.0625 |
CREATE TABLE table_48769 ("Game" FLOAT, "Date" TEXT, "Team" TEXT, "Score" TEXT, "High points" TEXT, "High assists" TEXT, "Location Attendance" TEXT, "Record" TEXT)
| What is the record of game 33? | SELECT "Record" FROM table_48769 WHERE "Game" = '33' | SELECT "Record" FROM "table_48769" WHERE "Game" = '33' | 0.052734 |
CREATE TABLE table_22267 ("Departure" TEXT, "Going to" TEXT, "Calling at" TEXT, "Arrival" TEXT, "Operator" TEXT)
| What was the arrival for Wansford, Peterborough East? | SELECT "Arrival" FROM table_22267 WHERE "Calling at" = 'Wansford, Peterborough East' | SELECT "Arrival" FROM "table_22267" WHERE "Calling at" = 'Wansford, Peterborough East' | 0.083984 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| provide the average age of patients whose death status is 0 and primary disease is newborn. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "NEWBORN" | SELECT AVG("demographic"."age") FROM "demographic" WHERE "0" = "demographic"."expire_flag" AND "NEWBORN" = "demographic"."diagnosis" | 0.128906 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients were admitted in emergency for replacement of small bowel tube? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Replace small bowel tube" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Replace small bowel tube" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type" | 0.243164 |
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
| What ULCS classes are required for EECS majors ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' WHERE "course"."department" LIKE '%EECS%' | 0.246094 |
CREATE TABLE table_name_66 (total VARCHAR, year_s__won VARCHAR)
| What is the Total for the Player who won in 1936? | SELECT COUNT(total) FROM table_name_66 WHERE year_s__won = "1936" | SELECT COUNT("total") FROM "table_name_66" WHERE "1936" = "year_s__won" | 0.069336 |
CREATE TABLE table_204_394 (id DECIMAL, "year" DECIMAL, "album" TEXT, "label" TEXT, "peak chart\ positions\ us" DECIMAL, "peak chart\ positions\ us r&b" DECIMAL)
| what number of albums were recorded on the ode label ? | SELECT COUNT("album") FROM table_204_394 WHERE "label" = 'ode' | SELECT COUNT("album") FROM "table_204_394" WHERE "label" = 'ode' | 0.0625 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the number of patients with drug code ris1l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "RIS1L" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "RIS1L" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.189453 |
CREATE TABLE table_name_66 (body_width_mm INT, part_number VARCHAR, body_length_mm VARCHAR)
| How much Body Width/mm has a Part Number of tsop40/44, and a Body Length/mm smaller than 18.42? | SELECT SUM(body_width_mm) FROM table_name_66 WHERE part_number = "tsop40/44" AND body_length_mm < 18.42 | SELECT SUM("body_width_mm") FROM "table_name_66" WHERE "body_length_mm" < 18.42 AND "part_number" = "tsop40/44" | 0.108398 |
CREATE TABLE table_name_63 (club VARCHAR, points_against VARCHAR)
| What is the club had 431 points against them? | SELECT club FROM table_name_63 WHERE points_against = "431" | SELECT "club" FROM "table_name_63" WHERE "431" = "points_against" | 0.063477 |
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| when did during the last hospital visit patient 86786 last get a sputum microbiology test? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86786 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'sputum' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | SELECT "microbiologyevents"."charttime" FROM "microbiologyevents" WHERE "microbiologyevents"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 86786 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" DESC NULLS LAST LIMIT 1) AND "microbiologyevents"."spec_type_desc" = 'sputum' ORDER BY "microbiologyevents"."charttime" DESC NULLS LAST LIMIT 1 | 0.40332 |
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
| For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of email and employee_id , could you rank X in descending order please? | SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | SELECT "EMAIL", "EMPLOYEE_ID" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "EMAIL" DESC NULLS LAST | 0.197266 |
CREATE TABLE table_204_855 (id DECIMAL, "year" DECIMAL, "date" TEXT, "winner" TEXT, "result" TEXT, "loser" TEXT, "attendance" DECIMAL, "location" TEXT)
| which team won the last game in 1989 ? | SELECT "winner" FROM table_204_855 WHERE "year" = 1989 ORDER BY "date" DESC LIMIT 1 | SELECT "winner" FROM "table_204_855" WHERE "year" = 1989 ORDER BY "date" DESC NULLS LAST LIMIT 1 | 0.09375 |
CREATE TABLE table_204_260 (id DECIMAL, "date" TEXT, "venue" TEXT, "opponent" TEXT, "result" TEXT, "tournament" TEXT, "scored" DECIMAL)
| where did netwon score at least 3 times ? | SELECT "venue" FROM table_204_260 WHERE "scored" >= 3 | SELECT "venue" FROM "table_204_260" WHERE "scored" >= 3 | 0.053711 |
CREATE TABLE table_70121 ("Date" TEXT, "Home captain" TEXT, "Away captain" TEXT, "Venue" TEXT, "Result" TEXT)
| Name the away captain with result of wi by 9 wkts | SELECT "Away captain" FROM table_70121 WHERE "Result" = 'wi by 9 wkts' | SELECT "Away captain" FROM "table_70121" WHERE "Result" = 'wi by 9 wkts' | 0.070313 |
CREATE TABLE video_games (gameid DECIMAL, gname TEXT, gtype TEXT)
CREATE TABLE sportsinfo (stuid DECIMAL, sportname TEXT, hoursperweek DECIMAL, gamesplayed DECIMAL, onscholarship TEXT)
CREATE TABLE plays_games (stuid DECIMAL, gameid DECIMAL, hours_played DECIMAL)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
| Show all student ids and the number of hours played. | SELECT stuid, SUM(hours_played) FROM plays_games GROUP BY stuid | SELECT "stuid", SUM("hours_played") FROM "plays_games" GROUP BY "stuid" | 0.069336 |
CREATE TABLE table_76165 ("Rank" FLOAT, "Company" TEXT, "Headquarters" TEXT, "Industry" TEXT, "Sales ( billion $ ) " FLOAT, "Profits ( billion $ ) " FLOAT, "Assets ( billion $ ) " FLOAT, "Market Value ( billion $ ) " FLOAT)
| Name the lowest Market Value (billion $) which has Assets (billion $) larger than 276.81, and a Company of toyota, and Profits (billion $) larger than 17.21? | SELECT MIN("Market Value (billion $)") FROM table_76165 WHERE "Assets (billion $)" > '276.81' AND "Company" = 'toyota' AND "Profits (billion $)" > '17.21' | SELECT MIN("Market Value (billion $)") FROM "table_76165" WHERE "Assets (billion $)" > '276.81' AND "Company" = 'toyota' AND "Profits (billion $)" > '17.21' | 0.152344 |
CREATE TABLE table_47183 ("Name" TEXT, "Year Began" TEXT, "s Registered user" TEXT, "Updated in past 30 days" TEXT, "Registration" TEXT, "Ability to syndicate off-site feeds" TEXT, "Userpics Free" TEXT, "Userpics Paid" TEXT, "Monthly Cost for Paid Account" TEXT, "Yearly Cost for Paid Account" TEXT, "Permanent Account" TEXT)
| What is Permanent Account, when Updated In Past 30 Days is 10324? | SELECT "Permanent Account" FROM table_47183 WHERE "Updated in past 30 days" = '10324' | SELECT "Permanent Account" FROM "table_47183" WHERE "Updated in past 30 days" = '10324' | 0.084961 |
CREATE TABLE table_name_91 (length_fuel VARCHAR, floor_styling VARCHAR, year_built VARCHAR)
| What is the Length/Fuel of the bus built between 2000-2003 with a high Floor Styling? | SELECT length_fuel FROM table_name_91 WHERE floor_styling = "high" AND year_built = "2000-2003" | SELECT "length_fuel" FROM "table_name_91" WHERE "2000-2003" = "year_built" AND "floor_styling" = "high" | 0.100586 |
CREATE TABLE table_2417345_3 (successor VARCHAR, date_of_successors_formal_installation VARCHAR)
| Who was the successor that was formally installed on March 30, 1870? | SELECT successor FROM table_2417345_3 WHERE date_of_successors_formal_installation = "March 30, 1870" | SELECT "successor" FROM "table_2417345_3" WHERE "March 30, 1870" = "date_of_successors_formal_installation" | 0.104492 |
CREATE TABLE table_204_961 (id DECIMAL, "title" TEXT, "director" TEXT, "production" TEXT, "music" TEXT, "cast" TEXT, "release date" TEXT)
| what film was released before devakanya ? | SELECT "title" FROM table_204_961 WHERE id = (SELECT id FROM table_204_961 WHERE "title" = 'devakanya') - 1 | SELECT "title" FROM "table_204_961" WHERE "id" = (SELECT "id" FROM "table_204_961" WHERE "title" = 'devakanya') - 1 | 0.112305 |
CREATE TABLE Transactions (transaction_id INT, investor_id INT, transaction_type_code VARCHAR, date_of_transaction DATETIME, amount_of_transaction DECIMAL, share_count VARCHAR, other_details VARCHAR)
CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR, transaction_type_description VARCHAR)
CREATE TABLE Transactions_Lots (transaction_id INT, lot_id INT)
CREATE TABLE Investors (investor_id INT, Investor_details VARCHAR)
CREATE TABLE Sales (sales_transaction_id INT, sales_details VARCHAR)
CREATE TABLE Purchases (purchase_transaction_id INT, purchase_details VARCHAR)
CREATE TABLE Lots (lot_id INT, investor_id INT, lot_details VARCHAR)
| Bin all date of transactions into the YEAR interval, and calculate the average the share count for each bin Visualize the result using a trend line, show by the X-axis from high to low. | SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY date_of_transaction DESC | SELECT "date_of_transaction", AVG("share_count") FROM "Transactions" ORDER BY "date_of_transaction" DESC NULLS LAST | 0.112305 |
CREATE TABLE table_name_6 (score VARCHAR, result VARCHAR)
| Which item has a score of 5-1? | SELECT score FROM table_name_6 WHERE result = "5-1" | SELECT "score" FROM "table_name_6" WHERE "5-1" = "result" | 0.055664 |
CREATE TABLE table_2899987_2 (network VARCHAR, region VARCHAR)
| Which network serves the Guerrero region | SELECT network FROM table_2899987_2 WHERE region = "Guerrero" | SELECT "network" FROM "table_2899987_2" WHERE "Guerrero" = "region" | 0.06543 |
CREATE TABLE table_name_41 (college VARCHAR, overall VARCHAR, round VARCHAR)
| What is the college when the over is larger than 15 in round 7? | SELECT college FROM table_name_41 WHERE overall > 15 AND round = 7 | SELECT "college" FROM "table_name_41" WHERE "overall" > 15 AND "round" = 7 | 0.072266 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| what is the minimum days of hospital stay of patients who were born after year 2064. | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2064" | SELECT MIN("demographic"."days_stay") FROM "demographic" WHERE "2064" < "demographic"."dob_year" | 0.09375 |
CREATE TABLE swimmer (ID INT, name TEXT, Nationality TEXT, meter_100 FLOAT, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT)
CREATE TABLE record (ID INT, Result TEXT, Swimmer_ID INT, Event_ID INT)
CREATE TABLE stadium (ID INT, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT)
CREATE TABLE event (ID INT, Name TEXT, Stadium_ID INT, Year TEXT)
| Plot id by grouped by name as a bar graph, and I want to display from high to low by the Y-axis. | SELECT name, ID FROM swimmer ORDER BY ID DESC | SELECT "name", "ID" FROM "swimmer" ORDER BY "ID" DESC NULLS LAST | 0.0625 |
CREATE TABLE table_18420 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
| Name the candidates for massachusetts 8 | SELECT "Candidates" FROM table_18420 WHERE "District" = 'Massachusetts 8' | SELECT "Candidates" FROM "table_18420" WHERE "District" = 'Massachusetts 8' | 0.073242 |
CREATE TABLE table_56153 ("Team" TEXT, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Diff" FLOAT)
| What is the average number lost with a difference of -16, 19 points, and more than 24 against? | SELECT AVG("Lost") FROM table_56153 WHERE "Diff" > '-16' AND "Points" = '19' AND "Against" > '24' | SELECT AVG("Lost") FROM "table_56153" WHERE "Against" > '24' AND "Diff" > '-16' AND "Points" = '19' | 0.09668 |
CREATE TABLE table_name_98 (names VARCHAR, class VARCHAR)
| What is the name of the locomotive with a Glencar class? | SELECT names FROM table_name_98 WHERE class = "glencar" | SELECT "names" FROM "table_name_98" WHERE "class" = "glencar" | 0.05957 |
CREATE TABLE table_4391 ("State" TEXT, "Interview" FLOAT, "Swimsuit" FLOAT, "Evening gown" FLOAT, "Average" FLOAT)
| Tell me the lowest interview for oklahoma and swimsuit less than 8.8 | SELECT MIN("Interview") FROM table_4391 WHERE "State" = 'oklahoma' AND "Swimsuit" < '8.8' | SELECT MIN("Interview") FROM "table_4391" WHERE "State" = 'oklahoma' AND "Swimsuit" < '8.8' | 0.088867 |
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
| what were the four most frequently prescribed medications that patients were prescribed with within the same hospital visit after being prescribed heparin? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.startdate < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate", "admissions"."hadm_id" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id"), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "prescriptions"."startdate" < "t2"."startdate" WHERE "prescriptions"."drug" = 'heparin' GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" AS "t3" WHERE "t3"."c1" <= 4 | 0.668945 |
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
| when was the last lab test patient 006-168146 has received in 10/last year? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-168146')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', lab.labresulttime) = '10' ORDER BY lab.labresulttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-168146' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "lab"."labresulttime" FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE DATETIME("lab"."labresulttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m', "lab"."labresulttime") = '10' ORDER BY "lab"."labresulttime" DESC NULLS LAST LIMIT 1 | 0.689453 |
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
| tell me the cost of a bilirubin, total, pleural lab test. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total, pleural')) | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'bilirubin, total, pleural' GROUP BY "itemid"), "_u_1" AS (SELECT "labevents"."row_id" FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."itemid" WHERE NOT "_u_0"."" IS NULL GROUP BY "row_id") SELECT DISTINCT "cost"."cost" FROM "cost" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "cost"."event_id" WHERE "cost"."event_type" = 'labevents' AND NOT "_u_1"."" IS NULL | 0.461914 |
CREATE TABLE table_name_81 (award VARCHAR, result VARCHAR, production VARCHAR)
| Which award was An Officer and a Gentleman nominated for? | SELECT award FROM table_name_81 WHERE result = "nominated" AND production = "an officer and a gentleman" | SELECT "award" FROM "table_name_81" WHERE "an officer and a gentleman" = "production" AND "nominated" = "result" | 0.109375 |
CREATE TABLE student (ID VARCHAR, name VARCHAR, dept_name VARCHAR, tot_cred DECIMAL)
CREATE TABLE instructor (ID VARCHAR, name VARCHAR, dept_name VARCHAR, salary DECIMAL)
CREATE TABLE classroom (building VARCHAR, room_number VARCHAR, capacity DECIMAL)
CREATE TABLE takes (ID VARCHAR, course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL, grade VARCHAR)
CREATE TABLE time_slot (time_slot_id VARCHAR, day VARCHAR, start_hr DECIMAL, start_min DECIMAL, end_hr DECIMAL, end_min DECIMAL)
CREATE TABLE section (course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL, building VARCHAR, room_number VARCHAR, time_slot_id VARCHAR)
CREATE TABLE prereq (course_id VARCHAR, prereq_id VARCHAR)
CREATE TABLE course (course_id VARCHAR, title VARCHAR, dept_name VARCHAR, credits DECIMAL)
CREATE TABLE advisor (s_ID VARCHAR, i_ID VARCHAR)
CREATE TABLE teaches (ID VARCHAR, course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL)
CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget DECIMAL)
| Find the name and budget of departments whose budgets are more than the average budget Visualize by bar chart, I want to order from low to high by the x-axis please. | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY dept_name | SELECT "dept_name", "budget" FROM "department" WHERE "budget" > (SELECT AVG("budget") FROM "department") ORDER BY "dept_name" NULLS FIRST | 0.133789 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the number of patients whose admission location is clinic referral/premature and lab test name is calculated total co2? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.label = "Calculated Total CO2" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Calculated Total CO2" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "CLINIC REFERRAL/PREMATURE" = "demographic"."admission_location" | 0.232422 |
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| tell me the difference between the total amount of the input and the output for patient 29410 since 10/18/2100. | SELECT (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 = 29410)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2100-10-18') - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29410)) AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2100-10-18') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 29410 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_4" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_3" ON "_u_3"."" = "icustays"."hadm_id" WHERE NOT "_u_3"."" IS NULL GROUP BY "icustay_id") SELECT (SELECT SUM("inputevents_cv"."amount") FROM "inputevents_cv" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m-%d', "inputevents_cv"."charttime") >= '2100-10-18') - (SELECT SUM("outputevents"."value") FROM "outputevents" LEFT JOIN "_u_4" AS "_u_4" ON "_u_4"."" = "outputevents"."icustay_id" WHERE NOT "_u_4"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") >= '2100-10-18') | 0.913086 |
CREATE TABLE table_178381_1 (church_name VARCHAR, location_of_the_church VARCHAR)
| What's the name of the church in Stavang? | SELECT church_name FROM table_178381_1 WHERE location_of_the_church = "Stavang" | SELECT "church_name" FROM "table_178381_1" WHERE "Stavang" = "location_of_the_church" | 0.083008 |
CREATE TABLE table_8009 ("Game" FLOAT, "Date" TEXT, "Team" TEXT, "Score" TEXT, "High points" TEXT, "High rebounds" TEXT, "High assists" TEXT, "Location Attendance" TEXT, "Record" TEXT)
| What is the game number when the game was against phoenix? | SELECT "Game" FROM table_8009 WHERE "Team" = 'phoenix' | SELECT "Game" FROM "table_8009" WHERE "Team" = 'phoenix' | 0.054688 |
CREATE TABLE farm (farm_id DECIMAL, year DECIMAL, total_horses DECIMAL, working_horses DECIMAL, total_cattle DECIMAL, oxen DECIMAL, bulls DECIMAL, cows DECIMAL, pigs DECIMAL, sheep_and_goats DECIMAL)
CREATE TABLE city (city_id DECIMAL, official_name TEXT, status TEXT, area_km_2 DECIMAL, population DECIMAL, census_ranking TEXT)
CREATE TABLE competition_record (competition_id DECIMAL, farm_id DECIMAL, rank DECIMAL)
CREATE TABLE farm_competition (competition_id DECIMAL, year DECIMAL, theme TEXT, host_city_id DECIMAL, hosts TEXT)
| List the most common type of Status across cities. | SELECT status FROM city GROUP BY status ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "status" FROM "city" GROUP BY "status" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.084961 |
CREATE TABLE Dorm (dormid INT, dorm_name VARCHAR, student_capacity INT, gender VARCHAR)
CREATE TABLE Dorm_amenity (amenid INT, amenity_name VARCHAR)
CREATE TABLE Lives_in (stuid INT, dormid INT, room_number INT)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
CREATE TABLE Has_amenity (dormid INT, amenid INT)
| Find the average age of students living in each dorm and the name of dorm. Plot them as bar chart. | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name | SELECT "dorm_name", AVG("T1"."Age") FROM "Student" AS "T1" JOIN "Lives_in" AS "T2" ON "T1"."stuid" = "T2"."stuid" JOIN "Dorm" AS "T3" ON "T2"."dormid" = "T3"."dormid" GROUP BY "T3"."dorm_name" | 0.1875 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is maximum age of patients whose death status is 0 and admission year is greater than or equal to 2124? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2124" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "0" = "demographic"."expire_flag" AND "2124" <= "demographic"."admityear" | 0.126953 |
CREATE TABLE writes (paperid INT, authorid INT)
CREATE TABLE cite (citingpaperid INT, citedpaperid INT)
CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR)
CREATE TABLE field (fieldid INT)
CREATE TABLE venue (venueid INT, venuename VARCHAR)
CREATE TABLE paperfield (fieldid INT, paperid INT)
CREATE TABLE dataset (datasetid INT, datasetname VARCHAR)
CREATE TABLE paperdataset (paperid INT, datasetid INT)
CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT)
CREATE TABLE journal (journalid INT, journalname VARCHAR)
CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT)
CREATE TABLE author (authorid INT, authorname VARCHAR)
| most cited papers for Semantic Segmentation | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Semantic Segmentation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC | SELECT DISTINCT "cite"."citedpaperid", COUNT("cite"."citedpaperid") FROM "cite" JOIN "paper" ON "cite"."citedpaperid" = "paper"."paperid" JOIN "paperkeyphrase" ON "paper"."paperid" = "paperkeyphrase"."paperid" JOIN "keyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" AND "keyphrase"."keyphrasename" = 'Semantic Segmentation' GROUP BY "cite"."citedpaperid" ORDER BY COUNT("cite"."citedpaperid") DESC NULLS LAST | 0.420898 |
CREATE TABLE table_27069503_2 (conf_record VARCHAR, standings VARCHAR, season VARCHAR)
| What was the conference record for the Pandas when they were first in the standings in the 2003-04 season? | SELECT conf_record FROM table_27069503_2 WHERE standings = "First" AND season = "2003-04" | SELECT "conf_record" FROM "table_27069503_2" WHERE "2003-04" = "season" AND "First" = "standings" | 0.094727 |
CREATE TABLE flight (flno DECIMAL, origin TEXT, destination TEXT, distance DECIMAL, departure_date TIME, arrival_date TIME, price DECIMAL, aid DECIMAL)
CREATE TABLE aircraft (aid DECIMAL, name TEXT, distance DECIMAL)
CREATE TABLE certificate (eid DECIMAL, aid DECIMAL)
CREATE TABLE employee (eid DECIMAL, name TEXT, salary DECIMAL)
| What is the salaray and name of the employee with the most certificates to fly planes more than 5000? | SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "T1"."name" FROM "employee" AS "T1" JOIN "certificate" AS "T2" ON "T1"."eid" = "T2"."eid" JOIN "aircraft" AS "T3" ON "T2"."aid" = "T3"."aid" AND "T3"."distance" > 5000 GROUP BY "T1"."eid" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.230469 |
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| what is the total hospital bill of patient 27172's during their stay? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 27172 GROUP BY "hadm_id") SELECT SUM("cost"."cost") FROM "cost" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "cost"."hadm_id" WHERE NOT "_u_0"."" IS NULL | 0.242188 |
CREATE TABLE table_name_9 (prominence__m_ INT, col__m_ INT)
| Count the Prominence (m) of Col (m) smaller than 0? | SELECT AVG(prominence__m_) FROM table_name_9 WHERE col__m_ < 0 | SELECT AVG("prominence__m_") FROM "table_name_9" WHERE "col__m_" < 0 | 0.066406 |
CREATE TABLE table_22171978_1 (athletic_nickname VARCHAR, location VARCHAR)
| For the location of quezon city , metro manila what is the athletic nickname? | SELECT athletic_nickname FROM table_22171978_1 WHERE location = "Quezon City , Metro Manila" | SELECT "athletic_nickname" FROM "table_22171978_1" WHERE "Quezon City , Metro Manila" = "location" | 0.095703 |
CREATE TABLE table_10061 ("Railway" TEXT, "Builder" TEXT, "Built" TEXT, "Wheels" TEXT, "Location" TEXT, "ObjectNumber" TEXT)
| Who was the Builder when the wheels were 4-4-0 and the railway was GCR? | SELECT "Builder" FROM table_10061 WHERE "Wheels" = '4-4-0' AND "Railway" = 'gcr' | SELECT "Builder" FROM "table_10061" WHERE "Railway" = 'gcr' AND "Wheels" = '4-4-0' | 0.080078 |
CREATE TABLE table_62129 ("Year" FLOAT, "Grand Slam" TEXT, "Round" TEXT, "Winner" TEXT, "Loser" TEXT)
| What is the round when Grand Slam was the Davis Cup? | SELECT "Round" FROM table_62129 WHERE "Grand Slam" = 'davis cup' | SELECT "Round" FROM "table_62129" WHERE "Grand Slam" = 'davis cup' | 0.064453 |
CREATE TABLE actor (Actor_ID INT, Name TEXT, Musical_ID INT, Character TEXT, Duration TEXT, age INT)
CREATE TABLE musical (Musical_ID INT, Name TEXT, Year INT, Award TEXT, Category TEXT, Nominee TEXT, Result TEXT)
| Return a bar chart on how many musicals has each nominee been nominated for?, and could you order the total number in desc order? | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC | SELECT "Nominee", COUNT(*) FROM "musical" GROUP BY "Nominee" ORDER BY COUNT(*) DESC NULLS LAST | 0.091797 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| How many of the widowed patients had chronic kidney disease (stage iv (severe))? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Chronic kidney disease, Stage IV (severe)" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Chronic kidney disease, Stage IV (severe)" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "WIDOWED" = "demographic"."marital_status" | 0.253906 |
CREATE TABLE table_11677100_16 (position VARCHAR, hometown VARCHAR)
| What positions were drafted from Las Vegas, NV? | SELECT position FROM table_11677100_16 WHERE hometown = "Las Vegas, NV" | SELECT "position" FROM "table_11677100_16" WHERE "Las Vegas, NV" = "hometown" | 0.075195 |
CREATE TABLE table_30611 ("Callsign" TEXT, "City of license" TEXT, "Virtual channel" TEXT, "Digital channel" TEXT, "Network" TEXT)
| What city licensed the broadcast on virtual channel 8.2? | SELECT "City of license" FROM table_30611 WHERE "Virtual channel" = '8.2' | SELECT "City of license" FROM "table_30611" WHERE "Virtual channel" = '8.2' | 0.073242 |
CREATE TABLE table_name_68 (opponent VARCHAR, edition VARCHAR)
| Who is the opponent for the 1985 World Group i edition? | SELECT opponent FROM table_name_68 WHERE edition = "1985 world group i" | SELECT "opponent" FROM "table_name_68" WHERE "1985 world group i" = "edition" | 0.075195 |
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE member_of_club (stuid DECIMAL, clubid DECIMAL, position TEXT)
CREATE TABLE club (clubid DECIMAL, clubname TEXT, clubdesc TEXT, clublocation TEXT)
| Find all the male members of club 'Hopkins Student Enterprises'. Show the first name and last name. | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M" | SELECT "t3"."fname", "t3"."lname" FROM "club" AS "t1" JOIN "member_of_club" AS "t2" ON "t1"."clubid" = "t2"."clubid" JOIN "student" AS "t3" ON "M" = "t3"."sex" AND "t2"."stuid" = "t3"."stuid" WHERE "Hopkins Student Enterprises" = "t1"."clubname" | 0.239258 |
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
| how many current patients was there. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL | SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" WHERE "admissions"."dischtime" IS NULL | 0.102539 |
CREATE TABLE table_30672 ("Couple" TEXT, "Style" TEXT, "Music" TEXT, "Trine Dehli Cleve" FLOAT, "Tor Fl\\u00f8ysvik" FLOAT, "Karianne Gulliksen" FLOAT, "Christer Tornell" FLOAT, "Total" FLOAT)
| What is the total score received by the couple that danced to ' ymca ' village people? | SELECT MAX("Total") FROM table_30672 WHERE "Music" = ' YMCA "— Village People' | SELECT MAX("Total") FROM "table_30672" WHERE "Music" = ' YMCA "— Village People' | 0.078125 |
CREATE TABLE table_63553 ("Pick" FLOAT, "Team" TEXT, "Player" TEXT, "Position" TEXT, "College" TEXT)
| What college was picked later than 122 by the Boston Patriots? | SELECT "College" FROM table_63553 WHERE "Pick" > '122' AND "Team" = 'boston patriots' | SELECT "College" FROM "table_63553" WHERE "Pick" > '122' AND "Team" = 'boston patriots' | 0.084961 |
CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR)
| List all names of courses with 1 credit? | SELECT CName FROM COURSE WHERE Credits = 1 | SELECT "CName" FROM "COURSE" WHERE "Credits" = 1 | 0.046875 |
CREATE TABLE campuses (campus VARCHAR, county VARCHAR, YEAR VARCHAR)
| Which university is in Los Angeles county and opened after 1950? | SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950 | SELECT "campus" FROM "campuses" WHERE "Los Angeles" = "county" AND "YEAR" > 1950 | 0.078125 |
CREATE TABLE table_77076 ("Player" TEXT, "Nationality" TEXT, "Jersey Number ( s ) " FLOAT, "Position" TEXT, "Years" TEXT, "From" TEXT)
| Who was the player that was from west virginia tech? | SELECT "Player" FROM table_77076 WHERE "From" = 'west virginia tech' | SELECT "Player" FROM "table_77076" WHERE "From" = 'west virginia tech' | 0.068359 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| How many patients diagnosed with poisoning by other opiates and related narcotics had a psychiatric facility-partial hospitalization discharge? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.long_title = "Poisoning by other opiates and related narcotics" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Poisoning by other opiates and related narcotics" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "DISCH-TRAN TO PSYCH HOSP" = "demographic"."discharge_location" | 0.28125 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| provide the number of patients whose primary disease is s/p fall and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Ascites" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Ascites" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "S/P FALL" = "demographic"."diagnosis" | 0.194336 |
CREATE TABLE table_65824 ("Game" FLOAT, "Date" TEXT, "Location" TEXT, "Time" TEXT, "Attendance" FLOAT)
| What date was at Oakland-Alameda County Coliseum with a time of 3:40 and a game less than 5? | SELECT "Date" FROM table_65824 WHERE "Game" < '5' AND "Location" = 'oakland-alameda county coliseum' AND "Time" = '3:40' | SELECT "Date" FROM "table_65824" WHERE "Game" < '5' AND "Location" = 'oakland-alameda county coliseum' AND "Time" = '3:40' | 0.119141 |
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
| According to Other requirements which courses in Special African Art should be taken ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Special African Art%' OR course.description LIKE '%Special African Art%' OR course.name LIKE '%Special African Art%') AND program_course.category LIKE '%Other%' | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "area" ON ("area"."area" LIKE '%Special African Art%' OR "course"."description" LIKE '%Special African Art%' OR "course"."name" LIKE '%Special African Art%') AND "area"."course_id" = "course"."course_id" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%Other%' | 0.410156 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients were diagnosed with an unspecified disorder of kidney and ureter and treated with a main drug type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified disorder of kidney and ureter" AND prescriptions.drug_type = "MAIN" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Unspecified disorder of kidney and ureter" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "MAIN" = "prescriptions"."drug_type" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.320313 |
CREATE TABLE club (clubid DECIMAL, clubname TEXT, clubdesc TEXT, clublocation TEXT)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE member_of_club (stuid DECIMAL, clubid DECIMAL, position TEXT)
| How many members of 'Bootup Baltimore' are older than 18? | SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.age > 18 | SELECT COUNT(*) FROM "club" AS "t1" JOIN "member_of_club" AS "t2" ON "t1"."clubid" = "t2"."clubid" JOIN "student" AS "t3" ON "t2"."stuid" = "t3"."stuid" AND "t3"."age" > 18 WHERE "Bootup Baltimore" = "t1"."clubname" | 0.209961 |
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE area (course_id INT, area VARCHAR)
| Is section for ENGR 561 available between 9:00 and 6:00 ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '6:00' AND course_offering.start_time >= '9:00' AND course.course_id = course_offering.course_id AND course.department = 'ENGR' AND course.number = 561 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT DISTINCT "course_offering"."end_time", "course_offering"."section_number", "course_offering"."start_time" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" AND "course_offering"."end_time" <= '6:00' AND "course_offering"."start_time" >= '9:00' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'WN' AND "semester"."year" = 2016 WHERE "course"."department" = 'ENGR' AND "course"."number" = 561 | 0.483398 |
CREATE TABLE table_26362472_1 (election_date VARCHAR, province VARCHAR)
| What are the election date for elections held in the province of Albacete? | SELECT election_date FROM table_26362472_1 WHERE province = "Albacete" | SELECT "election_date" FROM "table_26362472_1" WHERE "Albacete" = "province" | 0.074219 |
CREATE TABLE table_name_99 (home VARCHAR, record VARCHAR)
| Who had a 33-30-8 record at home? | SELECT home FROM table_name_99 WHERE record = "33-30-8" | SELECT "home" FROM "table_name_99" WHERE "33-30-8" = "record" | 0.05957 |
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
| what were the three most commonly prescribed drugs for patients 50s during this year? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."age" <= 59 AND "admissions"."age" >= 50 GROUP BY "hadm_id"), "t1" AS (SELECT "prescriptions"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL GROUP BY "prescriptions"."drug") SELECT "t1"."drug" FROM "t1" AS "t1" WHERE "t1"."c1" <= 3 | 0.554688 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| provide the number of patients diagnosed with unspecified rheumatic heart disease who had other body fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Rheumatic heart dis NOS" AND lab.fluid = "Other Body Fluid" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Rheumatic heart dis NOS" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "Other Body Fluid" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.282227 |
CREATE TABLE allergy_type (allergy TEXT, allergytype TEXT)
CREATE TABLE has_allergy (stuid DECIMAL, allergy TEXT)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
| What are the student ids for students over 20 years old? | SELECT stuid FROM student WHERE age > 20 | SELECT "stuid" FROM "student" WHERE "age" > 20 | 0.044922 |
CREATE TABLE table_2883 ("Rank" FLOAT, "Rider" TEXT, "Mon 24 Aug" TEXT, "Tues 25 Aug" TEXT, "Wed 26 Aug" TEXT, "Thurs 27 Aug" TEXT, "Fri 28 Aug" TEXT, "Sat 29 Aug" TEXT)
| When 22' 37.06 100.090mph is the time for Monday August 24th how many times are there for Friday August 28th? | SELECT COUNT("Fri 28 Aug") FROM table_2883 WHERE "Mon 24 Aug" = '22'' 37.06 100.090mph' | SELECT COUNT("Fri 28 Aug") FROM "table_2883" WHERE "Mon 24 Aug" = '22\' 37.06 100.090mph' | 0.086914 |
CREATE TABLE Lessons (staff_id VARCHAR)
CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
| What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? | SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | SELECT AVG("price") FROM "Lessons" AS "T1" JOIN "Staff" AS "T2" ON "Janessa" = "T2"."first_name" AND "Sawayn" = "T2"."last_name" AND "T1"."staff_id" = "T2"."staff_id" | 0.162109 |
CREATE TABLE table_22206 ("No." FLOAT, "Date" TEXT, "Tournament" TEXT, "Winning score" TEXT, "To par" TEXT, "Margin of victory" TEXT, "Runner ( s ) -up" TEXT, "Winners share ( $ ) " FLOAT)
| List the total numbers of Evian Masters tournaments. | SELECT MAX("No.") FROM table_22206 WHERE "Tournament" = 'Evian Masters' | SELECT MAX("No.") FROM "table_22206" WHERE "Tournament" = 'Evian Masters' | 0.071289 |
CREATE TABLE table_57556 ("Runs" TEXT, "Against" TEXT, "City/Country" TEXT, "Venue" TEXT, "Result" TEXT, "Year" TEXT)
| Name the place where adelaide oval is | SELECT "City/Country" FROM table_57556 WHERE "Venue" = 'adelaide oval' | SELECT "City/Country" FROM "table_57556" WHERE "Venue" = 'adelaide oval' | 0.070313 |
CREATE TABLE table_30098144_2 (jockey VARCHAR, race VARCHAR)
| List the rider for the doncaster handicap compeition. | SELECT jockey FROM table_30098144_2 WHERE race = "Doncaster Handicap" | SELECT "jockey" FROM "table_30098144_2" WHERE "Doncaster Handicap" = "race" | 0.073242 |
CREATE TABLE faculty (facid DECIMAL, lname TEXT, fname TEXT, rank TEXT, sex TEXT, phone DECIMAL, room TEXT, building TEXT)
CREATE TABLE activity (actid DECIMAL, activity_name TEXT)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE participates_in (stuid DECIMAL, actid DECIMAL)
CREATE TABLE faculty_participates_in (facid DECIMAL, actid DECIMAL)
| How many activities do we have? | SELECT COUNT(*) FROM activity | SELECT COUNT(*) FROM "activity" | 0.030273 |
CREATE TABLE table_19041 ("Episode" TEXT, "Original Air Date" TEXT, "Viewers ( millions ) " TEXT, "Presenter" TEXT, "Location" TEXT)
| Where was held the ceremony for the 12th Pride of Britain Awards? | SELECT "Location" FROM table_19041 WHERE "Episode" = '12th Pride of Britain Awards' | SELECT "Location" FROM "table_19041" WHERE "Episode" = '12th Pride of Britain Awards' | 0.083008 |
CREATE TABLE table_25293 ("Station" TEXT, "Extension" TEXT, "City/Neighborhood" TEXT, "Projected opening" FLOAT, "Transit Connections" TEXT, "Park and ride?" TEXT)
| Name the extension for university of washington | SELECT "Extension" FROM table_25293 WHERE "City/Neighborhood" = 'University of Washington' | SELECT "Extension" FROM "table_25293" WHERE "City/Neighborhood" = 'University of Washington' | 0.089844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.