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 table_name_64 (scorers VARCHAR, opponent VARCHAR, date VARCHAR)
| Who were the scorers in the game against neuch tel xamax played on 10 December 1985? | SELECT scorers FROM table_name_64 WHERE opponent = "neuchâtel xamax" AND date = "10 december 1985" | SELECT "scorers" FROM "table_name_64" WHERE "10 december 1985" = "date" AND "neuchâtel xamax" = "opponent" | 0.103516 |
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description 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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense 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 PostTags (PostId DECIMAL, TagId DECIMAL)
| top 100 users by reputation who haven't asked any questions. | SELECT Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC), u.Id AS "user_link", u.Reputation FROM Users AS u WHERE u.Id NOT IN (SELECT DISTINCT OwnerUserId FROM Posts WHERE PostTypeId = 1 AND OwnerUserId != '') ORDER BY u.Reputation DESC LIMIT 100 | SELECT "Ranking" = ROW_NUMBER() OVER (ORDER BY "Reputation" DESC NULLS LAST), "u"."Id" AS "user_link", "u"."Reputation" FROM "Users" AS "u" WHERE NOT "u"."Id" IN (SELECT DISTINCT "OwnerUserId" FROM "Posts" WHERE "OwnerUserId" <> '' AND "PostTypeId" = 1) ORDER BY "u"."Reputation" DESC NULLS LAST LIMIT 100 | 0.297852 |
CREATE TABLE table_28547 ("Round" TEXT, "Circuit" TEXT, "Date" TEXT, "Pole Position" TEXT, "Fastest Lap" TEXT, "Winning Driver" TEXT, "Winning Team" TEXT)
| Where the fastest lap is Mike Rockenfeller, who is the winning driver? | SELECT "Winning Driver" FROM table_28547 WHERE "Fastest Lap" = 'Mike Rockenfeller' | SELECT "Winning Driver" FROM "table_28547" WHERE "Fastest Lap" = 'Mike Rockenfeller' | 0.082031 |
CREATE TABLE table_23286158_11 (score VARCHAR, game VARCHAR)
| What is the score in game 3? | SELECT score FROM table_23286158_11 WHERE game = 3 | SELECT "score" FROM "table_23286158_11" WHERE "game" = 3 | 0.054688 |
CREATE TABLE department (Department_ID INT, Name TEXT, Creation TEXT, Ranking INT, Budget_in_Billions FLOAT, Num_Employees FLOAT)
CREATE TABLE management (department_ID INT, head_ID INT, temporary_acting TEXT)
CREATE TABLE head (head_ID INT, name TEXT, born_state TEXT, age FLOAT)
| Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes', and could you rank in ascending by the Y-axis? | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY SUM(Num_Employees) | SELECT "Name", SUM("Num_Employees") FROM "department" AS "T1" JOIN "management" AS "T2" ON "T1"."department_ID" = "T2"."department_ID" AND "T2"."temporary_acting" = 'Yes' GROUP BY "Name" ORDER BY SUM("Num_Employees") NULLS FIRST | 0.222656 |
CREATE TABLE table_name_60 (russian VARCHAR, ratio VARCHAR)
| What Russian has a Ratio of 40? | SELECT russian FROM table_name_60 WHERE ratio = "40" | SELECT "russian" FROM "table_name_60" WHERE "40" = "ratio" | 0.056641 |
CREATE TABLE table_name_84 (circuit VARCHAR, winner VARCHAR, date VARCHAR)
| What is the circuit on 19 Apr with Craig Lowndes as the winner? | SELECT circuit FROM table_name_84 WHERE winner = "craig lowndes" AND date = "19 apr" | SELECT "circuit" FROM "table_name_84" WHERE "19 apr" = "date" AND "craig lowndes" = "winner" | 0.089844 |
CREATE TABLE table_name_88 (name VARCHAR, champion VARCHAR)
| What's the name when Henrik Sundstr m was champion? | SELECT name FROM table_name_88 WHERE champion = "henrik sundström" | SELECT "name" FROM "table_name_88" WHERE "champion" = "henrik sundström" | 0.070313 |
CREATE TABLE table_11622255_1 (location VARCHAR, tournament VARCHAR)
| what's the location where tournament is raley's senior gold rush | SELECT location FROM table_11622255_1 WHERE tournament = "Raley's Senior Gold Rush" | SELECT "location" FROM "table_11622255_1" WHERE "Raley's Senior Gold Rush" = "tournament" | 0.086914 |
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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom 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 d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name 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 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 procedures_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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost 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 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)
| patient 9294 was prescribed any medication during this year? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9294) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 9294 GROUP BY "hadm_id") SELECT COUNT(*) > 0 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 | 0.364258 |
CREATE TABLE table_name_15 (loss VARCHAR, date VARCHAR)
| Who did the Blue Jays lose to on July 16? | SELECT loss FROM table_name_15 WHERE date = "july 16" | SELECT "loss" FROM "table_name_15" WHERE "date" = "july 16" | 0.057617 |
CREATE TABLE table_name_99 (score VARCHAR, home VARCHAR, date VARCHAR)
| What is the Score of the Toronto Maple Leafs home game on February 1? | SELECT score FROM table_name_99 WHERE home = "toronto maple leafs" AND date = "february 1" | SELECT "score" FROM "table_name_99" WHERE "date" = "february 1" AND "home" = "toronto maple leafs" | 0.095703 |
CREATE TABLE table_1140090_6 (circuit VARCHAR, winning_driver VARCHAR)
| What circuit did Clay Regazzoni win? | SELECT circuit FROM table_1140090_6 WHERE winning_driver = "Clay Regazzoni" | SELECT "circuit" FROM "table_1140090_6" WHERE "Clay Regazzoni" = "winning_driver" | 0.079102 |
CREATE TABLE table_48106 ("Rank" FLOAT, "Title" TEXT, "Studio" TEXT, "Director" TEXT, "Worldwide Gross" TEXT)
| What was the worldwide gross for the film directed by joe pytka? | SELECT "Worldwide Gross" FROM table_48106 WHERE "Director" = 'joe pytka' | SELECT "Worldwide Gross" FROM "table_48106" WHERE "Director" = 'joe pytka' | 0.072266 |
CREATE TABLE table_name_8 (end_date VARCHAR, governor VARCHAR, term VARCHAR)
| What is the end date of the term for Governor of richard j. oglesby, and a Term of 1885 1889? | SELECT end_date FROM table_name_8 WHERE governor = "richard j. oglesby" AND term = "1885–1889" | SELECT "end_date" FROM "table_name_8" WHERE "1885–1889" = "term" AND "governor" = "richard j. oglesby" | 0.099609 |
CREATE TABLE table_name_68 (Id VARCHAR)
| What 2011 has 4r as the 2008? | SELECT 2011 FROM table_name_68 WHERE 2008 = "4r" | SELECT 2011 FROM "table_name_68" WHERE "4r" = 2008 | 0.048828 |
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime 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)
| tell me the top three most common diagnoses in patients in the age of 50s until 3 years ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | WITH "_u_0" AS (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."age" <= 59 AND "patient"."age" >= 50 GROUP BY "patientunitstayid"), "t1" AS (SELECT "diagnosis"."diagnosisname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnosis" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "diagnosis"."patientunitstayid" WHERE DATETIME("diagnosis"."diagnosistime") <= DATETIME(CURRENT_TIME(), '-3 year') AND NOT "_u_0"."" IS NULL GROUP BY "diagnosis"."diagnosisname") SELECT "t1"."diagnosisname" FROM "t1" AS "t1" WHERE "t1"."c1" <= 3 | 0.550781 |
CREATE TABLE table_76875 ("Date" TEXT, "Round" TEXT, "Opponents" TEXT, "H / A" TEXT, "Result F \\u2013 A" TEXT, "Scorers" TEXT, "Attendance" FLOAT)
| What is the lowest attendance when the h/A is H in the Semi-Finals Second Leg? | SELECT MIN("Attendance") FROM table_76875 WHERE "H / A" = 'h' AND "Round" = 'semi-finals second leg' | SELECT MIN("Attendance") FROM "table_76875" WHERE "H / A" = 'h' AND "Round" = 'semi-finals second leg' | 0.099609 |
CREATE TABLE table_14544 ("Tournament" TEXT, "2007" TEXT, "2008" TEXT, "2009" TEXT, "2011" TEXT, "2012" TEXT, "2013" TEXT)
| How many sets were played in the 2011 tournament, in which 2R were played in 2008? | SELECT "2011" FROM table_14544 WHERE "2008" = '2r' | SELECT "2011" FROM "table_14544" WHERE "2008" = '2r' | 0.050781 |
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 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)
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)
| count the number of patients whose diagnoses short title is chr syst/diastl hrt fail and drug route is iv bolus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail" AND prescriptions.route = "IV BOLUS" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Chr syst/diastl hrt fail" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "IV BOLUS" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.304688 |
CREATE TABLE table_30024 ("Year" FLOAT, "Location" TEXT, "Distance ( miles ) " FLOAT, "Rider Names" TEXT, "Horse Name" TEXT, "Best-Conditioned Horse" TEXT)
| What are all the Riders whose best-conditioned horse is Basia? | SELECT "Rider Names" FROM table_30024 WHERE "Best-Conditioned Horse" = 'Basia' | SELECT "Rider Names" FROM "table_30024" WHERE "Best-Conditioned Horse" = 'Basia' | 0.078125 |
CREATE TABLE table_name_17 (genre VARCHAR, game_modes VARCHAR, chinese_title VARCHAR)
| What is the genre of the Chinese title , which has a single-player game mode? | SELECT genre FROM table_name_17 WHERE game_modes = "single-player" AND chinese_title = "摸摸瓦力欧制造" | SELECT "genre" FROM "table_name_17" WHERE "chinese_title" = "摸摸瓦力欧制造" AND "game_modes" = "single-player" | 0.101563 |
CREATE TABLE table_name_70 (caps INT, club_province VARCHAR, date_of_birth__age_ VARCHAR)
| Which Caps is the lowest one that has a Club/province of ospreys, and a Date of Birth (Age) of 19 september 1985? | SELECT MIN(caps) FROM table_name_70 WHERE club_province = "ospreys" AND date_of_birth__age_ = "19 september 1985" | SELECT MIN("caps") FROM "table_name_70" WHERE "19 september 1985" = "date_of_birth__age_" AND "club_province" = "ospreys" | 0.118164 |
CREATE TABLE table_66228 ("!Event" FLOAT, "Round" TEXT, "Surface" TEXT, "Winner" TEXT, "Opponent" TEXT, "Result" TEXT)
| How many events did clay win? | SELECT COUNT("!Event") FROM table_66228 WHERE "Winner" = 'clay' | SELECT COUNT("!Event") FROM "table_66228" WHERE "Winner" = 'clay' | 0.063477 |
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 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 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 patients whose ethnicity is white and drug route is ou? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "OU" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "OU" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "WHITE" = "demographic"."ethnicity" | 0.21582 |
CREATE TABLE table_name_10 (attendance VARCHAR, tie_no VARCHAR)
| What is the Attendance of Tie no 3? | SELECT attendance FROM table_name_10 WHERE tie_no = "3" | SELECT "attendance" FROM "table_name_10" WHERE "3" = "tie_no" | 0.05957 |
CREATE TABLE party_events (Event_ID INT, Event_Name TEXT, Party_ID INT, Member_in_charge_ID INT)
CREATE TABLE member (Member_ID INT, Member_Name TEXT, Party_ID TEXT, In_office TEXT)
CREATE TABLE party (Party_ID INT, Minister TEXT, Took_office TEXT, Left_office TEXT, Region_ID INT, Party_name TEXT)
CREATE TABLE region (Region_ID INT, Region_name TEXT, Date TEXT, Label TEXT, Format TEXT, Catalogue TEXT)
| Compare the total number of each minister using a bar graph, list the number of minister in ascending order. | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) | SELECT "Minister", COUNT("Minister") FROM "party" GROUP BY "Minister" ORDER BY COUNT("Minister") NULLS FIRST | 0.105469 |
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_prerequisite (pre_course_id INT, course_id 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 requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
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 area (course_id INT, area 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 offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
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_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 instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
| LHC 399 is taught by Stephen Lusmann ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LHC' AND course.number = 399 AND instructor.name LIKE '%Stephen Lusmann%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id | SELECT COUNT(*) > 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Stephen Lusmann%' WHERE "course"."department" = 'LHC' AND "course"."number" = 399 | 0.405273 |
CREATE TABLE table_14650162_1 (pick__number VARCHAR, position VARCHAR)
| How many picks played Tight end? | SELECT COUNT(pick__number) FROM table_14650162_1 WHERE position = "Tight End" | SELECT COUNT("pick__number") FROM "table_14650162_1" WHERE "Tight End" = "position" | 0.081055 |
CREATE TABLE table_26070 ("Period" TEXT, "Live births per year" TEXT, "Deaths per year" TEXT, "Natural change per year" TEXT, "CBR*" TEXT, "CDR*" TEXT, "NC*" TEXT, "TFR*" TEXT, "IMR*" FLOAT, "Life expectancy total" TEXT, "Life expectancy males" TEXT, "Life expectancy females" TEXT)
| How many deaths per year have 66.3 as the life expectancy females? | SELECT "Deaths per year" FROM table_26070 WHERE "Life expectancy females" = '66.3' | SELECT "Deaths per year" FROM "table_26070" WHERE "Life expectancy females" = '66.3' | 0.082031 |
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 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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
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 CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
| Search for Error in Title. | SELECT Title FROM Posts WHERE Title LIKE '%Exception%' | SELECT "Title" FROM "Posts" WHERE "Title" LIKE '%Exception%' | 0.058594 |
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)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, 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 countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
| For those employees who did not have any job in the past, show me about the change of employee_id over hire_date in a line chart, and order in asc by the X. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE | SELECT "HIRE_DATE", "EMPLOYEE_ID" FROM "employees" WHERE NOT "EMPLOYEE_ID" IN (SELECT "EMPLOYEE_ID" FROM "job_history") ORDER BY "HIRE_DATE" NULLS FIRST | 0.148438 |
CREATE TABLE table_19265 ("Player" TEXT, "Position" TEXT, "Starter" TEXT, "Touchdowns" FLOAT, "Extra points" FLOAT, "Field goals" FLOAT, "Points" FLOAT)
| How many points did Albert Herrnstein make? | SELECT "Points" FROM table_19265 WHERE "Player" = 'Albert Herrnstein' | SELECT "Points" FROM "table_19265" WHERE "Player" = 'Albert Herrnstein' | 0.069336 |
CREATE TABLE nomination (artwork_id DECIMAL, festival_id DECIMAL, result TEXT)
CREATE TABLE artwork (artwork_id DECIMAL, type TEXT, name TEXT)
CREATE TABLE festival_detail (festival_id DECIMAL, festival_name TEXT, chair_name TEXT, location TEXT, year DECIMAL, num_of_audience DECIMAL)
| Show the names of the three most recent festivals. | SELECT festival_name FROM festival_detail ORDER BY year DESC LIMIT 3 | SELECT "festival_name" FROM "festival_detail" ORDER BY "year" DESC NULLS LAST LIMIT 3 | 0.083008 |
CREATE TABLE table_78529 ("Superlative" TEXT, "Actor" TEXT, "Record Set" TEXT, "Year" TEXT, "Notes" TEXT)
| What year did actor Richard Farnsworth get nominated for an award? | SELECT "Year" FROM table_78529 WHERE "Actor" = 'richard farnsworth' | SELECT "Year" FROM "table_78529" WHERE "Actor" = 'richard farnsworth' | 0.067383 |
CREATE TABLE table_name_20 (school_club_team VARCHAR, player VARCHAR)
| Which team was Roy de Walt a player on? | SELECT school_club_team FROM table_name_20 WHERE player = "roy de walt" | SELECT "school_club_team" FROM "table_name_20" WHERE "player" = "roy de walt" | 0.075195 |
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
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 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 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 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_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
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 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 procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime 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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| until 2104, what were the five most frequently prescribed medications for the female patients of the 30s in the same hospital encounter after they had been diagnosed with long-term use anticoagul? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use anticoagul') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') 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 WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'f') AND admissions.age BETWEEN 30 AND 39 AND STRFTIME('%y', prescriptions.startdate) <= '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5 | WITH "_u_1" AS (SELECT "patients"."subject_id" FROM "patients" WHERE "patients"."gender" = 'f' GROUP BY "subject_id"), "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate", "admissions"."hadm_id" FROM "prescriptions" JOIN "admissions" ON "admissions"."age" <= 39 AND "admissions"."age" >= 30 AND "admissions"."hadm_id" = "prescriptions"."hadm_id" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "admissions"."subject_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "prescriptions"."startdate") <= '2104'), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'long-term use anticoagul' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."startdate" WHERE STRFTIME('%y', "diagnoses_icd"."charttime") <= '2104' GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" AS "t3" WHERE "t3"."c1" <= 5 | 1.15332 |
CREATE TABLE table_name_22 (sport VARCHAR, event VARCHAR)
| Which sport has 94kg men's weightlifting as one of its events? | SELECT sport FROM table_name_22 WHERE event = "94kg men's weightlifting" | SELECT "sport" FROM "table_name_22" WHERE "94kg men's weightlifting" = "event" | 0.076172 |
CREATE TABLE table_184803_4 (commentator VARCHAR, broadcaster VARCHAR)
| how many people commentated where broadcaster is orf | SELECT COUNT(commentator) FROM table_184803_4 WHERE broadcaster = "ORF" | SELECT COUNT("commentator") FROM "table_184803_4" WHERE "ORF" = "broadcaster" | 0.075195 |
CREATE TABLE table_30593 ("Version" TEXT, "Release" TEXT, "Release date" TEXT, "End of maintenance" TEXT, "Requirement" TEXT)
| What's the number of the 1.0.9 release version? | SELECT COUNT("Version") FROM table_30593 WHERE "Release" = '1.0.9' | SELECT COUNT("Version") FROM "table_30593" WHERE "Release" = '1.0.9' | 0.066406 |
CREATE TABLE table_47513 ("Team A" TEXT, "Team C" TEXT, "Team D" TEXT, "Team E" TEXT, "Team F" TEXT)
| Who is team c when dhez javier is team e? | SELECT "Team C" FROM table_47513 WHERE "Team E" = 'dhez javier' | SELECT "Team C" FROM "table_47513" WHERE "Team E" = 'dhez javier' | 0.063477 |
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE procedures_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 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)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name 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 d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 d_icd_diagnoses (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 d_icd_procedures (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 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)
| when is the first time that patient 17435 has had the bicarbonate minimum until 54 months ago? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17435) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-54 month') ORDER BY labevents.valuenum, labevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 17435 GROUP BY "hadm_id"), "_u_1" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'bicarbonate' GROUP BY "itemid") SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."hadm_id" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "labevents"."itemid" WHERE DATETIME("labevents"."charttime") <= DATETIME(CURRENT_TIME(), '-54 month') AND NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."valuenum" NULLS FIRST, "labevents"."charttime" NULLS FIRST LIMIT 1 | 0.625977 |
CREATE TABLE table_1341884_23 (candidates VARCHAR, district VARCHAR)
| Name the candidates for massachusetts 8 | SELECT candidates FROM table_1341884_23 WHERE district = "Massachusetts 8" | SELECT "candidates" FROM "table_1341884_23" WHERE "Massachusetts 8" = "district" | 0.078125 |
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)
| first album released | SELECT "album" FROM table_204_394 ORDER BY "year" LIMIT 1 | SELECT "album" FROM "table_204_394" ORDER BY "year" NULLS FIRST LIMIT 1 | 0.069336 |
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime 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 d_icd_procedures (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 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 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 chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_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 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 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 transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
| has patient 10266 been prescribed labetalol, d5 1/2ns, or insulin a year before? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 10266 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_0"."" IS NULL | 0.430664 |
CREATE TABLE table_204_641 (id DECIMAL, "pos" TEXT, "no" DECIMAL, "driver" TEXT, "constructor" TEXT, "laps" DECIMAL, "time/retired" TEXT, "grid" DECIMAL, "points" DECIMAL)
| what number of drivers aslo had brabham repco as their constructor ? | SELECT COUNT("driver") FROM table_204_641 WHERE "constructor" = 'brabham-repco' | SELECT COUNT("driver") FROM "table_204_641" WHERE "constructor" = 'brabham-repco' | 0.079102 |
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
| For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and code , and group by attribute founder, and show from high to low by the Name. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | SELECT "T1"."Name", "T1"."Code" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder", "T1"."Name" ORDER BY "T1"."Name" DESC NULLS LAST | 0.185547 |
CREATE TABLE order_items (order_item_id DECIMAL, order_id DECIMAL, product_id DECIMAL, order_quantity TEXT)
CREATE TABLE customer_orders (order_id DECIMAL, customer_id DECIMAL, order_date TIME, order_status_code TEXT)
CREATE TABLE contacts (contact_id DECIMAL, customer_id DECIMAL, gender TEXT, first_name TEXT, last_name TEXT, contact_phone TEXT)
CREATE TABLE products (product_id DECIMAL, product_type_code TEXT, product_name TEXT, product_price DECIMAL)
CREATE TABLE customer_address_history (customer_id DECIMAL, address_id DECIMAL, date_from TIME, date_to TIME)
CREATE TABLE addresses (address_id DECIMAL, line_1_number_building TEXT, city TEXT, zip_postcode TEXT, state_province_county TEXT, country TEXT)
CREATE TABLE customers (customer_id DECIMAL, payment_method_code TEXT, customer_number TEXT, customer_name TEXT, customer_address TEXT, customer_phone TEXT, customer_email TEXT)
| Show the names of customers who use Credit Card payment method and have more than 2 orders. | SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2 | SELECT "T1"."customer_name" FROM "customers" AS "T1" JOIN "customer_orders" AS "T2" ON "T1"."customer_id" = "T2"."customer_id" WHERE "T1"."payment_method_code" = 'Credit Card' GROUP BY "T1"."customer_id" HAVING COUNT(*) > 2 | 0.217773 |
CREATE TABLE table_name_37 (date VARCHAR, opponent VARCHAR)
| On what date was the match against the St. George Illawarra Dragons? | SELECT date FROM table_name_37 WHERE opponent = "st. george illawarra dragons" | SELECT "date" FROM "table_name_37" WHERE "opponent" = "st. george illawarra dragons" | 0.082031 |
CREATE TABLE technician (Team VARCHAR)
| Please show the team that has the most number of technicians. | SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "Team" FROM "technician" GROUP BY "Team" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.086914 |
CREATE TABLE table_25107064_2 (Ends INT, pf VARCHAR)
| Name the least ends won for pf being 78 | SELECT MIN(Ends) AS won FROM table_25107064_2 WHERE pf = 78 | SELECT MIN("Ends") AS "won" FROM "table_25107064_2" WHERE "pf" = 78 | 0.06543 |
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 vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime 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 medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| was there any microbiology report for the sputum, expectorated of patient 025-44495 in 2105? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%y', microlab.culturetakentime) = '2105' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '025-44495' 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 COUNT(*) FROM "microlab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "microlab"."patientunitstayid" WHERE "microlab"."culturesite" = 'sputum, expectorated' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y', "microlab"."culturetakentime") = '2105' | 0.588867 |
CREATE TABLE table_11894 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| If the Home team was st kilda, what was the score of the Away team they played? | SELECT "Away team score" FROM table_11894 WHERE "Home team" = 'st kilda' | SELECT "Away team score" FROM "table_11894" WHERE "Home team" = 'st kilda' | 0.072266 |
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req 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)
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 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 program_course (program_id INT, course_id INT, workload INT, category 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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
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 jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
| What 's my current GPA ? | SELECT DISTINCT total_gpa FROM student WHERE student_id = 1 | SELECT DISTINCT "total_gpa" FROM "student" WHERE "student_id" = 1 | 0.063477 |
CREATE TABLE table_203_359 (id DECIMAL, "outcome" TEXT, "year" DECIMAL, "championship" TEXT, "surface" TEXT, "opponent" TEXT, "score" TEXT)
| how many total wins has he had ? | SELECT COUNT(*) FROM table_203_359 WHERE "outcome" = 'winner' | SELECT COUNT(*) FROM "table_203_359" WHERE "outcome" = 'winner' | 0.061523 |
CREATE TABLE table_55810 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| When was the game played at the Western Oval venue? | SELECT "Date" FROM table_55810 WHERE "Venue" = 'western oval' | SELECT "Date" FROM "table_55810" WHERE "Venue" = 'western oval' | 0.061523 |
CREATE TABLE table_name_87 (score VARCHAR, game VARCHAR)
| What was the score for game 18? | SELECT score FROM table_name_87 WHERE game = 18 | SELECT "score" FROM "table_name_87" WHERE "game" = 18 | 0.051758 |
CREATE TABLE table_65569 ("Game" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Dolphins points" FLOAT, "Opponents" FLOAT, "Record" TEXT, "Attendance" FLOAT)
| What's the Dolphin Points when the attendance was less than 69,313 and had an opponent of the Buffalo Bills? | SELECT AVG("Dolphins points") FROM table_65569 WHERE "Opponent" = 'buffalo bills' AND "Attendance" < '69,313' | SELECT AVG("Dolphins points") FROM "table_65569" WHERE "Attendance" < '69,313' AND "Opponent" = 'buffalo bills' | 0.108398 |
CREATE TABLE table_49556 ("Date" TEXT, "Home team" TEXT, "Score" TEXT, "Away team" TEXT, "Venue" TEXT, "Box Score" TEXT, "Report" TEXT)
| who is the away team on 21 september? | SELECT "Away team" FROM table_49556 WHERE "Date" = '21 september' | SELECT "Away team" FROM "table_49556" WHERE "Date" = '21 september' | 0.06543 |
CREATE TABLE table_38859 ("Year" TEXT, "Theme" TEXT, "Host city" TEXT, "Venue" TEXT, "Hosts" TEXT)
| What is the host city that has Alicia Keys listed as a host? | SELECT "Host city" FROM table_38859 WHERE "Hosts" = 'alicia keys' | SELECT "Host city" FROM "table_38859" WHERE "Hosts" = 'alicia keys' | 0.06543 |
CREATE TABLE table_name_94 (round INT, pick VARCHAR, overall VARCHAR)
| Average round for 22 pick that is overall smaller than 229? | SELECT AVG(round) FROM table_name_94 WHERE pick = 22 AND overall < 229 | SELECT AVG("round") FROM "table_name_94" WHERE "overall" < 229 AND "pick" = 22 | 0.076172 |
CREATE TABLE table_203_336 (id DECIMAL, "#" DECIMAL, "date" TEXT, "opponent" TEXT, "score" TEXT, "win" TEXT, "loss" TEXT, "save" TEXT, "attendance" DECIMAL, "record" TEXT)
| how many days did the attendance not reach 10,000 ? | SELECT COUNT("date") FROM table_203_336 WHERE "attendance" < 10000 | SELECT COUNT("date") FROM "table_203_336" WHERE "attendance" < 10000 | 0.066406 |
CREATE TABLE table_name_67 (school VARCHAR, ihsaa_class VARCHAR, enrollment_08_09 VARCHAR)
| Can you tell me the School that has the IHSAA Class of a, and the Enrollment 08-09 off 244? | SELECT school FROM table_name_67 WHERE ihsaa_class = "a" AND enrollment_08_09 = 244 | SELECT "school" FROM "table_name_67" WHERE "a" = "ihsaa_class" AND "enrollment_08_09" = 244 | 0.088867 |
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 medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
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 microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime 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 vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| how many times did patient 030-53416 had received a antidepressant - doxepin in their last hospital visit? | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND treatment.treatmentname = 'antidepressant - doxepin' | SELECT COUNT(*) FROM "treatment" WHERE "treatment"."patientunitstayid" IN (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."patienthealthsystemstayid" IN (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '030-53416' AND NOT "patient"."hospitaldischargetime" IS NULL ORDER BY "patient"."hospitaladmittime" DESC NULLS LAST LIMIT 1)) AND "treatment"."treatmentname" = 'antidepressant - doxepin' | 0.441406 |
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 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 procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients with private health insurance had ureteral catheterization procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Ureteral catheterization" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Ureteral catheterization" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "Private" = "demographic"."insurance" | 0.236328 |
CREATE TABLE county (County_Id INT, County_name TEXT, Population FLOAT, Zip_code TEXT)
CREATE TABLE party (Party_ID INT, Year FLOAT, Party TEXT, Governor TEXT, Lieutenant_Governor TEXT, Comptroller TEXT, Attorney_General TEXT, US_Senate TEXT)
CREATE TABLE election (Election_ID INT, Counties_Represented TEXT, District INT, Delegate TEXT, Party INT, First_Elected FLOAT, Committee TEXT)
| Use a bar chart to show the number of delegates in each county, and sort x-axis from low to high order. | SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name ORDER BY County_name | SELECT "County_name", COUNT("County_name") FROM "county" AS "T1" JOIN "election" AS "T2" ON "T1"."County_Id" = "T2"."District" GROUP BY "County_name" ORDER BY "County_name" NULLS FIRST | 0.179688 |
CREATE TABLE table_80159 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What is Canada's score? | SELECT "Score" FROM table_80159 WHERE "Country" = 'canada' | SELECT "Score" FROM "table_80159" WHERE "Country" = 'canada' | 0.058594 |
CREATE TABLE table_4899 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Who played a home team that scored 18.9 (117)? | SELECT "Away team score" FROM table_4899 WHERE "Home team score" = '18.9 (117)' | SELECT "Away team score" FROM "table_4899" WHERE "Home team score" = '18.9 (117)' | 0.079102 |
CREATE TABLE table_13688 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" TEXT)
| What week has a Date of October 4, 1992? | SELECT SUM("Week") FROM table_13688 WHERE "Date" = 'october 4, 1992' | SELECT SUM("Week") FROM "table_13688" WHERE "Date" = 'october 4, 1992' | 0.068359 |
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
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 job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, 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 countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
| Bar chart of department_id from each first name | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees | SELECT "FIRST_NAME", "DEPARTMENT_ID" FROM "employees" | 0.051758 |
CREATE TABLE table_23281 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
| What district did George Miller belong to? | SELECT "District" FROM table_23281 WHERE "Incumbent" = 'George Miller' | SELECT "District" FROM "table_23281" WHERE "Incumbent" = 'George Miller' | 0.070313 |
CREATE TABLE table_name_22 (round INT, pick VARCHAR, player VARCHAR)
| What was the latest round that Derek Pagel was selected with a pick higher than 50? | SELECT MAX(round) FROM table_name_22 WHERE pick > 50 AND player = "derek pagel" | SELECT MAX("round") FROM "table_name_22" WHERE "derek pagel" = "player" AND "pick" > 50 | 0.084961 |
CREATE TABLE table_33037 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| What is the largest crowd for an away team score of 8.7 (55)? | SELECT MAX("Crowd") FROM table_33037 WHERE "Away team score" = '8.7 (55)' | SELECT MAX("Crowd") FROM "table_33037" WHERE "Away team score" = '8.7 (55)' | 0.073242 |
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 procedures_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 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 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_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value 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 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)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
| did patient 3535 undergo until 1 year ago a contr abd arteriogrm nec procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'contr abd arteriogrm nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3535) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 3535 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'contr abd arteriogrm nec' LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime") <= DATETIME(CURRENT_TIME(), '-1 year') AND NOT "_u_1"."" IS NULL | 0.486328 |
CREATE TABLE table_1342198_18 (candidates VARCHAR, district VARCHAR)
| Who is the candidate wehre district is louisiana 1? | SELECT candidates FROM table_1342198_18 WHERE district = "Louisiana 1" | SELECT "candidates" FROM "table_1342198_18" WHERE "Louisiana 1" = "district" | 0.074219 |
CREATE TABLE table_26202788_7 (opponent_in_the_final VARCHAR, championship VARCHAR)
| In the championship Indian Wells, United States (2), who are the opponents in the final? | SELECT opponent_in_the_final FROM table_26202788_7 WHERE championship = "Indian Wells, United States (2)" | SELECT "opponent_in_the_final" FROM "table_26202788_7" WHERE "Indian Wells, United States (2)" = "championship" | 0.108398 |
CREATE TABLE table_name_67 (country VARCHAR, event VARCHAR)
| What is Country, when Event is Rip Curl Women's Pro? | SELECT country FROM table_name_67 WHERE event = "rip curl women's pro" | SELECT "country" FROM "table_name_67" WHERE "event" = "rip curl women's pro" | 0.074219 |
CREATE TABLE student (stuid VARCHAR, sex VARCHAR)
CREATE TABLE lives_in (stuid VARCHAR, dormid VARCHAR)
CREATE TABLE dorm (dormid VARCHAR, dorm_name VARCHAR)
| Find the number of female students (with F sex) living in Smith Hall | SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F' | SELECT COUNT(*) FROM "student" AS "T1" JOIN "lives_in" AS "T2" ON "T1"."stuid" = "T2"."stuid" JOIN "dorm" AS "T3" ON "T2"."dormid" = "T3"."dormid" AND "T3"."dorm_name" = 'Smith Hall' WHERE "T1"."sex" = 'F' | 0.200195 |
CREATE TABLE table_204_110 (id DECIMAL, "year" DECIMAL, "champion" TEXT, "city" TEXT, "llws" TEXT, "record" TEXT)
| there was a fifth place tie in 1967 , what was the next year to have a fifth place tie ? | SELECT MIN("year") FROM table_204_110 WHERE "llws" = 'fifth place (tie)' AND "year" > 1967 | SELECT MIN("year") FROM "table_204_110" WHERE "llws" = 'fifth place (tie)' AND "year" > 1967 | 0.089844 |
CREATE TABLE table_71703 ("Name" TEXT, "Years" TEXT, "Gender" TEXT, "Area" TEXT, "Authority" TEXT, "Decile" FLOAT, "Roll" FLOAT)
| Name the total number of roll for state authority and stanley avenue school with decile more than 5 | SELECT COUNT("Roll") FROM table_71703 WHERE "Authority" = 'state' AND "Name" = 'stanley avenue school' AND "Decile" > '5' | SELECT COUNT("Roll") FROM "table_71703" WHERE "Authority" = 'state' AND "Decile" > '5' AND "Name" = 'stanley avenue school' | 0.120117 |
CREATE TABLE table_204_130 (id DECIMAL, "#" DECIMAL, "date" TEXT, "venue" TEXT, "opponent" TEXT, "score" TEXT, "result" TEXT, "competition" TEXT)
| what is the date above 19 october 2013 ? | SELECT "date" FROM table_204_130 WHERE id = (SELECT id FROM table_204_130 WHERE "date" = '19 october 2013') - 1 | SELECT "date" FROM "table_204_130" WHERE "id" = (SELECT "id" FROM "table_204_130" WHERE "date" = '19 october 2013') - 1 | 0.116211 |
CREATE TABLE table_78037 ("Full Name" TEXT, "Nickname" TEXT, "Gender" TEXT, "Weight at birth" TEXT, "Meaning" TEXT)
| How much did the girl, nicknamed Chidi, weigh at birth? | SELECT "Weight at birth" FROM table_78037 WHERE "Gender" = 'girl' AND "Nickname" = 'chidi' | SELECT "Weight at birth" FROM "table_78037" WHERE "Gender" = 'girl' AND "Nickname" = 'chidi' | 0.089844 |
CREATE TABLE phone (company_name TEXT, hardware_model_name TEXT, accreditation_type TEXT, accreditation_level TEXT, date TEXT, chip_model TEXT, screen_mode TEXT)
CREATE TABLE chip_model (model_name TEXT, launch_year DECIMAL, ram_mib DECIMAL, rom_mib DECIMAL, slots TEXT, wifi TEXT, bluetooth TEXT)
CREATE TABLE screen_mode (graphics_mode DECIMAL, char_cells TEXT, pixels TEXT, hardware_colours DECIMAL, used_kb DECIMAL, map TEXT, type TEXT)
| List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32. | SELECT T2.hardware_model_name, T2.company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.model_name = T2.chip_model WHERE T1.launch_year = 2002 OR T1.ram_mib > 32 | SELECT "T2"."hardware_model_name", "T2"."company_name" FROM "chip_model" AS "T1" JOIN "phone" AS "T2" ON "T1"."model_name" = "T2"."chip_model" WHERE "T1"."launch_year" = 2002 OR "T1"."ram_mib" > 32 | 0.192383 |
CREATE TABLE gsi (course_offering_id INT, student_id 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 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 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 offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE area (course_id INT, area 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 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 program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location 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 semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
| Before taking ELI 312 , which courses should I take ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ELI' AND number = 312 | SELECT DISTINCT "advisory_requirement" FROM "course" WHERE "department" = 'ELI' AND "number" = 312 | 0.095703 |
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 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 lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| what is maximum age of patients whose marital status is divorced and gender is f? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "F" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "DIVORCED" = "demographic"."marital_status" AND "F" = "demographic"."gender" | 0.129883 |
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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
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 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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description 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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
| score in posts information schema. | SELECT * FROM information_schema.columns WHERE table_name = 'POSTS' AND column_name = 'score' | SELECT * FROM "information_schema"."columns" WHERE "column_name" = 'score' AND "table_name" = 'POSTS' | 0.098633 |
CREATE TABLE table_name_97 (council VARCHAR)
| What's the 2003 result for the falkirk council? | SELECT 2003 AS _result FROM table_name_97 WHERE council = "falkirk" | SELECT 2003 AS "_result" FROM "table_name_97" WHERE "council" = "falkirk" | 0.071289 |
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 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 whose discharge location is disc-tran cancer/chldrn h and procedure short title is contrast arteriogram-leg? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Contrast arteriogram-leg" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Contrast arteriogram-leg" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "DISC-TRAN CANCER/CHLDRN H" = "demographic"."discharge_location" | 0.262695 |
CREATE TABLE table_55059 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| What is the average amount of attenders when away team score is 12.10 (82)? | SELECT AVG("Crowd") FROM table_55059 WHERE "Away team score" = '12.10 (82)' | SELECT AVG("Crowd") FROM "table_55059" WHERE "Away team score" = '12.10 (82)' | 0.075195 |
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 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 prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| give the number of patients whose admission year is before 2111 and lab test fluid is pleural. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Pleural" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Pleural" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2111" > "demographic"."admityear" | 0.19043 |
CREATE TABLE table_204_268 (id DECIMAL, "album/single" TEXT, "performer" TEXT, "year" DECIMAL, "variant" TEXT, "notes" TEXT)
| who appeared on more albums , maccoll or kornog ? | SELECT "performer" FROM table_204_268 WHERE "performer" IN ('ewan maccoll', 'kornog') GROUP BY "performer" ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "performer" FROM "table_204_268" WHERE "performer" IN ('ewan maccoll', 'kornog') GROUP BY "performer" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.146484 |
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 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 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 number of patients whose age is less than 71 and item id is 50818? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.itemid = "50818" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50818" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "71" > "demographic"."age" | 0.181641 |
CREATE TABLE player (pName VARCHAR, pID VARCHAR)
CREATE TABLE tryout (pID VARCHAR)
| Find the name of all students who were in the tryout sorted in alphabetic order. | SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName | SELECT "T1"."pName" FROM "player" AS "T1" JOIN "tryout" AS "T2" ON "T1"."pID" = "T2"."pID" ORDER BY "T1"."pName" NULLS FIRST | 0.121094 |
CREATE TABLE table_64350 ("Place" FLOAT, "Team" TEXT, "Played" FLOAT, "Draw" FLOAT, "Lost" FLOAT, "Goals Scored" FLOAT, "Goals Conceded" FLOAT, "Points" FLOAT)
| what is the average points when goals conceded is 14 and goals scored is less than 32? | SELECT AVG("Points") FROM table_64350 WHERE "Goals Conceded" = '14' AND "Goals Scored" < '32' | SELECT AVG("Points") FROM "table_64350" WHERE "Goals Conceded" = '14' AND "Goals Scored" < '32' | 0.092773 |
CREATE TABLE table_3824 ("Team" TEXT, "Outgoing manager" TEXT, "Manner of departure" TEXT, "Date of vacancy" TEXT, "Replaced by" TEXT, "Date of appointment" TEXT, "Position in table" TEXT)
| Name the manner of departure for luis enrique | SELECT "Manner of departure" FROM table_3824 WHERE "Outgoing manager" = 'Luis Enrique' | SELECT "Manner of departure" FROM "table_3824" WHERE "Outgoing manager" = 'Luis Enrique' | 0.085938 |
CREATE TABLE table_7379 ("Region" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Catalog" TEXT)
| Which Region has a Catalog of magik muzik 806-5? | SELECT "Region" FROM table_7379 WHERE "Catalog" = 'magik muzik 806-5' | SELECT "Region" FROM "table_7379" WHERE "Catalog" = 'magik muzik 806-5' | 0.069336 |
CREATE TABLE table_65196 ("Rank" TEXT, "Country" TEXT, "Jerseys" FLOAT, "Giro wins" FLOAT, "Points" FLOAT, "Young rider" FLOAT, "Most recent cyclist" TEXT, "Most recent date" TEXT, "Different holders" FLOAT)
| what is the highest jersey when points is 0, different holders is less than 3, giro wins is less than 1 and young rider is more than 1? | SELECT MAX("Jerseys") FROM table_65196 WHERE "Points" = '0' AND "Different holders" < '3' AND "Giro wins" < '1' AND "Young rider" > '1' | SELECT MAX("Jerseys") FROM "table_65196" WHERE "Different holders" < '3' AND "Giro wins" < '1' AND "Points" = '0' AND "Young rider" > '1' | 0.133789 |
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 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 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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
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 d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
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 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)
| how many patient have died after they were diagnosed with 31-32 comp wks gestation within 2 months until 4 years ago? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '31-32 comp wks gestation')) AS t1 GROUP BY t1.subject_id HAVING MIN(t1.charttime) = t1.charttime AND DATETIME(t1.charttime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 JOIN (SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions JOIN patients ON patients.subject_id = admissions.subject_id WHERE NOT patients.dod IS NULL AND DATETIME(patients.dod) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t3 ON t2.subject_id = t3.subject_id WHERE (DATETIME(t3.dod) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month')) OR (DATETIME(t2.charttime) BETWEEN DATETIME(t3.dod) AND DATETIME(t3.dod, '+2 month')) | WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = '31-32 comp wks gestation' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" GROUP BY "admissions"."subject_id" HAVING "diagnoses_icd"."charttime" = MIN("diagnoses_icd"."charttime") AND DATETIME("diagnoses_icd"."charttime") <= DATETIME(CURRENT_TIME(), '-4 year')), "t3" AS (SELECT "patients"."subject_id", "patients"."dod" FROM "admissions" JOIN "patients" ON "admissions"."subject_id" = "patients"."subject_id" AND DATETIME("patients"."dod") <= DATETIME(CURRENT_TIME(), '-4 year') AND NOT "patients"."dod" IS NULL) SELECT COUNT(DISTINCT "t2"."subject_id") FROM "t2" AS "t2" JOIN "t3" AS "t3" ON "t2"."subject_id" = "t3"."subject_id" AND ((DATETIME("t2"."charttime") <= DATETIME("t3"."dod") AND DATETIME("t2"."charttime", '+2 month') >= DATETIME("t3"."dod")) OR (DATETIME("t2"."charttime") <= DATETIME("t3"."dod", '+2 month') AND DATETIME("t2"."charttime") >= DATETIME("t3"."dod"))) WHERE (DATETIME("t2"."charttime") <= DATETIME("t3"."dod") AND DATETIME("t2"."charttime", '+2 month') >= DATETIME("t3"."dod")) OR (DATETIME("t2"."charttime") <= DATETIME("t3"."dod", '+2 month') AND DATETIME("t2"."charttime") >= DATETIME("t3"."dod")) | 1.341797 |
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 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)
| provide the number of patients whose death status is 0 and procedure short title is percu endosc gastrostomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Percu endosc gastrostomy" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Percu endosc gastrostomy" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "0" = "demographic"."expire_flag" | 0.232422 |
CREATE TABLE table_name_12 (game INT, record VARCHAR)
| Which game had a record of 45-16? | SELECT AVG(game) FROM table_name_12 WHERE record = "45-16" | SELECT AVG("game") FROM "table_name_12" WHERE "45-16" = "record" | 0.0625 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.