schema
stringlengths
29
5.42k
question
stringlengths
0
752
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
8.94k
weight
float64
0
8.73
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
what is the minimum hospital cost for a patient suffering from acute pain due to trauma until 2 years ago?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acute pain due to trauma')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_id) AS t1
WITH "_u_1" AS (SELECT "diagnoses_icd"."hadm_id" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'acute pain due to trauma' GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."hadm_id" WHERE DATETIME("cost"."chargetime") <= DATETIME(CURRENT_TIME(), '-2 year') AND NOT "_u_1"."" IS NULL GROUP BY "cost"."hadm_id") SELECT MIN("t1"."c1") FROM "t1" "t1"
0.504883
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
what is diagnoses icd9 code and diagnoses long title of subject id 18372?
SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18372"
SELECT "diagnoses"."icd9_code", "diagnoses"."long_title" FROM "diagnoses" WHERE "18372" = "diagnoses"."subject_id"
0.111328
CREATE TABLE table_name_7 (venue VARCHAR2, event VARCHAR2, competition VARCHAR2)
what is the venue when the event is 4x400 m relay and the competition is asian championships?
SELECT venue FROM table_name_7 WHERE event = "4x400 m relay" AND competition = "asian championships"
SELECT "venue" FROM "table_name_7" WHERE "4x400 m relay" = "event" AND "asian championships" = "competition"
0.105469
CREATE TABLE table_70036 ("Name" CLOB, "Years" CLOB, "Gender" CLOB, "Area" CLOB, "Authority" CLOB, "Decile" FLOAT, "Roll" FLOAT)
How many decile has a roll less than 20?
SELECT AVG("Decile") FROM table_70036 WHERE "Roll" < '20'
SELECT AVG("Decile") FROM "table_70036" WHERE "Roll" < '20'
0.057617
CREATE TABLE table_46609 ("Class" CLOB, "Part 1" CLOB, "Part 2" CLOB, "Part 3" CLOB, "Part 4" CLOB, "Verb meaning" CLOB)
What is the verb meaning when the part 2 is bl ot?
SELECT "Verb meaning" FROM table_46609 WHERE "Part 2" = 'blēot'
SELECT "Verb meaning" FROM "table_46609" WHERE "Part 2" = 'blēot'
0.063477
CREATE TABLE table_204_227 (id NUMBER, "week" NUMBER, "date" CLOB, "opponent" CLOB, "score" CLOB, "result" CLOB, "record" CLOB)
which team is the next opponent following the first loss of the season ?
SELECT "opponent" FROM table_204_227 WHERE id = (SELECT id FROM table_204_227 WHERE "result" = loss ORDER BY id LIMIT 1) + 1
SELECT "opponent" FROM "table_204_227" WHERE "id" = (SELECT "id" FROM "table_204_227" WHERE "loss" = "result" ORDER BY "id" FETCH FIRST 1 ROWS ONLY) + 1
0.148438
CREATE TABLE category (name VARCHAR2, category_id VARCHAR2) CREATE TABLE film (film_id VARCHAR2, title VARCHAR2) CREATE TABLE film_category (category_id VARCHAR2, film_id VARCHAR2)
What is the genre name of the film HUNGER ROOF?
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'
SELECT "T1"."name" FROM "category" "T1" JOIN "film_category" "T2" ON "T1"."category_id" = "T2"."category_id" JOIN "film" "T3" ON "T2"."film_id" = "T3"."film_id" AND "T3"."title" = 'HUNGER ROOF'
0.188477
CREATE TABLE table_18278508_4 (main_contestant VARCHAR2, position VARCHAR2, co_contestant__yaar_vs_pyaar_ VARCHAR2)
Name the total number of main contestants for safe position for tina parekh
SELECT COUNT(main_contestant) FROM table_18278508_4 WHERE position = "Safe" AND co_contestant__yaar_vs_pyaar_ = "Tina Parekh"
SELECT COUNT("main_contestant") FROM "table_18278508_4" WHERE "Safe" = "position" AND "Tina Parekh" = "co_contestant__yaar_vs_pyaar_"
0.129883
CREATE TABLE table_327 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" CLOB, "U.S. viewers ( millions ) " CLOB)
How many episodes did David Jackson write and direct?
SELECT COUNT("Written by") FROM table_327 WHERE "Directed by" = 'David Jackson'
SELECT COUNT("Written by") FROM "table_327" WHERE "Directed by" = 'David Jackson'
0.079102
CREATE TABLE table_3977 ("Pick #" FLOAT, "CFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
Name the college for dl
SELECT "College" FROM table_3977 WHERE "Position" = 'DL'
SELECT "College" FROM "table_3977" WHERE "Position" = 'DL'
0.056641
CREATE TABLE table_name_85 (owner_operator VARCHAR2, licence_number VARCHAR2)
Who is the owner operator who has license number PL 59?
SELECT owner_operator FROM table_name_85 WHERE licence_number = "pl 59"
SELECT "owner_operator" FROM "table_name_85" WHERE "licence_number" = "pl 59"
0.075195
CREATE TABLE table_17156199_1 (year__ceremony_ VARCHAR2, original_title VARCHAR2)
What year and ceremony was the original title (britter baire)?
SELECT year__ceremony_ FROM table_17156199_1 WHERE original_title = "বৃত্তের বাইরে (Britter Baire)"
SELECT "year__ceremony_" FROM "table_17156199_1" WHERE "original_title" = "বৃত্তের বাইরে (Britter Baire)"
0.102539
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
My answers order by view count.
SELECT SUM(q.ViewCount) FROM Posts AS a, Posts AS q WHERE a.OwnerUserId = 132438 AND a.ParentId = q.Id AND a.PostTypeId = 2 AND q.PostTypeId = 1
SELECT SUM("q"."ViewCount") FROM "Posts" "a" JOIN "Posts" "q" ON "a"."ParentId" = "q"."Id" AND "q"."PostTypeId" = 1 WHERE "a"."OwnerUserId" = 132438 AND "a"."PostTypeId" = 2
0.168945
CREATE TABLE table_1341604_19 (incumbent VARCHAR2, first_elected VARCHAR2)
Who's the incumbent in the district first elected in 1976?
SELECT incumbent FROM table_1341604_19 WHERE first_elected = 1976
SELECT "incumbent" FROM "table_1341604_19" WHERE "first_elected" = 1976
0.069336
CREATE TABLE table_name_65 (title VARCHAR2, producer VARCHAR2)
What is the title of the film when the producer was 2003?
SELECT title FROM table_name_65 WHERE producer = "2003"
SELECT "title" FROM "table_name_65" WHERE "2003" = "producer"
0.05957
CREATE TABLE table_name_55 (word_form VARCHAR2, ala_lc VARCHAR2)
What is the word form for the ALA-LC transliteration of muay s ain?
SELECT word_form FROM table_name_55 WHERE ala_lc = "muay s″ain"
SELECT "word_form" FROM "table_name_55" WHERE "ala_lc" = "muay s″ain"
0.067383
CREATE TABLE paperdataset (paperid NUMBER, datasetid NUMBER) CREATE TABLE paper (paperid NUMBER, title VARCHAR2, venueid NUMBER, year NUMBER, numciting NUMBER, numcitedby NUMBER, journalid NUMBER) CREATE TABLE writes (paperid NUMBER, authorid NUMBER) CREATE TABLE journal (journalid NUMBER, journalname VARCHAR2) CREATE TABLE cite (citingpaperid NUMBER, citedpaperid NUMBER) CREATE TABLE venue (venueid NUMBER, venuename VARCHAR2) CREATE TABLE field (fieldid NUMBER) CREATE TABLE paperkeyphrase (paperid NUMBER, keyphraseid NUMBER) CREATE TABLE author (authorid NUMBER, authorname VARCHAR2) CREATE TABLE keyphrase (keyphraseid NUMBER, keyphrasename VARCHAR2) CREATE TABLE paperfield (fieldid NUMBER, paperid NUMBER) CREATE TABLE dataset (datasetid NUMBER, datasetname VARCHAR2)
li dong semantic parsing paper
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
SELECT DISTINCT "author"."authorid", "paper"."paperid" FROM "author" JOIN "writes" ON "author"."authorid" = "writes"."authorid" JOIN "paper" ON "paper"."paperid" = "writes"."paperid" JOIN "paperkeyphrase" ON "paper"."paperid" = "paperkeyphrase"."paperid" JOIN "keyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" AND "keyphrase"."keyphrasename" = 'semantic parsing' WHERE "author"."authorname" = 'li dong'
0.416016
CREATE TABLE table_20942925_1 (us_viewers__millions_ VARCHAR2, written_by VARCHAR2)
What are all values for U.S. viewers(millions) with Kevin Curran as a writer?
SELECT us_viewers__millions_ FROM table_20942925_1 WHERE written_by = "Kevin Curran"
SELECT "us_viewers__millions_" FROM "table_20942925_1" WHERE "Kevin Curran" = "written_by"
0.087891
CREATE TABLE table_14457 ("Week" CLOB, "Opponent" CLOB, "Result" CLOB, "Game site" CLOB, "Attendance" CLOB)
What was the score when 50,514 people were in attendance?
SELECT "Result" FROM table_14457 WHERE "Attendance" = '50,514'
SELECT "Result" FROM "table_14457" WHERE "Attendance" = '50,514'
0.0625
CREATE TABLE table_name_77 (round NUMBER, overall VARCHAR2, pick__number VARCHAR2, position VARCHAR2)
What is the highest round with a pick# of 9, overll less than 468, and position of defensive back?
SELECT MAX(round) FROM table_name_77 WHERE pick__number = 9 AND position = "defensive back" AND overall < 468
SELECT MAX("round") FROM "table_name_77" WHERE "defensive back" = "position" AND "overall" < 468 AND "pick__number" = 9
0.116211
CREATE TABLE table_72677 ("Player" CLOB, "G" FLOAT, "Tackles" FLOAT, "Solo" FLOAT, "Assts" FLOAT, "Sacks" CLOB, "Int" FLOAT, "Int yards" FLOAT, "Int avg." CLOB, "Int TD" FLOAT, "Fum. rec" FLOAT, "Fum. rec TD" FLOAT)
Name the least amount of tackles for danny clark
SELECT MIN("Tackles") FROM table_72677 WHERE "Player" = 'Danny Clark'
SELECT MIN("Tackles") FROM "table_72677" WHERE "Player" = 'Danny Clark'
0.069336
CREATE TABLE table_name_52 (high_rebounds VARCHAR2, team VARCHAR2)
Who had the most rebounds in the game against Chicago?
SELECT high_rebounds FROM table_name_52 WHERE team = "chicago"
SELECT "high_rebounds" FROM "table_name_52" WHERE "chicago" = "team"
0.066406
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
Comments from rene regarding get more rep.
SELECT Id, PostId AS "post_link", Text FROM Comments WHERE LOWER(Text) LIKE '%get more rep%' AND UserId = 578411 ORDER BY LENGTH(Text), Id
SELECT "Id", "PostId" AS "post_link", "Text" FROM "Comments" WHERE "UserId" = 578411 AND LOWER("Text") LIKE '%get more rep%' ORDER BY LENGTH("Text"), "Id"
0.150391
CREATE TABLE table_5960 ("Club" CLOB, "Location" CLOB, "Stadium" CLOB, "Capacity" FLOAT, "Current manager" CLOB)
What is the capacity for the stadium of kadrioru stadium and a current manager of sergei ratnikov?
SELECT AVG("Capacity") FROM table_5960 WHERE "Stadium" = 'kadrioru stadium' AND "Current manager" = 'sergei ratnikov'
SELECT AVG("Capacity") FROM "table_5960" WHERE "Current manager" = 'sergei ratnikov' AND "Stadium" = 'kadrioru stadium'
0.116211
CREATE TABLE table_name_47 (year VARCHAR2, award VARCHAR2)
How many years has the Mercury Prize award been given?
SELECT COUNT(year) FROM table_name_47 WHERE award = "mercury prize"
SELECT COUNT("year") FROM "table_name_47" WHERE "award" = "mercury prize"
0.071289
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
provide the number of patients whose age is less than 83 and diagnoses long title is personal history of malignant neoplasm of gastrointestinal tract, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "83" AND diagnoses.long_title = "Personal history of malignant neoplasm of gastrointestinal tract, unspecified"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Personal history of malignant neoplasm of gastrointestinal tract, unspecified" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "83" > "demographic"."age"
0.273438
CREATE TABLE table_18165 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Results" CLOB, "Candidates" CLOB)
Who are the candidates in the Tennessee 3 district election?
SELECT "Candidates" FROM table_18165 WHERE "District" = 'Tennessee 3'
SELECT "Candidates" FROM "table_18165" WHERE "District" = 'Tennessee 3'
0.069336
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER) CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2) CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER) CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER) CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2) CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER) CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
For all employees who have the letters D or S in their first name, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday by a bar chart, and rank in desc by the total number please.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) DESC
SELECT "HIRE_DATE", SUM("MANAGER_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' ORDER BY SUM("MANAGER_ID") DESC
0.139648
CREATE TABLE table_28365 ("No. in series" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" FLOAT)
How many episodes had the production code 66210?
SELECT COUNT("No. in series") FROM table_28365 WHERE "Production code" = '66210'
SELECT COUNT("No. in series") FROM "table_28365" WHERE "Production code" = '66210'
0.080078
CREATE TABLE table_name_10 (week NUMBER, date VARCHAR2, attendance VARCHAR2)
In what week was the game on August 24, 1956 played in front of 40,175 fans?
SELECT MAX(week) FROM table_name_10 WHERE date = "august 24, 1956" AND attendance > 40 OFFSET 175
SELECT MAX("week") FROM "table_name_10" WHERE "attendance" > 40 AND "august 24, 1956" = "date" OFFSET 175 ROWS
0.107422
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
what were the three most common specimen tests ordered until 2100?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2100' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
WITH "t1" AS (SELECT "microbiologyevents"."spec_type_desc", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "microbiologyevents" WHERE STRFTIME('%y', "microbiologyevents"."charttime") <= '2100' GROUP BY "microbiologyevents"."spec_type_desc") SELECT "t1"."spec_type_desc" FROM "t1" "t1" WHERE "t1"."c1" <= 3
0.306641
CREATE TABLE Rating (stars NUMBER)
What is the total number of ratings that has more than 3 stars?
SELECT COUNT(*) FROM Rating WHERE stars > 3
SELECT COUNT(*) FROM "Rating" WHERE "stars" > 3
0.045898
CREATE TABLE table_203_564 (id NUMBER, "hand" CLOB, "1 credit" NUMBER, "2 credits" NUMBER, "3 credits" NUMBER, "4 credits" NUMBER, "5 credits" NUMBER)
what is the difference of payout on 3 credits , between a straight flush and royal flush ?
SELECT ABS((SELECT "3 credits" FROM table_203_564 WHERE "hand" = 'straight flush') - (SELECT "3 credits" FROM table_203_564 WHERE "hand" = 'royal flush'))
SELECT ABS((SELECT "3 credits" FROM "table_203_564" WHERE "hand" = 'straight flush') - (SELECT "3 credits" FROM "table_203_564" WHERE "hand" = 'royal flush'))
0.154297
CREATE TABLE table_48163 ("Rider" CLOB, "Bike" CLOB, "Laps" FLOAT, "Time" CLOB, "Grid" FLOAT)
What is the average laps for the +50.653 time?
SELECT AVG("Laps") FROM table_48163 WHERE "Time" = '+50.653'
SELECT AVG("Laps") FROM "table_48163" WHERE "Time" = '+50.653'
0.060547
CREATE TABLE table_10236830_4 (nomination VARCHAR2, director VARCHAR2)
Srdjan Dragojevic worked on a film which earned what nomination?
SELECT nomination FROM table_10236830_4 WHERE director = "Srdjan Dragojevic"
SELECT "nomination" FROM "table_10236830_4" WHERE "Srdjan Dragojevic" = "director"
0.080078
CREATE TABLE table_24910733_2 (episode VARCHAR2, rating VARCHAR2)
How many episodes received rating of 8.2?
SELECT COUNT(episode) FROM table_24910733_2 WHERE rating = "8.2"
SELECT COUNT("episode") FROM "table_24910733_2" WHERE "8.2" = "rating"
0.068359
CREATE TABLE table_12960 ("Year" FLOAT, "Delegate" CLOB, "Hometown" CLOB, "Placement in Miss World" CLOB, "Other awards" CLOB)
What's the latest year with a hometown of san carlos, pangasinan?
SELECT MAX("Year") FROM table_12960 WHERE "Hometown" = 'san carlos, pangasinan'
SELECT MAX("Year") FROM "table_12960" WHERE "Hometown" = 'san carlos, pangasinan'
0.079102
CREATE TABLE table_1331 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
What is the Raptors' record against New Jersey?
SELECT "Record" FROM table_1331 WHERE "Team" = 'New Jersey'
SELECT "Record" FROM "table_1331" WHERE "Team" = 'New Jersey'
0.05957
CREATE TABLE table_20726262_4 (no_in_season NUMBER, usviewers__million_ VARCHAR2)
what is the maximum number in the season wher the us viewers is 2.59?
SELECT MAX(no_in_season) FROM table_20726262_4 WHERE usviewers__million_ = "2.59"
SELECT MAX("no_in_season") FROM "table_20726262_4" WHERE "2.59" = "usviewers__million_"
0.084961
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
tell me the name of the allergy patient 006-42293 has since 51 months ago?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-42293')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-51 month')
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-42293' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "allergy"."allergyname" FROM "allergy" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "allergy"."patientunitstayid" WHERE DATETIME("allergy"."allergytime") >= DATETIME(CURRENT_TIME(), '-51 month') AND NOT "_u_1"."" IS NULL
0.5625
CREATE TABLE table_45155 ("Year" CLOB, "Start" CLOB, "Qual" CLOB, "Rank" CLOB, "Finish" CLOB, "Laps" FLOAT)
Which Rank has a Qual of 145.144?
SELECT "Rank" FROM table_45155 WHERE "Qual" = '145.144'
SELECT "Rank" FROM "table_45155" WHERE "Qual" = '145.144'
0.055664
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
give me the number of patients whose ethnicity is white - russian and drug name is chloraseptic throat spray?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Chloraseptic Throat Spray"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Chloraseptic Throat Spray" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "WHITE - RUSSIAN" = "demographic"."ethnicity"
0.24707
CREATE TABLE table_36423 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Save" CLOB, "Record" CLOB)
What was the record the day David Weathers (15) had a save?
SELECT "Record" FROM table_36423 WHERE "Save" = 'david weathers (15)'
SELECT "Record" FROM "table_36423" WHERE "Save" = 'david weathers (15)'
0.069336
CREATE TABLE table_name_7 (winner_and_score VARCHAR2, week VARCHAR2)
Who won on the week of August 10?
SELECT winner_and_score FROM table_name_7 WHERE week = "august 10"
SELECT "winner_and_score" FROM "table_name_7" WHERE "august 10" = "week"
0.070313
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
what is the number of patients whose age is less than 31 and drug name is sodium fluoride (dental gel)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.drug = "Sodium Fluoride (Dental Gel)"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Sodium Fluoride (Dental Gel)" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "31" > "demographic"."age"
0.231445
CREATE TABLE table_21501518_1 (song_choice VARCHAR2, original_artist VARCHAR2)
Whats the song of name with an original artist Garth Brooks
SELECT song_choice FROM table_21501518_1 WHERE original_artist = "Garth Brooks"
SELECT "song_choice" FROM "table_21501518_1" WHERE "Garth Brooks" = "original_artist"
0.083008
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
how many patients whose diagnoses short title is obs chr bronc w ac bronc and drug route is sc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Obs chr bronc w ac bronc" AND prescriptions.route = "SC"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Obs chr bronc w ac bronc" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "SC" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id"
0.298828
CREATE TABLE all_documents (document_id NUMBER, date_stored TIME, document_type_code CLOB, document_name CLOB, document_description CLOB, other_details CLOB) CREATE TABLE document_locations (document_id NUMBER, location_code CLOB, date_in_location_from TIME, date_in_locaton_to TIME) CREATE TABLE ref_calendar (calendar_date TIME, day_number NUMBER) CREATE TABLE ref_document_types (document_type_code CLOB, document_type_name CLOB, document_type_description CLOB) CREATE TABLE roles (role_code CLOB, role_name CLOB, role_description CLOB) CREATE TABLE ref_locations (location_code CLOB, location_name CLOB, location_description CLOB) CREATE TABLE employees (employee_id NUMBER, role_code CLOB, employee_name CLOB, gender_mfu CLOB, date_of_birth TIME, other_details CLOB) CREATE TABLE documents_to_be_destroyed (document_id NUMBER, destruction_authorised_by_employee_id NUMBER, destroyed_by_employee_id NUMBER, planned_destruction_date TIME, actual_destruction_date TIME, other_details CLOB)
Show the ids of all employees who have destroyed a document.
SELECT DISTINCT destroyed_by_employee_id FROM documents_to_be_destroyed
SELECT DISTINCT "destroyed_by_employee_id" FROM "documents_to_be_destroyed"
0.073242
CREATE TABLE table_204_780 (id NUMBER, "year" NUMBER, "competition" CLOB, "venue" CLOB, "position" CLOB, "notes" CLOB)
the 1990 european championships and the 1988 olympic games both resulted in what position for this competitor ?
SELECT "position" FROM table_204_780 WHERE "year" = 1990 AND "competition" = 'european championships'
SELECT "position" FROM "table_204_780" WHERE "competition" = 'european championships' AND "year" = 1990
0.100586
CREATE TABLE table_72867 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
Name the record for score of l 93 104 (ot)
SELECT "Record" FROM table_72867 WHERE "Score" = 'L 93–104 (OT)'
SELECT "Record" FROM "table_72867" WHERE "Score" = 'L 93–104 (OT)'
0.064453
CREATE TABLE table_72984 ("Game" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Raiders points" FLOAT, "Opponents" FLOAT, "Raiders first downs" FLOAT, "Record" CLOB, "Attendance" FLOAT)
Who was the game attended by 60425 people played against?
SELECT "Opponent" FROM table_72984 WHERE "Attendance" = '60425'
SELECT "Opponent" FROM "table_72984" WHERE "Attendance" = '60425'
0.063477
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
what kind of ground transportation is available in LAS VEGAS
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'LAS VEGAS' AND ground_service.airport_code = airport.airport_code
SELECT DISTINCT "ground_service"."transport_type" FROM "airport" JOIN "airport_service" ON "airport"."airport_code" = "airport_service"."airport_code" JOIN "ground_service" ON "airport"."airport_code" = "ground_service"."airport_code" JOIN "city" ON "airport_service"."city_code" = "city"."city_code" AND "city"."city_name" = 'LAS VEGAS'
0.329102
CREATE TABLE table_204_467 (id NUMBER, "date" CLOB, "opponents" CLOB, "h/a" CLOB, "result\ f-a" CLOB, "scorers" CLOB, "attendance" NUMBER)
what was the difference in score on january 2 1922 ?
SELECT ABS("result\nf-a" - "result\nf-a") FROM table_204_467 WHERE "date" = '2 january 1922'
SELECT ABS("result\nf-a" - "result\nf-a") FROM "table_204_467" WHERE "date" = '2 january 1922'
0.091797
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
when patient 67902 had the first closed bronchial biopsy until 2100?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'closed bronchial biopsy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67902) AND STRFTIME('%y', procedures_icd.charttime) <= '2100' ORDER BY procedures_icd.charttime LIMIT 1
WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 67902 GROUP BY "hadm_id") SELECT "procedures_icd"."charttime" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'closed bronchial biopsy' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "procedures_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "procedures_icd"."charttime") <= '2100' ORDER BY "procedures_icd"."charttime" FETCH FIRST 1 ROWS ONLY
0.537109
CREATE TABLE table_18198579_6 (scoring_average VARCHAR2, best_finish VARCHAR2)
Name the scoring average for best finsih being t35
SELECT scoring_average FROM table_18198579_6 WHERE best_finish = "T35"
SELECT "scoring_average" FROM "table_18198579_6" WHERE "T35" = "best_finish"
0.074219
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
provide me with the four most common diagnosis since 3 years ago.
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
WITH "t1" AS (SELECT "diagnosis"."diagnosisname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" WHERE DATETIME("diagnosis"."diagnosistime") >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY "diagnosis"."diagnosisname") SELECT "t1"."diagnosisname" FROM "t1" "t1" WHERE "t1"."c1" <= 4
0.294922
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER) CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and sort Y-axis in descending order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
SELECT "T1"."Name", "T1"."Code" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name" ORDER BY "T1"."Code" DESC
0.158203
CREATE TABLE table_name_34 (round VARCHAR2, player VARCHAR2)
What is the total number of rounds that Joe Barnes was picked?
SELECT COUNT(round) FROM table_name_34 WHERE player = "joe barnes"
SELECT COUNT("round") FROM "table_name_34" WHERE "joe barnes" = "player"
0.070313
CREATE TABLE table_47954 ("Date" CLOB, "Region" CLOB, "Label" CLOB, "Catalogue" CLOB, "Format" CLOB)
What is Format, when Label is Bronze, when Date is 1982, and when Catalogue is 204 636?
SELECT "Format" FROM table_47954 WHERE "Label" = 'bronze' AND "Date" = '1982' AND "Catalogue" = '204 636'
SELECT "Format" FROM "table_47954" WHERE "Catalogue" = '204 636' AND "Date" = '1982' AND "Label" = 'bronze'
0.104492
CREATE TABLE table_21822 ("No." FLOAT, "P" CLOB, "Name" CLOB, "Country" CLOB, "Age" FLOAT, "Loan Club" CLOB, "Started" CLOB, "Ended" CLOB, "Start Source" CLOB, "End Source" CLOB)
what ist he total number of ages where the start date is 6 november?
SELECT COUNT("Age") FROM table_21822 WHERE "Started" = '6 November'
SELECT COUNT("Age") FROM "table_21822" WHERE "Started" = '6 November'
0.067383
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
tell me the number of patients who were diagnosed with long-term use of steroids.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Long-term use steroids"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Long-term use steroids" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id"
0.188477
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
how many black/cape verdean newborn patients were in the hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.ethnicity = "BLACK/CAPE VERDEAN"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "BLACK/CAPE VERDEAN" = "demographic"."ethnicity" AND "NEWBORN" = "demographic"."admission_type"
0.166016
CREATE TABLE resultsdata15 (sample_pk NUMBER, commod CLOB, commtype CLOB, lab CLOB, pestcode CLOB, testclass CLOB, concen NUMBER, lod NUMBER, conunit CLOB, confmethod CLOB, confmethod2 CLOB, annotate CLOB, quantitate CLOB, mean CLOB, extract CLOB, determin CLOB) CREATE TABLE sampledata15 (sample_pk NUMBER, state CLOB, year CLOB, month CLOB, day CLOB, site CLOB, commod CLOB, source_id CLOB, variety CLOB, origin CLOB, country CLOB, disttype CLOB, commtype CLOB, claim CLOB, quantity NUMBER, growst CLOB, packst CLOB, distst CLOB)
If sample 6480 is imported, which country is it originally from?
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2
SELECT "country" FROM "sampledata15" WHERE "origin" = 2 AND "sample_pk" = 6480
0.076172
CREATE TABLE table_53712 ("engine name" CLOB, "engine code ( s ) " CLOB, "valvetrain" CLOB, "displacement" CLOB, "max. power at rpm" CLOB, "max. torque at rpm" CLOB)
What is the maximum power at rpm for the engine named 2.0 TDI that has a 1968cc displacement?
SELECT "max. power at rpm" FROM table_53712 WHERE "displacement" = '1968cc' AND "engine name" = '2.0 tdi'
SELECT "max. power at rpm" FROM "table_53712" WHERE "displacement" = '1968cc' AND "engine name" = '2.0 tdi'
0.104492
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
provide the number of patients whose admission location is transfer from hosp/extram and procedure icd9 code is 4573?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "4573"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "4573" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "TRANSFER FROM HOSP/EXTRAM" = "demographic"."admission_location"
0.241211
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
in 09/this year has patient 028-55868 received any medication?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55868')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', medication.drugstarttime) = '09'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '028-55868' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "medication" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m', "medication"."drugstarttime") = '09'
0.647461
CREATE TABLE table_11058032_1 (no_in_season NUMBER, directed_by VARCHAR2)
What episode in the season was directed by Jeff Melman?
SELECT MIN(no_in_season) FROM table_11058032_1 WHERE directed_by = "Jeff Melman"
SELECT MIN("no_in_season") FROM "table_11058032_1" WHERE "Jeff Melman" = "directed_by"
0.083984
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
has there been a microbiology test conducted since 75 months ago on patient 031-19622?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-75 month')
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '031-19622' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "microlab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "microlab"."patientunitstayid" WHERE DATETIME("microlab"."culturetakentime") >= DATETIME(CURRENT_TIME(), '-75 month') AND NOT "_u_1"."" IS NULL
0.55957
CREATE TABLE table_25730209_2 (points VARCHAR2, player VARCHAR2)
How many points did Donald Green score?
SELECT COUNT(points) FROM table_25730209_2 WHERE player = "Donald Green"
SELECT COUNT("points") FROM "table_25730209_2" WHERE "Donald Green" = "player"
0.076172
CREATE TABLE table_30949 ("Rd." FLOAT, "Grand Prix" CLOB, "Pole Position" CLOB, "Fastest Lap" CLOB, "Winning Driver" CLOB, "Constructor" CLOB, "Report" CLOB)
What was the constructor in the Belgian Grand Prix round?
SELECT "Constructor" FROM table_30949 WHERE "Grand Prix" = 'Belgian Grand Prix'
SELECT "Constructor" FROM "table_30949" WHERE "Grand Prix" = 'Belgian Grand Prix'
0.079102
CREATE TABLE program (Program_ID NUMBER, Name CLOB, Origin CLOB, Launch FLOAT, Owner CLOB) CREATE TABLE channel (Channel_ID NUMBER, Name CLOB, Owner CLOB, Share_in_percent FLOAT, Rating_in_percent FLOAT) CREATE TABLE broadcast_share (Channel_ID NUMBER, Program_ID NUMBER, Date CLOB, Share_in_percent FLOAT) CREATE TABLE broadcast (Channel_ID NUMBER, Program_ID NUMBER, Time_of_day CLOB)
Draw a bar chart of owner versus total number of rating in percent, and sort Y-axis in asc order.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent)
SELECT "Owner", SUM("Rating_in_percent") FROM "channel" GROUP BY "Owner" ORDER BY SUM("Rating_in_percent")
0.103516
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
what is the maximum total cost of hospitals that include family hx-malignancy nos until 2 years ago?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'family hx-malignancy nos')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_id) AS t1
WITH "_u_1" AS (SELECT "diagnoses_icd"."hadm_id" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'family hx-malignancy nos' GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."hadm_id" WHERE DATETIME("cost"."chargetime") <= DATETIME(CURRENT_TIME(), '-2 year') AND NOT "_u_1"."" IS NULL GROUP BY "cost"."hadm_id") SELECT MAX("t1"."c1") FROM "t1" "t1"
0.504883
CREATE TABLE table_name_12 (country VARCHAR2, language VARCHAR2, television_service VARCHAR2)
What is the Country when the language is italian english, and the television service is disney xd +1?
SELECT country FROM table_name_12 WHERE language = "italian english" AND television_service = "disney xd +1"
SELECT "country" FROM "table_name_12" WHERE "disney xd +1" = "television_service" AND "italian english" = "language"
0.113281
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
# of votes by question (for a specific user).
SELECT p.Id AS "post_link", p.CreationDate, COUNT(v.VoteTypeId) AS "#_votes" FROM Posts AS p LEFT OUTER JOIN Votes AS v ON v.PostId = p.Id WHERE p.OwnerUserId = '##UserID##' AND VoteTypeId IN (1, 2, 3, 5, NULL) GROUP BY p.Id, p.CreationDate ORDER BY p.CreationDate
SELECT "p"."Id" AS "post_link", "p"."CreationDate", COUNT("v"."VoteTypeId") AS "#_votes" FROM "Posts" "p" LEFT JOIN "Votes" "v" ON "p"."Id" = "v"."PostId" WHERE "VoteTypeId" IN (1, 2, 3, 5, NULL) AND "p"."OwnerUserId" = '##UserID##' GROUP BY "p"."Id", "p"."CreationDate" ORDER BY "p"."CreationDate"
0.291016
CREATE TABLE table_name_12 (type VARCHAR2, opened VARCHAR2)
Which type opened in 1982?
SELECT type FROM table_name_12 WHERE opened = "1982"
SELECT "type" FROM "table_name_12" WHERE "1982" = "opened"
0.056641
CREATE TABLE table_name_13 (venue VARCHAR2, crowd NUMBER)
What venue saw a crowd larger than 29,840?
SELECT venue FROM table_name_13 WHERE crowd > 29 OFFSET 840
SELECT "venue" FROM "table_name_13" WHERE "crowd" > 29 OFFSET 840 ROWS
0.068359
CREATE TABLE table_name_81 (website VARCHAR2, webcast VARCHAR2, frequency VARCHAR2)
What's the website for the Listen Live webcast on the 99.3 frequency?
SELECT website FROM table_name_81 WHERE webcast = "listen live" AND frequency = 99.3
SELECT "website" FROM "table_name_81" WHERE "frequency" = 99.3 AND "listen live" = "webcast"
0.089844
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
Of the classes offered next Winter , which are ULCS ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%ULCS%' AND semester.semester = 'Winter' AND semester.year = 2017
SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course_offering"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Winter' AND "semester"."year" = 2017
0.428711
CREATE TABLE table_34848 ("Tournament" CLOB, "1981" CLOB, "1982" CLOB, "1983" CLOB, "1984" CLOB, "1985" CLOB, "1986" CLOB, "1987" CLOB, "1988" CLOB, "1989" CLOB)
Which 1988 has a 1982 of 104?
SELECT "1988" FROM table_34848 WHERE "1982" = '104'
SELECT "1988" FROM "table_34848" WHERE "1982" = '104'
0.051758
CREATE TABLE captain (Captain_ID NUMBER, Name CLOB, Ship_ID NUMBER, age CLOB, Class CLOB, Rank CLOB) CREATE TABLE Ship (Ship_ID NUMBER, Name CLOB, Type CLOB, Built_Year FLOAT, Class CLOB, Flag CLOB)
Show me a bar chart comparing the total number of captains in each rank, sort by the Rank in descending please.
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank DESC
SELECT "Rank", COUNT("Rank") FROM "captain" GROUP BY "Rank" ORDER BY "Rank" DESC
0.078125
CREATE TABLE table_10497 ("Title" CLOB, "Format" CLOB, "Label" CLOB, "Catalog number" CLOB, "Formats" CLOB, "Year" FLOAT)
Tell me the label for digital format with nebula remixes
SELECT "Label" FROM table_10497 WHERE "Formats" = 'digital' AND "Title" = 'nebula remixes'
SELECT "Label" FROM "table_10497" WHERE "Formats" = 'digital' AND "Title" = 'nebula remixes'
0.089844
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
how many white-russian patients were born before the year 2104?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.dob_year < "2104"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2104" > "demographic"."dob_year" AND "WHITE - RUSSIAN" = "demographic"."ethnicity"
0.154297
CREATE TABLE table_name_20 (year VARCHAR2, college VARCHAR2, pick VARCHAR2, position VARCHAR2)
How many years have a Pick of 12, and a Position of dt, and a College of penn state?
SELECT COUNT(year) FROM table_name_20 WHERE pick = "12" AND position = "dt" AND college = "penn state"
SELECT COUNT("year") FROM "table_name_20" WHERE "12" = "pick" AND "college" = "penn state" AND "dt" = "position"
0.109375
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
Top 1 Lac users in india.
SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "#", Users.Id AS "user_link", Users.Age, Users.Location, Users.Reputation, Users.Views, Users.UpVotes, Users.DownVotes, (SELECT COUNT(*) FROM Posts AS PQ WHERE PostTypeId = 1 AND PQ.OwnerUserId = Users.Id) AS "questions", (SELECT COUNT(*) FROM Posts AS PA WHERE PostTypeId = 2 AND PA.OwnerUserId = Users.Id) AS "answers" FROM Users WHERE Users.Id LIKE '%2050394%' ORDER BY Reputation DESC LIMIT 10
WITH "_u_0" AS (SELECT COUNT(*), 1 AS "_u_1", "PQ"."OwnerUserId" AS "_u_2" FROM "Posts" "PQ" GROUP BY 1, "PQ"."OwnerUserId"), "_u_3" AS (SELECT COUNT(*), 2 AS "_u_4", "PA"."OwnerUserId" AS "_u_5" FROM "Posts" "PA" GROUP BY 2, "PA"."OwnerUserId") SELECT ROW_NUMBER() OVER (ORDER BY "Users"."Reputation" DESC) AS "#", "Users"."Id" AS "user_link", "Users"."Age", "Users"."Location", "Users"."Reputation", "Users"."Views", "Users"."UpVotes", "Users"."DownVotes", COALESCE("_u_0"."", *) AS "questions", COALESCE("_u_3"."", *) AS "answers" FROM "Users" LEFT JOIN "_u_0" "_u_0" ON "PostTypeId" = "_u_0"."_u_1" AND "Users"."Id" = "_u_0"."_u_2" LEFT JOIN "_u_3" "_u_3" ON "PostTypeId" = "_u_3"."_u_4" AND "Users"."Id" = "_u_3"."_u_5" WHERE "Users"."Id" LIKE '%2050394%' ORDER BY "Reputation" DESC FETCH FIRST 10 ROWS ONLY
0.792969
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
indicate the yearly average volume of output (ml)-urethral catheter straight-tip 14 fr. that patient 033-32465 has had until 09/2104.
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465')) AND intakeoutput.celllabel = 'output (ml)-urethral catheter straight-tip 14 fr.' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m', intakeoutput.intakeoutputtime) <= '2104-09' GROUP BY STRFTIME('%y', intakeoutput.intakeoutputtime)
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '033-32465' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT AVG("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'output (ml)-urethral catheter straight-tip 14 fr.' AND "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "intakeoutput"."intakeoutputtime") <= '2104-09' GROUP BY STRFTIME('%y', "intakeoutput"."intakeoutputtime")
0.763672
CREATE TABLE table_14903491_1 (year VARCHAR2, womens_doubles VARCHAR2)
Name the year for victoria hristova neli nedialkova
SELECT year FROM table_14903491_1 WHERE womens_doubles = "Victoria Hristova Neli Nedialkova"
SELECT "year" FROM "table_14903491_1" WHERE "Victoria Hristova Neli Nedialkova" = "womens_doubles"
0.095703
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
what is the number of patients whose year of birth is less than 2175 and item id is 50896?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2175" AND lab.itemid = "50896"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50896" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2175" > "demographic"."dob_year"
0.188477
CREATE TABLE table_40260 ("Season" FLOAT, "Date" CLOB, "Venue" CLOB, "City" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Attendance" FLOAT)
On what Date was the Venue at Exhibition Stadium?
SELECT "Date" FROM table_40260 WHERE "Venue" = 'exhibition stadium'
SELECT "Date" FROM "table_40260" WHERE "Venue" = 'exhibition stadium'
0.067383
CREATE TABLE station (id NUMBER, name CLOB, lat NUMBER, long NUMBER, dock_count NUMBER, city CLOB, installation_date CLOB) CREATE TABLE status (station_id NUMBER, bikes_available NUMBER, docks_available NUMBER, time CLOB) CREATE TABLE trip (id NUMBER, duration NUMBER, start_date CLOB, start_station_name CLOB, start_station_id NUMBER, end_date CLOB, end_station_name CLOB, end_station_id NUMBER, bike_id NUMBER, subscription_type CLOB, zip_code NUMBER) CREATE TABLE weather (date CLOB, max_temperature_f NUMBER, mean_temperature_f NUMBER, min_temperature_f NUMBER, max_dew_point_f NUMBER, mean_dew_point_f NUMBER, min_dew_point_f NUMBER, max_humidity NUMBER, mean_humidity NUMBER, min_humidity NUMBER, max_sea_level_pressure_inches NUMBER, mean_sea_level_pressure_inches NUMBER, min_sea_level_pressure_inches NUMBER, max_visibility_miles NUMBER, mean_visibility_miles NUMBER, min_visibility_miles NUMBER, max_wind_speed_mph NUMBER, mean_wind_speed_mph NUMBER, max_gust_speed_mph NUMBER, precipitation_inches NUMBER, cloud_cover NUMBER, events CLOB, wind_dir_degrees NUMBER, zip_code NUMBER)
What are names of stations that have average bike availability above 10 and are not located in San Jose city?
SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = "San Jose"
SELECT "T1"."name" FROM "station" "T1" JOIN "status" "T2" ON "T1"."id" = "T2"."station_id" GROUP BY "T2"."station_id" HAVING AVG("bikes_available") > 10 EXCEPT SELECT "name" FROM "station" WHERE "San Jose" = "city"
0.208984
CREATE TABLE table_19385 ("Country" CLOB, "Local Name" CLOB, "Host" CLOB, "Channel" CLOB, "Year Aired" CLOB, "Top Prize" CLOB)
What country is the show aired on TVNZ?
SELECT "Country" FROM table_19385 WHERE "Channel" = 'TVNZ'
SELECT "Country" FROM "table_19385" WHERE "Channel" = 'TVNZ'
0.058594
CREATE TABLE table_1818254_1 (violent_crime VARCHAR2, robbery VARCHAR2)
What was the violent crime rate in the city where the robbery rate was 201.4?
SELECT violent_crime FROM table_1818254_1 WHERE robbery = "201.4"
SELECT "violent_crime" FROM "table_1818254_1" WHERE "201.4" = "robbery"
0.069336
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
what is the number of patients whose religion is romanian east. orth?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "ROMANIAN EAST. ORTH"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "ROMANIAN EAST. ORTH" = "demographic"."religion"
0.120117
CREATE TABLE table_name_39 (high_points VARCHAR2, date VARCHAR2)
Who had the highest points of the game on March 24?
SELECT high_points FROM table_name_39 WHERE date = "march 24"
SELECT "high_points" FROM "table_name_39" WHERE "date" = "march 24"
0.06543
CREATE TABLE captain (Captain_ID NUMBER, Name CLOB, Ship_ID NUMBER, age CLOB, Class CLOB, Rank CLOB) CREATE TABLE Ship (Ship_ID NUMBER, Name CLOB, Type CLOB, Built_Year FLOAT, Class CLOB, Flag CLOB)
Compare the total number of different ranks using a bar graph, and sort from low to high by the Y.
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY COUNT(Rank)
SELECT "Rank", COUNT("Rank") FROM "captain" GROUP BY "Rank" ORDER BY COUNT("Rank")
0.080078
CREATE TABLE table_5726 ("Date" CLOB, "Tournament" CLOB, "Location" CLOB, "Winner" CLOB, "Score" CLOB, "1st prize ( $ ) " FLOAT)
What is the location of the tournament on Feb 10?
SELECT "Location" FROM table_5726 WHERE "Date" = 'feb 10'
SELECT "Location" FROM "table_5726" WHERE "Date" = 'feb 10'
0.057617
CREATE TABLE table_46164 ("Name" CLOB, "GP-GS" CLOB, "Gain" FLOAT, "Loss" FLOAT, "Long" FLOAT, "Avg/G" FLOAT)
WHAT IS THE NUMBER OF LOSSES WITH A LONG SMALLER THAN 24, AND GAIN BIGGER THAN 116?
SELECT COUNT("Loss") FROM table_46164 WHERE "Long" < '24' AND "Gain" > '116'
SELECT COUNT("Loss") FROM "table_46164" WHERE "Gain" > '116' AND "Long" < '24'
0.076172
CREATE TABLE table_56462 ("Race name" CLOB, "Dist ( miles ) " CLOB, "Course" CLOB, "Prize" CLOB, "Odds" CLOB, "Runners" FLOAT, "Place" FLOAT, "Runner-up" CLOB)
Which race had a distance of 4 miles where the runner-up was not known?
SELECT "Race name" FROM table_56462 WHERE "Dist (miles)" = '4' AND "Runner-up" = 'not known'
SELECT "Race name" FROM "table_56462" WHERE "Dist (miles)" = '4' AND "Runner-up" = 'not known'
0.091797
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
During the Spring terms , what times is 596 taught ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 596 AND semester.semester IN ('SP', 'Spring', 'SS') AND semester.semester_id = course_offering.semester AND semester.year = 2016
SELECT DISTINCT "course_offering"."end_time", "course_offering"."friday", "course_offering"."monday", "course_offering"."saturday", "course_offering"."start_time", "course_offering"."sunday", "course_offering"."thursday", "course_offering"."tuesday", "course_offering"."wednesday" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" IN ('SP', 'Spring', 'SS') AND "semester"."year" = 2016 WHERE "course"."department" = 'EECS' AND "course"."number" = 596
0.580078
CREATE TABLE table_396 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
What team were the Bulls hosted by on December 7?
SELECT "Team" FROM table_396 WHERE "Date" = 'December 7'
SELECT "Team" FROM "table_396" WHERE "Date" = 'December 7'
0.056641
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
when was the last time that on the current hospital visit patient 030-42006 was diagnosed with respiratory alkalosis - therapeutic hyperventilation.
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'respiratory alkalosis - therapeutic hyperventilation' ORDER BY diagnosis.diagnosistime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '030-42006' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "diagnosis"."diagnosistime" FROM "diagnosis" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnosis"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'respiratory alkalosis - therapeutic hyperventilation' AND NOT "_u_1"."" IS NULL ORDER BY "diagnosis"."diagnosistime" DESC FETCH FIRST 1 ROWS ONLY
0.689453