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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description 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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId 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 PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
| What is the view count of my questions?. | SELECT p2.ViewCount, p.Score FROM Posts AS p JOIN Posts AS p2 ON p.Id = p2.Id WHERE p.PostTypeId = 2 AND p.OwnerUserId = '##userid##' ORDER BY ViewCount DESC | SELECT "p2"."ViewCount", "p"."Score" FROM "Posts" AS "p" JOIN "Posts" AS "p2" ON "p"."Id" = "p2"."Id" WHERE "p"."OwnerUserId" = '##userid##' AND "p"."PostTypeId" = 2 ORDER BY "ViewCount" DESC NULLS LAST | 0.197266 |
CREATE TABLE paperdataset (paperid INT, datasetid INT)
CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR)
CREATE TABLE author (authorid INT, authorname VARCHAR)
CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT)
CREATE TABLE paperfield (fieldid INT, paperid INT)
CREATE TABLE venue (venueid INT, venuename VARCHAR)
CREATE TABLE cite (citingpaperid INT, citedpaperid INT)
CREATE TABLE dataset (datasetid INT, datasetname VARCHAR)
CREATE TABLE writes (paperid INT, authorid INT)
CREATE TABLE field (fieldid INT)
CREATE TABLE journal (journalid INT, journalname VARCHAR)
CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT)
| papers by steve seitz | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'steve seitz' AND writes.authorid = author.authorid | SELECT DISTINCT "writes"."paperid" FROM "author" JOIN "writes" ON "author"."authorid" = "writes"."authorid" WHERE "author"."authorname" = 'steve seitz' | 0.147461 |
CREATE TABLE table_38747 ("Round" FLOAT, "Player" TEXT, "Position" TEXT, "Nationality" TEXT, "College/Junior/Club Team ( League ) " TEXT)
| What nationality is Daryn Fersovich? | SELECT "Nationality" FROM table_38747 WHERE "Player" = 'daryn fersovich' | SELECT "Nationality" FROM "table_38747" WHERE "Player" = 'daryn fersovich' | 0.072266 |
CREATE TABLE table_64626 ("League" TEXT, "number of seasons" FLOAT, "total games" FLOAT, "Draw" FLOAT, "Loss" FLOAT)
| What is the average draw for 186 games? | SELECT AVG("Draw") FROM table_64626 WHERE "total games" = '186' | SELECT AVG("Draw") FROM "table_64626" WHERE "total games" = '186' | 0.063477 |
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime 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 cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
| what is the top three most frequently prescribed drugs that were prescribed to patients within the same hospital visit after being diagnosed with pneumonia? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime", "patient"."patienthealthsystemstayid" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid"), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" AS "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" AND "patient"."uniquepid" = "t2"."uniquepid" WHERE "diagnosis"."diagnosisname" = 'pneumonia' GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" AS "t3" WHERE "t3"."c1" <= 3 | 0.745117 |
CREATE TABLE table_78998 ("Call sign" TEXT, "Frequency MHz" FLOAT, "City of license" TEXT, "ERP W" FLOAT, "Class" TEXT, "FCC info" TEXT)
| What was the class for Appleton, Wisconsin? | SELECT "Class" FROM table_78998 WHERE "City of license" = 'appleton, wisconsin' | SELECT "Class" FROM "table_78998" WHERE "City of license" = 'appleton, wisconsin' | 0.079102 |
CREATE TABLE table_203_24 (id DECIMAL, "date" TEXT, "home team" TEXT, "score" TEXT, "away team" TEXT, "notes" TEXT)
| on which date did the home team member not score ? | SELECT "date" FROM table_203_24 WHERE "score" = 0 | SELECT "date" FROM "table_203_24" WHERE "score" = 0 | 0.049805 |
CREATE TABLE table_23957 ("Game" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Orangemen points" FLOAT, "Opponents" FLOAT, "Record" TEXT)
| When did they play against West Virginia? | SELECT "Date" FROM table_23957 WHERE "Opponent" = 'West Virginia' | SELECT "Date" FROM "table_23957" WHERE "Opponent" = 'West Virginia' | 0.06543 |
CREATE TABLE table_name_92 (date INT, label VARCHAR, format VARCHAR)
| What is the earliest date with Great Expectations label with LP format? | SELECT MIN(date) FROM table_name_92 WHERE label = "great expectations" AND format = "lp" | SELECT MIN("date") FROM "table_name_92" WHERE "format" = "lp" AND "great expectations" = "label" | 0.09375 |
CREATE TABLE table_30077 ("Player" TEXT, "Played" FLOAT, "Legs Won" FLOAT, "Legs Lost" FLOAT, "100+" FLOAT, "140+" FLOAT, "180s" FLOAT, "High Checkout" FLOAT, "3-dart Average" TEXT)
| Who was the player when the 180s was 15? | SELECT "Player" FROM table_30077 WHERE "180s" = '15' | SELECT "Player" FROM "table_30077" WHERE "180s" = '15' | 0.052734 |
CREATE TABLE table_test_26 ("id" INT, "bleeding" INT, "left_ventricular_ejection_fraction_lvef" INT, "left_main_coronary_artery_disease" BOOLEAN, "uncontrolled_diabetes" BOOLEAN, "hiv_infection" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "hepatitis_b_infection" BOOLEAN, "renal_disease" BOOLEAN, "unprotected_left_main_disease" BOOLEAN, "creatinine_clearance_cl" FLOAT, "stenosis" INT, "hepatitis_c_infection" BOOLEAN, "alcohol_abuse" BOOLEAN, "body_mass_index_bmi" FLOAT, "NOUSE" FLOAT)
| chronic heavy alcohol use | SELECT * FROM table_test_26 WHERE alcohol_abuse = 1 | SELECT * FROM "table_test_26" WHERE "alcohol_abuse" = 1 | 0.053711 |
CREATE TABLE table_name_65 (country VARCHAR, score VARCHAR)
| What is the country with a 70-74-69=213 score? | SELECT country FROM table_name_65 WHERE score = 70 - 74 - 69 = 213 | SELECT "country" FROM "table_name_65" WHERE "score" = FALSE | 0.057617 |
CREATE TABLE table_name_35 (laps INT, time_retired VARCHAR, grid VARCHAR)
| what is the most laps with the time/retired is differential and the grid is more than 2? | SELECT MAX(laps) FROM table_name_35 WHERE time_retired = "differential" AND grid > 2 | SELECT MAX("laps") FROM "table_name_35" WHERE "differential" = "time_retired" AND "grid" > 2 | 0.089844 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE 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)
| what is diagnoses icd9 code and diagnoses short title of subject id 9258? | SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "9258" | SELECT "diagnoses"."icd9_code", "diagnoses"."short_title" FROM "diagnoses" WHERE "9258" = "diagnoses"."subject_id" | 0.111328 |
CREATE TABLE film_market_estimation (Estimation_ID INT, Low_Estimate FLOAT, High_Estimate FLOAT, Film_ID INT, Type TEXT, Market_ID INT, Year INT)
CREATE TABLE market (Market_ID INT, Country TEXT, Number_cities INT)
CREATE TABLE film (Film_ID INT, Title TEXT, Studio TEXT, Director TEXT, Gross_in_dollar INT)
| Use a stacked bar chart to show how many films for each title and each type The x-axis is title, rank x-axis from low to high order. | SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type, Title ORDER BY Title | SELECT "Title", COUNT("Title") FROM "film" AS "T1" JOIN "film_market_estimation" AS "T2" ON "T1"."Film_ID" = "T2"."Film_ID" GROUP BY "Type", "Title" ORDER BY "Title" NULLS FIRST | 0.172852 |
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)
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 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)
| give me the number of patients whose religion is episcopalian and lab test name is phosphate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "EPISCOPALIAN" AND lab.label = "Phosphate" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Phosphate" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "EPISCOPALIAN" = "demographic"."religion" | 0.199219 |
CREATE TABLE table_name_40 (sport VARCHAR, established VARCHAR, league VARCHAR)
| What League of VSL Sport was Established in 1935? | SELECT sport FROM table_name_40 WHERE established = 1935 AND league = "vsl" | SELECT "sport" FROM "table_name_40" WHERE "established" = 1935 AND "league" = "vsl" | 0.081055 |
CREATE TABLE table_name_56 (to_par VARCHAR, place VARCHAR, player VARCHAR)
| Which To par has a Place of t6, and a Player of nick faldo? | SELECT to_par FROM table_name_56 WHERE place = "t6" AND player = "nick faldo" | SELECT "to_par" FROM "table_name_56" WHERE "nick faldo" = "player" AND "place" = "t6" | 0.083008 |
CREATE TABLE table_79611 ("Rank" FLOAT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| What is the total number for a total when the nation is netherlands and silver is larger than 0? | SELECT COUNT("Total") FROM table_79611 WHERE "Nation" = 'netherlands' AND "Silver" > '0' | SELECT COUNT("Total") FROM "table_79611" WHERE "Nation" = 'netherlands' AND "Silver" > '0' | 0.087891 |
CREATE TABLE table_7606 ("Tie no" TEXT, "Home team" TEXT, "Score" TEXT, "Away team" TEXT, "Date" TEXT)
| Which Home team that has a Tie no of 20? | SELECT "Home team" FROM table_7606 WHERE "Tie no" = '20' | SELECT "Home team" FROM "table_7606" WHERE "Tie no" = '20' | 0.056641 |
CREATE TABLE table_6147 ("Year" FLOAT, "Finish position" TEXT, "1st day" TEXT, "2nd day" TEXT, "3rd day" TEXT, "4th Day" TEXT)
| What year has 59th as a finish position? | SELECT "Year" FROM table_6147 WHERE "Finish position" = '59th' | SELECT "Year" FROM "table_6147" WHERE "Finish position" = '59th' | 0.0625 |
CREATE TABLE table_name_82 (total__kg_ INT, bodyweight INT)
| Of weightlifters who weighed more than 136.16, who had the highest Total? | SELECT MAX(total__kg_) FROM table_name_82 WHERE bodyweight > 136.16 | SELECT MAX("total__kg_") FROM "table_name_82" WHERE "bodyweight" > 136.16 | 0.071289 |
CREATE TABLE table_76638 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
| What year did player steve jones, who had a t60 finish, win? | SELECT "Year(s) won" FROM table_76638 WHERE "Finish" = 't60' AND "Player" = 'steve jones' | SELECT "Year(s) won" FROM "table_76638" WHERE "Finish" = 't60' AND "Player" = 'steve jones' | 0.088867 |
CREATE TABLE table_203_741 (id DECIMAL, "season" TEXT, "competition" TEXT, "round" TEXT, "opponent" TEXT, "home" TEXT, "away" TEXT, "aggregate" TEXT)
| did they play austria wein before or after jeunesse esch ? | SELECT (SELECT id FROM table_203_741 WHERE "opponent" = 'austria wien') < (SELECT id FROM table_203_741 WHERE "opponent" = 'jeunesse esch') | SELECT (SELECT "id" FROM "table_203_741" WHERE "opponent" = 'austria wien') < (SELECT "id" FROM "table_203_741" WHERE "opponent" = 'jeunesse esch') | 0.143555 |
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 microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
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 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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| calculate the five year survival probability of patients to whom albuterol sulf was prescribed after they were diagnosed with pneumonia - community-acquired. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia - community-acquired' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'albuterol sulf') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid | WITH "t1" AS (SELECT "patient"."uniquepid", "diagnosis"."diagnosistime" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'pneumonia - community-acquired' GROUP BY "patient"."uniquepid" HAVING "diagnosis"."diagnosistime" = MIN("diagnosis"."diagnosistime")), "t3" AS (SELECT "patient"."uniquepid", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'albuterol sulf') SELECT SUM(CASE WHEN "patient"."hospitaldischargestatus" = 'alive' THEN 1 WHEN STRFTIME('%j', "patient"."hospitaldischargetime") - STRFTIME('%j', "t1"."diagnosistime") > 1825 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM "t1" AS "t1" JOIN "t3" AS "t3" ON "t1"."diagnosistime" < "t3"."drugstarttime" AND "t1"."uniquepid" = "t3"."uniquepid" JOIN "patient" ON "patient"."uniquepid" = "t1"."uniquepid" | 0.942383 |
CREATE TABLE table_name_89 (home_team VARCHAR, away_team VARCHAR)
| Who did Collingwood play at home? | SELECT home_team FROM table_name_89 WHERE away_team = "collingwood" | SELECT "home_team" FROM "table_name_89" WHERE "away_team" = "collingwood" | 0.071289 |
CREATE TABLE ReviewTaskResultTypes (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 FlagTypes (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 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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, 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 Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
| Top Android Contributors in Spain && Germany. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", u.Location, COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE (LOWER(Location) LIKE '%germany%' OR LOWER(Location) LIKE '%spain%') AND TagName = 'android' GROUP BY u.Id, TagName, Location) SELECT * FROM USER_BY_TAG WHERE rank <= 1000 ORDER BY UpVotes DESC | WITH "USER_BY_TAG" AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "Rank", "u"."Id" AS "user_link", "u"."Location", COUNT(*) AS "UpVotes" FROM "Tags" AS "t" JOIN "PostTags" AS "pt" ON "pt"."TagId" = "t"."Id" JOIN "Posts" AS "p" ON "p"."ParentId" = "pt"."PostId" JOIN "Users" AS "u" ON "p"."OwnerUserId" = "u"."Id" JOIN "Votes" AS "v" ON "VoteTypeId" = 2 AND "p"."Id" = "v"."PostId" WHERE "TagName" = 'android' AND (LOWER("Location") LIKE '%germany%' OR LOWER("Location") LIKE '%spain%') GROUP BY "u"."Id", "TagName", "Location") SELECT * FROM "USER_BY_TAG" WHERE "rank" <= 1000 ORDER BY "UpVotes" DESC NULLS LAST | 0.617188 |
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
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 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 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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
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 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)
| how many hours has it been since patient 2518 was first prescribed bupropion during the current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'bupropion' ORDER BY prescriptions.startdate LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 2518 GROUP BY "hadm_id") SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "prescriptions"."startdate")) FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'bupropion' AND NOT "_u_0"."" IS NULL ORDER BY "prescriptions"."startdate" NULLS FIRST LIMIT 1 | 0.454102 |
CREATE TABLE table_name_97 (caps VARCHAR, name VARCHAR, goals_per_match VARCHAR)
| How many caps does Jon Dahl Tomasson, who has less than 0.46 goals per match, have? | SELECT COUNT(caps) FROM table_name_97 WHERE name = "jon dahl tomasson" AND goals_per_match < 0.46 | SELECT COUNT("caps") FROM "table_name_97" WHERE "goals_per_match" < 0.46 AND "jon dahl tomasson" = "name" | 0.102539 |
CREATE TABLE table_name_43 (grid VARCHAR, time_retired VARCHAR, laps VARCHAR)
| What is the grid for the driver with an electrical time/retired and 51 laps? | SELECT grid FROM table_name_43 WHERE time_retired = "electrical" AND laps = 51 | SELECT "grid" FROM "table_name_43" WHERE "electrical" = "time_retired" AND "laps" = 51 | 0.083984 |
CREATE TABLE table_47108 ("Club" TEXT, "Played" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Tries against" TEXT, "Try bonus" TEXT)
| What is the played number when the tries against shows correct as of 18:13 26 May 2008? | SELECT "Played" FROM table_47108 WHERE "Tries against" = 'correct as of 18:13 26 may 2008' | SELECT "Played" FROM "table_47108" WHERE "Tries against" = 'correct as of 18:13 26 may 2008' | 0.089844 |
CREATE TABLE architect (id TEXT, name TEXT, nationality TEXT, gender TEXT)
CREATE TABLE bridge (architect_id INT, id INT, name TEXT, location TEXT, length_meters FLOAT, length_feet FLOAT)
CREATE TABLE mill (architect_id INT, id INT, location TEXT, name TEXT, type TEXT, built_year INT, notes TEXT)
| Give me a histogram for what are the ids and names of the architects who built at least 3 bridges ?, and list by the names in desc. | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name DESC | SELECT "T1"."name", "T1"."id" FROM "architect" AS "T1" JOIN "bridge" AS "T2" ON "T1"."id" = "T2"."architect_id" ORDER BY "T1"."name" DESC NULLS LAST | 0.144531 |
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_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 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 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 chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
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 d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| when was patient 18677 prescribed the drug pantoprazole and omeprazole at the same time for the last time since 10/2103? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'pantoprazole' AND admissions.subject_id = 18677 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-10') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'omeprazole' AND admissions.subject_id = 18677 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-10') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate DESC LIMIT 1 | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" AND "admissions"."subject_id" = 18677 WHERE "prescriptions"."drug" = 'omeprazole' AND STRFTIME('%y-%m', "prescriptions"."startdate") >= '2103-10') SELECT "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" AND "admissions"."subject_id" = 18677 JOIN "t2" AS "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND DATETIME("prescriptions"."startdate") = DATETIME("t2"."startdate") WHERE "prescriptions"."drug" = 'pantoprazole' AND STRFTIME('%y-%m', "prescriptions"."startdate") >= '2103-10' ORDER BY "prescriptions"."startdate" DESC NULLS LAST LIMIT 1 | 0.771484 |
CREATE TABLE table_11545282_7 (position VARCHAR, player VARCHAR)
| What position did Lamar Green play? | SELECT position FROM table_11545282_7 WHERE player = "Lamar Green" | SELECT "position" FROM "table_11545282_7" WHERE "Lamar Green" = "player" | 0.070313 |
CREATE TABLE table_17454 ("Pick #" FLOAT, "Player" TEXT, "Position" TEXT, "Nationality" TEXT, "NHL team" TEXT, "College/junior/club team" TEXT)
| what is the college that has the nhl chicago black hawks? | SELECT "College/junior/club team" FROM table_17454 WHERE "NHL team" = 'Chicago Black Hawks' | SELECT "College/junior/club team" FROM "table_17454" WHERE "NHL team" = 'Chicago Black Hawks' | 0.09082 |
CREATE TABLE table_47148 ("Company" TEXT, "Type" TEXT, "Principal activities" TEXT, "Incorporated in" TEXT, "Group's Equity Shareholding" TEXT)
| Which Incorporated in has a Group's Equity Shareholding of 100%, and a Principal activities of flight academy? | SELECT "Incorporated in" FROM table_47148 WHERE "Group's Equity Shareholding" = '100%' AND "Principal activities" = 'flight academy' | SELECT "Incorporated in" FROM "table_47148" WHERE "Group's Equity Shareholding" = '100%' AND "Principal activities" = 'flight academy' | 0.130859 |
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_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, visualize the relationship between salary and department_id . | SELECT SALARY, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | SELECT "SALARY", "DEPARTMENT_ID" FROM "employees" WHERE NOT "EMPLOYEE_ID" IN (SELECT "EMPLOYEE_ID" FROM "job_history") | 0.115234 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| give the number of patients whose diagnosis long title is observation for suspected infectious condition and lab test abnormal status is abnormal. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Observation for suspected infectious condition" AND lab.flag = "abnormal" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Observation for suspected infectious condition" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "abnormal" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.294922 |
CREATE TABLE table_67492 ("Year" FLOAT, "Competition" TEXT, "Venue" TEXT, "Position" TEXT, "Notes" TEXT)
| Name the venue for 2004 and position of 25th | SELECT "Venue" FROM table_67492 WHERE "Position" = '25th' AND "Year" = '2004' | SELECT "Venue" FROM "table_67492" WHERE "Position" = '25th' AND "Year" = '2004' | 0.077148 |
CREATE TABLE table_19930 ("Series Ep." TEXT, "Episode" FLOAT, "Segment A" TEXT, "Segment B" TEXT, "Segment C" TEXT, "Segment D" TEXT)
| What are the titles of segment c when segment d is motorcycle brake locks? | SELECT "Segment C" FROM table_19930 WHERE "Segment D" = 'Motorcycle Brake Locks' | SELECT "Segment C" FROM "table_19930" WHERE "Segment D" = 'Motorcycle Brake Locks' | 0.080078 |
CREATE TABLE table_62549 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT, "Money ( $ ) " FLOAT)
| What was the highest money when the score was 69-68-67-69=273? | SELECT MAX("Money ( $ )") FROM table_62549 WHERE "Score" = '69-68-67-69=273' | SELECT MAX("Money ( $ )") FROM "table_62549" WHERE "Score" = '69-68-67-69=273' | 0.076172 |
CREATE TABLE table_204_19 (id DECIMAL, "university" TEXT, "winner" DECIMAL, "runner-up" DECIMAL, "years won" TEXT, "years runner-up" TEXT)
| hosei won in 1964 . who won the next year ? | SELECT "university" FROM table_204_19 WHERE "years won" = 1964 + 1 | SELECT "university" FROM "table_204_19" WHERE "years won" = 1965 | 0.0625 |
CREATE TABLE Subjects (subject_id INT, subject_name VARCHAR)
CREATE TABLE Students (student_id INT, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR, password VARCHAR, personal_name VARCHAR, middle_name VARCHAR, family_name VARCHAR)
CREATE TABLE Courses (course_id INT, author_id INT, subject_id INT, course_name VARCHAR, course_description VARCHAR)
CREATE TABLE Student_Course_Enrolment (registration_id INT, student_id INT, course_id INT, date_of_enrolment DATETIME, date_of_completion DATETIME)
CREATE TABLE Course_Authors_and_Tutors (author_id INT, author_tutor_ATB VARCHAR, login_name VARCHAR, password VARCHAR, personal_name VARCHAR, middle_name VARCHAR, family_name VARCHAR, gender_mf VARCHAR, address_line_1 VARCHAR)
CREATE TABLE Student_Tests_Taken (registration_id INT, date_test_taken DATETIME, test_result VARCHAR)
| Find the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and sort in descending by the Y please. | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC | SELECT "date_of_latest_logon", COUNT("date_of_latest_logon") FROM "Students" WHERE "Jaskolski" = "family_name" OR "Langosh" = "family_name" ORDER BY COUNT("date_of_latest_logon") DESC NULLS LAST | 0.189453 |
CREATE TABLE table_204_887 (id DECIMAL, "district" DECIMAL, "representative" TEXT, "party" TEXT, "residence" TEXT, "counties represented" TEXT)
| which wyoming senator represented the most counties ? | SELECT "representative" FROM table_204_887 ORDER BY "counties represented" DESC LIMIT 1 | SELECT "representative" FROM "table_204_887" ORDER BY "counties represented" DESC NULLS LAST LIMIT 1 | 0.097656 |
CREATE TABLE table_name_59 (net_yds INT, long VARCHAR, start VARCHAR)
| What is the average net yds for the player who had a long of 68 and started after 1984? | SELECT AVG(net_yds) FROM table_name_59 WHERE long = 68 AND start > 1984 | SELECT AVG("net_yds") FROM "table_name_59" WHERE "long" = 68 AND "start" > 1984 | 0.077148 |
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 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name 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 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount 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 diagnoses_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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| what is the yearly average amount of cerebral drain r ventricular drain that patient 83038 had since 07/27/2105? | SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cerebral drain r ventricular drain' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2105-07-27' GROUP BY STRFTIME('%y', outputevents.charttime) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 83038 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'cerebral drain r ventricular drain' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT AVG("outputevents"."value") FROM "outputevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") >= '2105-07-27' GROUP BY STRFTIME('%y', "outputevents"."charttime") | 0.818359 |
CREATE TABLE table_50814 ("Edition" TEXT, "Round" TEXT, "Date" TEXT, "Against" TEXT, "Surface" TEXT, "Opponent" TEXT, "Result" TEXT)
| who is the opponent when norway is against? | SELECT "Opponent" FROM table_50814 WHERE "Against" = 'norway' | SELECT "Opponent" FROM "table_50814" WHERE "Against" = 'norway' | 0.061523 |
CREATE TABLE table_61360 ("Outcome" TEXT, "Date" FLOAT, "Championship" TEXT, "Surface" TEXT, "Opponent in the final" TEXT, "Score in the final" TEXT)
| What Championship has an Opponent in the final of aaron krickstein, and a Score in the final of 7 5, 6 2? | SELECT "Championship" FROM table_61360 WHERE "Opponent in the final" = 'aaron krickstein' AND "Score in the final" = '7–5, 6–2' | SELECT "Championship" FROM "table_61360" WHERE "Opponent in the final" = 'aaron krickstein' AND "Score in the final" = '7–5, 6–2' | 0.125977 |
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
| what flights go from PITTSBURGH to BALTIMORE after 800 o'clock next wednesday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 800 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 23 AND "date_day"."month_number" = 4 AND "date_day"."year" = 1991 JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'PITTSBURGH' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND "flight"."departure_time" > 800 JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'BALTIMORE' | 0.745117 |
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
| Give me the comparison about Team_ID over the All_Neutral by a bar chart, show from high to low by the All_Neutral please. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC | SELECT "All_Neutral", "Team_ID" FROM "basketball_match" ORDER BY "All_Neutral" DESC NULLS LAST | 0.091797 |
CREATE TABLE table_1636 ("Period" TEXT, "% trains arriving within 5 mins of scheduled time ( over three months ) " TEXT, "Change over same quarter the previous year" TEXT, "% trains arriving within 5 mins of scheduled time Moving Annual Average ( MAA ) " TEXT, "Change over previous year as a whole" TEXT)
| What's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of scheduled time (over three months)? | SELECT "Change over same quarter the previous year" FROM table_1636 WHERE "% trains arriving within 5 mins of scheduled time (over three months)" = '89.6%' | SELECT "Change over same quarter the previous year" FROM "table_1636" WHERE "% trains arriving within 5 mins of scheduled time (over three months)" = '89.6%' | 0.15332 |
CREATE TABLE table_name_17 (name VARCHAR, floors VARCHAR, street_address_in_detroit VARCHAR)
| Which place has 23 floors and a street address in Detroit of 144 west congress street? | SELECT name FROM table_name_17 WHERE floors = 23 AND street_address_in_detroit = "144 west congress street" | SELECT "name" FROM "table_name_17" WHERE "144 west congress street" = "street_address_in_detroit" AND "floors" = 23 | 0.112305 |
CREATE TABLE table_name_37 (team__number2 VARCHAR)
| What is the 1st leg that has akasvayu girona as team #2? | SELECT 1 AS st_leg FROM table_name_37 WHERE team__number2 = "akasvayu girona" | SELECT 1 AS "st_leg" FROM "table_name_37" WHERE "akasvayu girona" = "team__number2" | 0.081055 |
CREATE TABLE table_7047 ("English country name" TEXT, "Arabic romanised country name" TEXT, "Arabic country name" TEXT, "English capital name" TEXT, "Arabic romanised capital name" TEXT, "Arabic capital name" TEXT)
| What is the English name of the country that has Ramallah as its capital? | SELECT "English country name" FROM table_7047 WHERE "English capital name" = 'ramallah' | SELECT "English country name" FROM "table_7047" WHERE "English capital name" = 'ramallah' | 0.086914 |
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId 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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE FlagTypes (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 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 Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description 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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, 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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
| Count of Review Tasks for June 2019. | SELECT COUNT(*) FROM ReviewTasks WHERE CreationDate LIKE '2019-06%' | SELECT COUNT(*) FROM "ReviewTasks" WHERE "CreationDate" LIKE '2019-06%' | 0.069336 |
CREATE TABLE table_name_73 (team__number1 VARCHAR)
| What was the 2nd leg score for Chemie Halle? | SELECT 2 AS nd_leg FROM table_name_73 WHERE team__number1 = "chemie halle" | SELECT 2 AS "nd_leg" FROM "table_name_73" WHERE "chemie halle" = "team__number1" | 0.078125 |
CREATE TABLE PostTypes (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 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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE 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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, 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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
| I'm trying to find a specific answer. | SELECT Id AS "post_link" FROM Posts WHERE Score = -3 AND Body LIKE '%handle%xml%' AND PostTypeId = 2 ORDER BY Id DESC | SELECT "Id" AS "post_link" FROM "Posts" WHERE "Body" LIKE '%handle%xml%' AND "PostTypeId" = 2 AND "Score" = -3 ORDER BY "Id" DESC NULLS LAST | 0.136719 |
CREATE TABLE table_203_333 (id DECIMAL, "kilometers" DECIMAL, "name" TEXT, "location" TEXT, "intersecting routes" TEXT)
| what junction is the furthest from mahanayim junction ? | SELECT "name" FROM table_203_333 ORDER BY "kilometers" DESC LIMIT 1 | SELECT "name" FROM "table_203_333" ORDER BY "kilometers" DESC NULLS LAST LIMIT 1 | 0.078125 |
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
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 d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount 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 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)
| what was the name of the procedure that patient 17638 received two times in 06/this year. | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17638) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', procedures_icd.charttime) = '06' GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 17638 GROUP BY "hadm_id"), "t1" AS (SELECT "procedures_icd"."icd9_code", COUNT("procedures_icd"."charttime") AS "c1" FROM "procedures_icd" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL AND STRFTIME('%m', "procedures_icd"."charttime") = '06' GROUP BY "procedures_icd"."icd9_code"), "_u_1" AS (SELECT "t1"."icd9_code" FROM "t1" AS "t1" WHERE "t1"."c1" = 2 GROUP BY "icd9_code") SELECT "d_icd_procedures"."short_title" FROM "d_icd_procedures" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_icd_procedures"."icd9_code" WHERE NOT "_u_1"."" IS NULL | 0.785156 |
CREATE TABLE table_29626583_1 (position VARCHAR, affiliation VARCHAR)
| what is the position for the united states u-20 affiliation | SELECT position FROM table_29626583_1 WHERE affiliation = "United States U-20" | SELECT "position" FROM "table_29626583_1" WHERE "United States U-20" = "affiliation" | 0.082031 |
CREATE TABLE table_18600760_3 (county VARCHAR, longitude VARCHAR)
| What was the county with a longitude of -102.302775? | SELECT county FROM table_18600760_3 WHERE longitude = "-102.302775" | SELECT "county" FROM "table_18600760_3" WHERE "-102.302775" = "longitude" | 0.071289 |
CREATE TABLE grapes (ID INT, Grape TEXT, Color TEXT)
CREATE TABLE appellations (No INT, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT)
CREATE TABLE wine (No INT, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INT, Price INT, Score INT, Cases INT, Drink TEXT)
| Plot the number of county by grouped by county as a bar graph, and I want to list in ascending by the bars. | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County | SELECT "County", COUNT("County") FROM "appellations" GROUP BY "County" ORDER BY "County" NULLS FIRST | 0.097656 |
CREATE TABLE table_32276 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| What was the away team that scored 12.11 (83)? | SELECT "Away team" FROM table_32276 WHERE "Away team score" = '12.11 (83)' | SELECT "Away team" FROM "table_32276" WHERE "Away team score" = '12.11 (83)' | 0.074219 |
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod 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 transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom 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 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
| in this year vancomycin, oxycodone liquid or ns (mini bag plus) have been prescribed for patient 8421? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8421) AND prescriptions.drug IN ('vancomycin', 'oxycodone liquid', 'ns (mini bag plus)') 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" = 8421 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 ('vancomycin', 'oxycodone liquid', 'ns (mini bag plus)') AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL | 0.449219 |
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 vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
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 medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
| tell me the sex of patient 006-202970. | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '006-202970' | SELECT DISTINCT "patient"."gender" FROM "patient" WHERE "patient"."uniquepid" = '006-202970' | 0.089844 |
CREATE TABLE table_25530 ("Name" TEXT, "Platform" TEXT, "License" TEXT, "Windows builders" TEXT, "Java builders" TEXT, "Other builders" TEXT, "SCM system" TEXT, "Notification" TEXT, "IDE Integration" TEXT, "Other Integration" TEXT)
| Name the number of scm system for nant, visual studio | SELECT COUNT("SCM system") FROM table_25530 WHERE "Windows builders" = 'NAnt, Visual Studio' | SELECT COUNT("SCM system") FROM "table_25530" WHERE "Windows builders" = 'NAnt, Visual Studio' | 0.091797 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| tell me the number of inpatient hospital admission patients who have cardiac tamponade diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND diagnoses.short_title = "Cardiac tamponade" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Cardiac tamponade" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "TRANSFER FROM HOSP/EXTRAM" = "demographic"."admission_location" | 0.25293 |
CREATE TABLE table_49412 ("Outcome" TEXT, "Date" FLOAT, "Championship" TEXT, "Surface" TEXT, "Opponent in the final" TEXT, "Score in the final" TEXT)
| Which Opponent in the final has an Outcome of winner, and a Date larger than 1992, and a Surface of clay, and a Score in the final of 3 6, 6 2, 6 1? | SELECT "Opponent in the final" FROM table_49412 WHERE "Outcome" = 'winner' AND "Date" > '1992' AND "Surface" = 'clay' AND "Score in the final" = '3–6, 6–2, 6–1' | SELECT "Opponent in the final" FROM "table_49412" WHERE "Date" > '1992' AND "Outcome" = 'winner' AND "Score in the final" = '3–6, 6–2, 6–1' AND "Surface" = 'clay' | 0.158203 |
CREATE TABLE table_test_6 ("id" INT, "scr" INT, "anemia" BOOLEAN, "blood_hemoglobin" INT, "bleeding" INT, "hemorrhagic_diseases" BOOLEAN, "stroke" BOOLEAN, "blood_platelet_counts" INT, "trauma" BOOLEAN, "renal_disease" BOOLEAN, "hematocrit_hct" FLOAT, "hepatic_disease" BOOLEAN, "polyglobulia" BOOLEAN, "estimated_glomerular_filtration_rate_egfr" INT, "non_ischemic_stroke" BOOLEAN, "surgery" BOOLEAN, "NOUSE" FLOAT)
| known hemorrhagic diseases | SELECT * FROM table_test_6 WHERE hemorrhagic_diseases = 1 | SELECT * FROM "table_test_6" WHERE "hemorrhagic_diseases" = 1 | 0.05957 |
CREATE TABLE exhibition_record (Exhibition_ID INT, Date TEXT, Attendance INT)
CREATE TABLE artist (Artist_ID INT, Name TEXT, Country TEXT, Year_Join INT, Age INT)
CREATE TABLE exhibition (Exhibition_ID INT, Year INT, Theme TEXT, Artist_ID INT, Ticket_Price FLOAT)
| Bar chart x axis name y axis age, and show Age in desc order. | SELECT Name, Age FROM artist ORDER BY Age DESC | SELECT "Name", "Age" FROM "artist" ORDER BY "Age" DESC NULLS LAST | 0.063477 |
CREATE TABLE record (ID INT, Result TEXT, Swimmer_ID INT, Event_ID INT)
CREATE TABLE stadium (ID INT, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT)
CREATE TABLE event (ID INT, Name TEXT, Stadium_ID INT, Year TEXT)
CREATE TABLE swimmer (ID INT, name TEXT, Nationality TEXT, meter_100 FLOAT, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT)
| Find meter_400 and meter_100 , and visualize them by a bar chart. | SELECT meter_400, meter_100 FROM swimmer | SELECT "meter_400", "meter_100" FROM "swimmer" | 0.044922 |
CREATE TABLE table_name_36 (issue_price VARCHAR, mintage VARCHAR)
| A mintage of 31,997 has what issue price? | SELECT issue_price FROM table_name_36 WHERE mintage = "31,997" | SELECT "issue_price" FROM "table_name_36" WHERE "31,997" = "mintage" | 0.066406 |
CREATE TABLE Dorm (dormid INT, dorm_name VARCHAR, student_capacity INT, gender VARCHAR)
CREATE TABLE Has_amenity (dormid INT, amenid INT)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
CREATE TABLE Lives_in (stuid INT, dormid INT, room_number INT)
CREATE TABLE Dorm_amenity (amenid INT, amenity_name VARCHAR)
| How many students live in each city? Show a bar chart, order by the Y from low to high please. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) | SELECT "city_code", COUNT(*) FROM "Student" GROUP BY "city_code" ORDER BY COUNT(*) NULLS FIRST | 0.091797 |
CREATE TABLE book_club (publisher VARCHAR)
| What is the publisher with most number of books? | SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "publisher" FROM "book_club" GROUP BY "publisher" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.095703 |
CREATE TABLE table_name_92 (report VARCHAR, status VARCHAR, against VARCHAR)
| What report has tour match as the status, with an against less than 22? | SELECT report FROM table_name_92 WHERE status = "tour match" AND against < 22 | SELECT "report" FROM "table_name_92" WHERE "against" < 22 AND "status" = "tour match" | 0.083008 |
CREATE TABLE table_44428 ("Year" FLOAT, "Imports ( tonnes ) " FLOAT, "Exports ( tonnes ) " FLOAT, "Total trade ( tonnes ) " FLOAT, "Vessels entering port" FLOAT)
| What is the highest Total trade (tonnes) after 2001 when the Imports are 144,368 tonnes, the Exports are more than 4,024,311 tonnes, and there are more than 91 vessels entering port? | SELECT MAX("Total trade (tonnes)") FROM table_44428 WHERE "Year" > '2001' AND "Vessels entering port" > '91' AND "Imports (tonnes)" = '144,368' AND "Exports (tonnes)" > '4,024,311' | SELECT MAX("Total trade (tonnes)") FROM "table_44428" WHERE "Exports (tonnes)" > '4,024,311' AND "Imports (tonnes)" = '144,368' AND "Vessels entering port" > '91' AND "Year" > '2001' | 0.177734 |
CREATE TABLE department (dept_name VARCHAR)
| How many departments does the college has? | SELECT COUNT(DISTINCT dept_name) FROM department | SELECT COUNT(DISTINCT "dept_name") FROM "department" | 0.050781 |
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 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 Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description 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)
| Top 150 users from Bangladesh. | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bangladesh%' ORDER BY Reputation DESC LIMIT 150 | SELECT "Id", "DisplayName", "Reputation", "WebsiteUrl", "Location" FROM "Users" WHERE "Location" LIKE '%Bangladesh%' ORDER BY "Reputation" DESC NULLS LAST LIMIT 150 | 0.160156 |
CREATE TABLE table_name_36 (opponent VARCHAR, loss VARCHAR)
| Who was the opponent at the game with a loss of Sele (0-1)? | SELECT opponent FROM table_name_36 WHERE loss = "sele (0-1)" | SELECT "opponent" FROM "table_name_36" WHERE "loss" = "sele (0-1)" | 0.064453 |
CREATE TABLE table_name_6 (place VARCHAR, player VARCHAR)
| Golfer Steve Pate is in what place? | SELECT place FROM table_name_6 WHERE player = "steve pate" | SELECT "place" FROM "table_name_6" WHERE "player" = "steve pate" | 0.0625 |
CREATE TABLE table_name_58 (attendance INT, date VARCHAR)
| What is the sum of the attendance on November 24? | SELECT SUM(attendance) FROM table_name_58 WHERE date = "november 24" | SELECT SUM("attendance") FROM "table_name_58" WHERE "date" = "november 24" | 0.072266 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| count the number of patients whose age is less than 81 and drug code is prismab32k25000? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.formulary_drug_cd = "PRISMAB32K25000" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "PRISMAB32K25000" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "81" > "demographic"."age" | 0.231445 |
CREATE TABLE table_name_49 (date VARCHAR, home_team VARCHAR)
| What was the date when Geelong was the home team? | SELECT date FROM table_name_49 WHERE home_team = "geelong" | SELECT "date" FROM "table_name_49" WHERE "geelong" = "home_team" | 0.0625 |
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 PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostTypes (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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE 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 CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskStates (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)
| Difference between accepted and highest-rated answer. | SELECT Answers.Id AS accId, Answers2.Id AS bestId, Answers.CreationDate AS accDate, Answers2.CreationDate AS bestDate, Answers.Score AS accScore, Answers2.Score AS bestScore, (CAST(Answers2.CreationDate AS INT) - CAST(Answers.CreationDate AS INT)) AS Dif, Questions.Tags AS tags FROM Posts AS Questions INNER JOIN Posts AS Answers ON Answers.ParentId = Questions.Id AND Questions.AcceptedAnswerId = Answers.Id INNER JOIN Posts AS Answers2 ON Answers2.ParentId = Answers.ParentId AND Answers2.Score > Answers.Score WHERE Answers.PostTypeId = 2 | SELECT "Answers"."Id" AS "accId", "Answers2"."Id" AS "bestId", "Answers"."CreationDate" AS "accDate", "Answers2"."CreationDate" AS "bestDate", "Answers"."Score" AS "accScore", "Answers2"."Score" AS "bestScore", CAST("Answers2"."CreationDate" AS INT) - CAST("Answers"."CreationDate" AS INT) AS "Dif", "Questions"."Tags" AS "tags" FROM "Posts" AS "Questions" JOIN "Posts" AS "Answers" ON "Answers"."Id" = "Questions"."AcceptedAnswerId" AND "Answers"."ParentId" = "Questions"."Id" AND "Answers"."PostTypeId" = 2 JOIN "Posts" AS "Answers2" ON "Answers"."ParentId" = "Answers2"."ParentId" AND "Answers"."Score" < "Answers2"."Score" | 0.611328 |
CREATE TABLE table_40285 ("Week of" TEXT, "Tier" TEXT, "Winner" TEXT, "Runner-up" TEXT, "Semi finalists" TEXT)
| What is the Week when anke huber chanda rubin shows for Semi finalists, and the Runner-up is meredith mcgrath larisa savchenko? | SELECT "Week of" FROM table_40285 WHERE "Semi finalists" = 'anke huber chanda rubin' AND "Runner-up" = 'meredith mcgrath larisa savchenko' | SELECT "Week of" FROM "table_40285" WHERE "Runner-up" = 'meredith mcgrath larisa savchenko' AND "Semi finalists" = 'anke huber chanda rubin' | 0.136719 |
CREATE TABLE table_31259 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" FLOAT)
| How many different pairs of writers wrote the episode with series number 56? | SELECT COUNT("Written by") FROM table_31259 WHERE "No. in series" = '56' | SELECT COUNT("Written by") FROM "table_31259" WHERE "No. in series" = '56' | 0.072266 |
CREATE TABLE table_54875 ("Date" TEXT, "Visitor" TEXT, "Score" TEXT, "Home" TEXT, "Decision" TEXT, "Record" TEXT)
| What was the decision when Tampa Bay was the visitor? | SELECT "Decision" FROM table_54875 WHERE "Visitor" = 'tampa bay' | SELECT "Decision" FROM "table_54875" WHERE "Visitor" = 'tampa bay' | 0.064453 |
CREATE TABLE table_name_16 (tournament VARCHAR)
| What is Tournament, when 2012 is 'A', when 2011 is 'A', and when 2008 is 'A'? | SELECT tournament FROM table_name_16 WHERE 2012 = "a" AND 2011 = "a" AND 2008 = "a" | SELECT "tournament" FROM "table_name_16" WHERE "a" = 2008 AND "a" = 2011 AND "a" = 2012 | 0.084961 |
CREATE TABLE table_23285849_7 (high_points VARCHAR, score VARCHAR)
| Who had the most points in the game where the score was w 97 92 (ot)? | SELECT high_points FROM table_23285849_7 WHERE score = "W 97–92 (OT)" | SELECT "high_points" FROM "table_23285849_7" WHERE "W 97–92 (OT)" = "score" | 0.073242 |
CREATE TABLE table_15119 ("Year" FLOAT, "Division I" TEXT, "Division II" TEXT, "Division III" TEXT, "Division IV" TEXT, "Division V" TEXT)
| What Division III has Bishop Brady in Division V and Hanover in Division IV? | SELECT "Division III" FROM table_15119 WHERE "Division V" = 'bishop brady' AND "Division IV" = 'hanover' | SELECT "Division III" FROM "table_15119" WHERE "Division IV" = 'hanover' AND "Division V" = 'bishop brady' | 0.103516 |
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
| Draw a scatterplot of team id vs all_games_percent where team id is on the x-axis and points are colored by All_Home | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Home | SELECT "Team_ID", "All_Games_Percent" FROM "basketball_match" GROUP BY "All_Home" | 0.079102 |
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
| Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home, and sort from low to high by the y axis. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID | SELECT "ACC_Road", "School_ID" FROM "basketball_match" GROUP BY "All_Home", "ACC_Road" ORDER BY "School_ID" NULLS FIRST | 0.116211 |
CREATE TABLE table_62054 ("Round" FLOAT, "Race" TEXT, "Circuit" TEXT, "Date" TEXT, "Event" TEXT, "Winning driver" TEXT)
| What race was a round smaller than 8, on 6 july? | SELECT "Race" FROM table_62054 WHERE "Round" < '8' AND "Date" = '6 july' | SELECT "Race" FROM "table_62054" WHERE "Date" = '6 july' AND "Round" < '8' | 0.072266 |
CREATE TABLE Order_Items (order_item_id INT, order_id INT, product_id INT, order_quantity VARCHAR)
CREATE TABLE Customers (customer_id INT, payment_method_code VARCHAR, customer_number VARCHAR, customer_name VARCHAR, customer_address VARCHAR, customer_phone VARCHAR, customer_email VARCHAR)
CREATE TABLE Products (product_id INT, product_type_code VARCHAR, product_name VARCHAR, product_price DOUBLE)
CREATE TABLE Contacts (contact_id INT, customer_id INT, gender VARCHAR, first_name VARCHAR, last_name VARCHAR, contact_phone VARCHAR)
CREATE TABLE Addresses (address_id INT, line_1_number_building VARCHAR, city VARCHAR, zip_postcode VARCHAR, state_province_county VARCHAR, country VARCHAR)
CREATE TABLE Customer_Orders (order_id INT, customer_id INT, order_date DATETIME, order_status_code VARCHAR)
CREATE TABLE Customer_Address_History (customer_id INT, address_id INT, date_from DATETIME, date_to DATETIME)
| Show each state and the number of addresses in each state by a bar chart, and could you list in asc by the Y-axis please? | SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY COUNT(*) | SELECT "state_province_county", COUNT(*) FROM "Addresses" GROUP BY "state_province_county" ORDER BY COUNT(*) NULLS FIRST | 0.117188 |
CREATE TABLE table_68885 ("Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Loss" TEXT, "Attendance" FLOAT, "Record" TEXT)
| What team did Johnson (11-7) play for? | SELECT "Opponent" FROM table_68885 WHERE "Loss" = 'johnson (11-7)' | SELECT "Opponent" FROM "table_68885" WHERE "Loss" = 'johnson (11-7)' | 0.066406 |
CREATE TABLE table_50489 ("Position" FLOAT, "Equipment" TEXT, "Points" FLOAT, "Wins" TEXT, "Second" TEXT, "Third" TEXT)
| What is Equipment, when Points is less than 6, and when Position is 53? | SELECT "Equipment" FROM table_50489 WHERE "Points" < '6' AND "Position" = '53' | SELECT "Equipment" FROM "table_50489" WHERE "Points" < '6' AND "Position" = '53' | 0.078125 |
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 admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_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 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_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE procedures_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 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 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)
| what was the daily maximum amount of foley given to patient 72198 on the first intensive care unit visit? | SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_items.linksto = 'outputevents') GROUP BY STRFTIME('%y-%m-%d', outputevents.charttime) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 72198 GROUP BY "hadm_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'foley' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT MAX("outputevents"."value") FROM "outputevents" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE "outputevents"."icustay_id" IN (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND NOT "icustays"."outtime" IS NULL ORDER BY "icustays"."intime" NULLS FIRST LIMIT 1) AND NOT "_u_2"."" IS NULL GROUP BY STRFTIME('%y-%m-%d', "outputevents"."charttime") | 0.720703 |
CREATE TABLE table_36909 ("Club" TEXT, "Sport" TEXT, "Founded" FLOAT, "League" TEXT, "Venue" TEXT, "Head Coach" TEXT)
| Venue of Pepsi arena involved what club? | SELECT "Club" FROM table_36909 WHERE "Venue" = 'pepsi arena' | SELECT "Club" FROM "table_36909" WHERE "Venue" = 'pepsi arena' | 0.060547 |
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 the number of living patients who had a hematocrit other fluid lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Other Fluid" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Hematocrit, Other Fluid" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "0" = "demographic"."expire_flag" | 0.205078 |
CREATE TABLE table_21330550_2 (location VARCHAR, big_ten_team VARCHAR)
| How many locations have #12 Michigan State as the big ten team? | SELECT COUNT(location) FROM table_21330550_2 WHERE big_ten_team = "#12 Michigan State" | SELECT COUNT("location") FROM "table_21330550_2" WHERE "#12 Michigan State" = "big_ten_team" | 0.089844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.