schema
stringlengths
28
5.65k
question
stringlengths
0
990
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
9.17k
weight
float64
0
8.95
CREATE TABLE table_203_436 (id DECIMAL, "year" DECIMAL, "competition" TEXT, "venue" TEXT, "position" TEXT, "notes" TEXT)
what was china 's average position in the asian championships between 2002 and 2009 ?
SELECT AVG("position") FROM table_203_436 WHERE "competition" = 'asian championships'
SELECT AVG("position") FROM "table_203_436" WHERE "competition" = 'asian championships'
0.084961
CREATE TABLE table_54800 ("PRR Class" TEXT, "Builderpars_m_singles Model" TEXT, "Build date" TEXT, "Total produced" FLOAT, "Wheel arrangement" TEXT, "Service" TEXT, "Power output" TEXT)
What is the build date for PRR Class gf30a?
SELECT "Build date" FROM table_54800 WHERE "PRR Class" = 'gf30a'
SELECT "Build date" FROM "table_54800" WHERE "PRR Class" = 'gf30a'
0.064453
CREATE TABLE table_name_53 (series VARCHAR, release_date VARCHAR, production_num VARCHAR)
Which series had a release on 1939-07-15 with the 8863 production number?
SELECT series FROM table_name_53 WHERE release_date = "1939-07-15" AND production_num = "8863"
SELECT "series" FROM "table_name_53" WHERE "1939-07-15" = "release_date" AND "8863" = "production_num"
0.099609
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT) CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
For those products with a price between 60 and 120, a bar chart shows the distribution of name and manufacturer , and display x axis in descending order.
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name DESC
SELECT "Name", "Manufacturer" FROM "Products" WHERE "Price" <= 120 AND "Price" >= 60 ORDER BY "Name" DESC NULLS LAST
0.113281
CREATE TABLE table_name_52 (status VARCHAR, co_contestant__yaar_vs_pyaar_ VARCHAR)
Which Status has a Co-contestant (Yaar vs. Pyaar) of tina sachdev?
SELECT status FROM table_name_52 WHERE co_contestant__yaar_vs_pyaar_ = "tina sachdev"
SELECT "status" FROM "table_name_52" WHERE "co_contestant__yaar_vs_pyaar_" = "tina sachdev"
0.088867
CREATE TABLE Premises (premise_id INT, premises_type VARCHAR, premise_details VARCHAR) CREATE TABLE Order_Items (item_id INT, order_item_status_code VARCHAR, order_id INT, product_id INT, item_status_code VARCHAR, item_delivered_datetime DATETIME, item_order_quantity VARCHAR) CREATE TABLE Customer_Addresses (customer_id INT, premise_id INT, date_address_from DATETIME, address_type_code VARCHAR, date_address_to DATETIME) CREATE TABLE Customer_Orders (order_id INT, customer_id INT, order_status_code VARCHAR, shipping_method_code VARCHAR, order_placed_datetime DATETIME, order_delivered_datetime DATETIME, order_shipping_charges VARCHAR) CREATE TABLE Customers (customer_id INT, payment_method VARCHAR, customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_address VARCHAR, customer_login VARCHAR, customer_password VARCHAR) CREATE TABLE Mailshot_Customers (mailshot_id INT, customer_id INT, outcome_code VARCHAR, mailshot_customer_date DATETIME) CREATE TABLE Mailshot_Campaigns (mailshot_id INT, product_category VARCHAR, mailshot_name VARCHAR, mailshot_start_date DATETIME, mailshot_end_date DATETIME) CREATE TABLE Products (product_id INT, product_category VARCHAR, product_name VARCHAR)
Show all distinct product categories along with the number of mailshots in each category Visualize by bar chart, and could you sort in ascending by the x-axis please?
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY product_category
SELECT "product_category", COUNT(*) FROM "Mailshot_Campaigns" GROUP BY "product_category" ORDER BY "product_category" NULLS FIRST
0.125977
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
what is the number of patients who died primarily due to hypoxia before or in 2164?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.dod_year <= "2164.0"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2164.0" >= "demographic"."dod_year" AND "HYPOXIA" = "demographic"."diagnosis"
0.149414
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
when did the last procedure time of patient 25723 until 2104?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25723) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' ORDER BY procedures_icd.charttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25723 GROUP BY "hadm_id") SELECT "procedures_icd"."charttime" FROM "procedures_icd" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "procedures_icd"."charttime") <= '2104' ORDER BY "procedures_icd"."charttime" DESC NULLS LAST LIMIT 1
0.389648
CREATE TABLE table_204_310 (id DECIMAL, "month" TEXT, "year" DECIMAL, "player" TEXT, "county" TEXT, "club" TEXT, "position" DECIMAL)
ollie moran won in june 2007 , who won the month after ?
SELECT "player" FROM table_204_310 WHERE "year" = 2007 AND "month" = 6 + 1
SELECT "player" FROM "table_204_310" WHERE "month" = 7 AND "year" = 2007
0.070313
CREATE TABLE table_6551 ("Game" TEXT, "Date" TEXT, "Home Team" TEXT, "Result" TEXT, "Road Team" TEXT)
What is the road team of game 6 with Philadelphia as the home team?
SELECT "Road Team" FROM table_6551 WHERE "Home Team" = 'philadelphia' AND "Game" = 'game 6'
SELECT "Road Team" FROM "table_6551" WHERE "Game" = 'game 6' AND "Home Team" = 'philadelphia'
0.09082
CREATE TABLE table_name_67 (Id VARCHAR)
Who had 1990 of 2 2 in 1993?
SELECT 1993 FROM table_name_67 WHERE 1990 = "2–2"
SELECT 1993 FROM "table_name_67" WHERE "2–2" = 1990
0.049805
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
Downvotes per question by day.
SELECT Posts.Id, Score, VoteTypeId, COUNT(VoteTypeId), OwnerUserId, Title FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Posts.CreationDate BETWEEN '2012-06-20' AND '2012-06-21' AND PostTypeId = 1 GROUP BY Posts.Id, Title, OwnerUserId, OwnerDisplayName, Score, VoteTypeId HAVING VoteTypeId = 3 ORDER BY Posts.Id, VoteTypeId
SELECT "Posts"."Id", "Score", "VoteTypeId", COUNT("VoteTypeId"), "OwnerUserId", "Title" FROM "Posts" JOIN "Votes" ON "Posts"."Id" = "Votes"."PostId" WHERE "PostTypeId" = 1 AND "Posts"."CreationDate" <= '2012-06-21' AND "Posts"."CreationDate" >= '2012-06-20' GROUP BY "Posts"."Id", "Title", "OwnerUserId", "OwnerDisplayName", "Score", "VoteTypeId" HAVING "VoteTypeId" = 3 ORDER BY "Posts"."Id" NULLS FIRST, "VoteTypeId" NULLS FIRST
0.419922
CREATE TABLE table_54111 ("Driver" TEXT, "Constructor" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
What is the smallest grid for Ayrton Senna?
SELECT MIN("Grid") FROM table_54111 WHERE "Driver" = 'ayrton senna'
SELECT MIN("Grid") FROM "table_54111" WHERE "Driver" = 'ayrton senna'
0.067383
CREATE TABLE table_46631 ("Nominative" TEXT, "Ergative" TEXT, "Dative" TEXT, "Genitive" TEXT, "Instrumental" TEXT, "Adverbial" TEXT)
What is the adverbial for the nominative me?
SELECT "Adverbial" FROM table_46631 WHERE "Nominative" = 'me'
SELECT "Adverbial" FROM "table_46631" WHERE "Nominative" = 'me'
0.061523
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR) CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL) CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL) CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL) CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL) CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR) CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and employee_id , I want to display by the y axis in desc.
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
SELECT "JOB_ID", "EMPLOYEE_ID" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "EMPLOYEE_ID" DESC NULLS LAST
0.204102
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
give me the number of patients whose primary disease is transient ischemic attack and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND lab.fluid = "Blood"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Blood" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "TRANSIENT ISCHEMIC ATTACK" = "demographic"."diagnosis"
0.208984
CREATE TABLE candidate (Candidate_ID INT, People_ID INT, Poll_Source TEXT, Date TEXT, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT) CREATE TABLE people (People_ID INT, Sex TEXT, Name TEXT, Date_of_Birth TEXT, Height FLOAT, Weight FLOAT)
Return a bar chart about the distribution of Name and Height , and show Y-axis in descending order.
SELECT Name, Height FROM people ORDER BY Height DESC
SELECT "Name", "Height" FROM "people" ORDER BY "Height" DESC NULLS LAST
0.069336
CREATE TABLE table_12511 ("Benalla DFL" TEXT, "Wins" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Byes" FLOAT, "Against" FLOAT)
What is the most wins for draws greater than 0?
SELECT MAX("Wins") FROM table_12511 WHERE "Draws" > '0'
SELECT MAX("Wins") FROM "table_12511" WHERE "Draws" > '0'
0.055664
CREATE TABLE table_19908651_3 (pole_position VARCHAR, winning_driver VARCHAR, race_name VARCHAR)
Who was at the pole position in the ITT Automotive Grand Prix of Detroit, won by Paul Tracy?
SELECT pole_position FROM table_19908651_3 WHERE winning_driver = "Paul Tracy" AND race_name = "ITT Automotive Grand Prix of Detroit"
SELECT "pole_position" FROM "table_19908651_3" WHERE "ITT Automotive Grand Prix of Detroit" = "race_name" AND "Paul Tracy" = "winning_driver"
0.137695
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
since 112 months ago, what was the daily maximum weight of patient 28277?
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28277)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) >= DATETIME(CURRENT_TIME(), '-112 month') GROUP BY STRFTIME('%y-%m-%d', chartevents.charttime)
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 28277 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'admit wt' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT MAX("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE DATETIME("chartevents"."charttime") >= DATETIME(CURRENT_TIME(), '-112 month') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL GROUP BY STRFTIME('%y-%m-%d', "chartevents"."charttime")
0.808594
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
How many answers does this post have?.
SELECT * FROM Posts WHERE Id = 60850239
SELECT * FROM "Posts" WHERE "Id" = 60850239
0.041992
CREATE TABLE table_18174 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
Who was the incumbent of district Georgia 2?
SELECT "Incumbent" FROM table_18174 WHERE "District" = 'Georgia 2'
SELECT "Incumbent" FROM "table_18174" WHERE "District" = 'Georgia 2'
0.066406
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
count the number of patients whose age is less than 62 and days of hospital stay is greater than 4?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "62" AND demographic.days_stay > "4"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "4" < "demographic"."days_stay" AND "62" > "demographic"."age"
0.133789
CREATE TABLE TRANSACTIONS (transaction_id VARCHAR, share_count VARCHAR, transaction_type_code VARCHAR) CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR) CREATE TABLE LOTS (lot_details VARCHAR, lot_id VARCHAR)
What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is 'PUR'?
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = "PUR"
SELECT "T1"."lot_details" FROM "LOTS" AS "T1" JOIN "TRANSACTIONS_LOTS" AS "T2" ON "T1"."lot_id" = "T2"."transaction_id" JOIN "TRANSACTIONS" AS "T3" ON "PUR" = "T3"."transaction_type_code" AND "T2"."transaction_id" = "T3"."transaction_id" AND "T3"."share_count" > 100
0.259766
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
what is the total 1/2ns ivf consumption amount that patient 015-96048 has received on 10/01/last year?
SELECT SUM(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 = '015-96048')) AND intakeoutput.celllabel = '1/2ns ivf' AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '10-01'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '015-96048' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT SUM("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = '1/2ns ivf' AND "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m-%d', "intakeoutput"."intakeoutputtime") = '10-01'
0.787109
CREATE TABLE table_name_9 (team VARCHAR, score VARCHAR)
Which Team has a Score of 108-105 (ot)?
SELECT team FROM table_name_9 WHERE score = "108-105 (ot)"
SELECT "team" FROM "table_name_9" WHERE "108-105 (ot)" = "score"
0.0625
CREATE TABLE table_name_79 (class VARCHAR, frequency_mhz VARCHAR)
The frequency 89.3 belongs to what class?
SELECT class FROM table_name_79 WHERE frequency_mhz = 89.3
SELECT "class" FROM "table_name_79" WHERE "frequency_mhz" = 89.3
0.0625
CREATE TABLE table_18475 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
Which party had a person who has been in the seat since 1914?
SELECT "Party" FROM table_18475 WHERE "First elected" = '1914'
SELECT "Party" FROM "table_18475" WHERE "First elected" = '1914'
0.0625
CREATE TABLE table_46167 ("Rank" TEXT, "July 1 , 2013 projection" FLOAT, "% of pop." FLOAT, "Average relative annual growth ( % ) " FLOAT, "Average absolute annual growth" FLOAT)
What is the Average relative annual growth (%) for the country that ranks 41 and has a July 1, 2013 projection larger than 2,204,000?
SELECT COUNT("Average relative annual growth (%)") FROM table_46167 WHERE "Rank" = '41' AND "July 1, 2013 projection" > '2,204,000'
SELECT COUNT("Average relative annual growth (%)") FROM "table_46167" WHERE "July 1, 2013 projection" > '2,204,000' AND "Rank" = '41'
0.129883
CREATE TABLE table_dev_38 ("id" INT, "gender" TEXT, "serum_potassium" FLOAT, "systolic_blood_pressure_sbp" INT, "creatinine_clearance_cl" FLOAT, "estimated_glomerular_filtration_rate_egfr" INT, "diastolic_blood_pressure_dbp" INT, "ace_inhibitors" BOOLEAN, "serum_creatinine" FLOAT, "kidney_disease" BOOLEAN, "NOUSE" FLOAT)
participants with certain levels of kidney function _ serum creatinine ( scr ) 1.3 to 3.3 mg / dl ( 115 to 291 micromol / l ) inclusive for female and 1.5 to 3.5 mg / dl ( 132 to 309 micromol / l ) inclusive for male , or an estimated glomerular filtration rate ( egfr ) 20 to 60 ml / min / 1.73 m2
SELECT * FROM table_dev_38 WHERE kidney_disease = 1 OR (serum_creatinine > 1.3 AND serum_creatinine < 3.3 AND gender = 'female') OR (serum_creatinine > 1.5 AND serum_creatinine < 3.5 AND gender = 'male') OR (estimated_glomerular_filtration_rate_egfr >= 20 AND estimated_glomerular_filtration_rate_egfr <= 60)
SELECT * FROM "table_dev_38" WHERE ("estimated_glomerular_filtration_rate_egfr" <= 60 OR "gender" = 'female' OR "gender" = 'male' OR "kidney_disease" = 1) AND ("estimated_glomerular_filtration_rate_egfr" <= 60 OR "gender" = 'female' OR "kidney_disease" = 1 OR "serum_creatinine" > 1.5) AND ("estimated_glomerular_filtration_rate_egfr" <= 60 OR "gender" = 'male' OR "kidney_disease" = 1 OR "serum_creatinine" < 3.3) AND ("estimated_glomerular_filtration_rate_egfr" <= 60 OR "kidney_disease" = 1 OR "serum_creatinine" < 3.3 OR "serum_creatinine" > 1.5) AND ("estimated_glomerular_filtration_rate_egfr" <= 60 OR "kidney_disease" = 1 OR "serum_creatinine" < 3.5) AND ("estimated_glomerular_filtration_rate_egfr" <= 60 OR "kidney_disease" = 1 OR "serum_creatinine" > 1.3) AND ("estimated_glomerular_filtration_rate_egfr" >= 20 OR "gender" = 'female' OR "gender" = 'male' OR "kidney_disease" = 1) AND ("estimated_glomerular_filtration_rate_egfr" >= 20 OR "gender" = 'female' OR "kidney_disease" = 1 OR "serum_creatinine" > 1.5) AND ("estimated_glomerular_filtration_rate_egfr" >= 20 OR "gender" = 'male' OR "kidney_disease" = 1 OR "serum_creatinine" < 3.3) AND ("estimated_glomerular_filtration_rate_egfr" >= 20 OR "kidney_disease" = 1 OR "serum_creatinine" < 3.3 OR "serum_creatinine" > 1.5) AND ("estimated_glomerular_filtration_rate_egfr" >= 20 OR "kidney_disease" = 1 OR "serum_creatinine" < 3.5) AND ("estimated_glomerular_filtration_rate_egfr" >= 20 OR "kidney_disease" = 1 OR "serum_creatinine" > 1.3)
1.466797
CREATE TABLE table_78356 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
What's the average crowd size when the Home team is melbourne?
SELECT AVG("Crowd") FROM table_78356 WHERE "Home team" = 'melbourne'
SELECT AVG("Crowd") FROM "table_78356" WHERE "Home team" = 'melbourne'
0.068359
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
provide the number of patients whose gender is m and age is less than 74?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "74"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "74" > "demographic"."age" AND "M" = "demographic"."gender"
0.130859
CREATE TABLE table_24910 ("College" TEXT, "2007 Headcount" FLOAT, "2007-2008 credit hours" FLOAT, "County population 18 yrs+" FLOAT, "Penetration in terms of Enrollment per 1000 adults" FLOAT, "In-county tuition per credit hour ( fall 2009 ) " TEXT)
How much was the in-county tuition per credit hour at the Mercer College by the fall of 2009?
SELECT "In-county tuition per credit hour (fall 2009)" FROM table_24910 WHERE "College" = 'Mercer'
SELECT "In-county tuition per credit hour (fall 2009)" FROM "table_24910" WHERE "College" = 'Mercer'
0.097656
CREATE TABLE table_4461 ("Outcome" TEXT, "Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Opponent" TEXT, "Score" TEXT)
What date was gabriela paz-franco the opponent?
SELECT "Date" FROM table_4461 WHERE "Opponent" = 'gabriela paz-franco'
SELECT "Date" FROM "table_4461" WHERE "Opponent" = 'gabriela paz-franco'
0.070313
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
how many patients whose gender is m and diagnoses short title is long-term use anticoagul?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Long-term use anticoagul"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Long-term use anticoagul" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "M" = "demographic"."gender"
0.224609
CREATE TABLE document_locations (document_id DECIMAL, location_code TEXT, date_in_location_from TIME, date_in_locaton_to TIME) CREATE TABLE roles (role_code TEXT, role_name TEXT, role_description TEXT) CREATE TABLE ref_locations (location_code TEXT, location_name TEXT, location_description TEXT) CREATE TABLE ref_document_types (document_type_code TEXT, document_type_name TEXT, document_type_description TEXT) CREATE TABLE all_documents (document_id DECIMAL, date_stored TIME, document_type_code TEXT, document_name TEXT, document_description TEXT, other_details TEXT) CREATE TABLE ref_calendar (calendar_date TIME, day_number DECIMAL) CREATE TABLE employees (employee_id DECIMAL, role_code TEXT, employee_name TEXT, gender_mfu TEXT, date_of_birth TIME, other_details TEXT) CREATE TABLE documents_to_be_destroyed (document_id DECIMAL, destruction_authorised_by_employee_id DECIMAL, destroyed_by_employee_id DECIMAL, planned_destruction_date TIME, actual_destruction_date TIME, other_details TEXT)
Give me all the distinct location codes for documents.
SELECT DISTINCT location_code FROM document_locations
SELECT DISTINCT "location_code" FROM "document_locations"
0.055664
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
Higest rated user with more downvotes than upvotes.
SELECT u.Id AS "user_link", u.Reputation FROM Users AS u WHERE u.UpVotes < u.DownVotes ORDER BY u.Reputation DESC LIMIT 100
SELECT "u"."Id" AS "user_link", "u"."Reputation" FROM "Users" AS "u" WHERE "u"."DownVotes" > "u"."UpVotes" ORDER BY "u"."Reputation" DESC NULLS LAST LIMIT 100
0.154297
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
what is maximum age of patients whose insurance is self pay and primary disease is colangitis?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "COLANGITIS"
SELECT MAX("demographic"."age") FROM "demographic" WHERE "COLANGITIS" = "demographic"."diagnosis" AND "Self Pay" = "demographic"."insurance"
0.136719
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
what is minimum age of patients whose marital status is single and primary disease is left colon cancer?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "LEFT COLON CANCER"
SELECT MIN("demographic"."age") FROM "demographic" WHERE "LEFT COLON CANCER" = "demographic"."diagnosis" AND "SINGLE" = "demographic"."marital_status"
0.146484
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
what intake did patient 016-5052 last receive until 06/05/2104?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-5052')) AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2104-06-05' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '016-5052' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "intakeoutput"."celllabel" FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."cellpath" LIKE '%intake%' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m-%d', "intakeoutput"."intakeoutputtime") <= '2104-06-05' ORDER BY "intakeoutput"."intakeoutputtime" DESC NULLS LAST LIMIT 1
0.6875
CREATE TABLE table_14811 ("Office" TEXT, "Representative" TEXT, "Party" TEXT, "Residence" TEXT, "First Elected" TEXT)
Which Residence has a Party of dem, and a Representative of linda lawson?
SELECT "Residence" FROM table_14811 WHERE "Party" = 'dem' AND "Representative" = 'linda lawson'
SELECT "Residence" FROM "table_14811" WHERE "Party" = 'dem' AND "Representative" = 'linda lawson'
0.094727
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
what are the percentile of 83.0 in a glucose lab test given the same age of patient 42473 during their current hospital visit?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SELECT admissions.age FROM admissions WHERE admissions.subject_id = 42473 AND admissions.dischtime IS NULL))) AS t1 WHERE t1.valuenum = 83.0
WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'glucose' GROUP BY "itemid"), "_u_2" AS (SELECT "admissions"."hadm_id" FROM "admissions" JOIN "admissions" AS "admissions_2" ON "admissions"."age" = "admissions_2"."age" AND "admissions_2"."dischtime" IS NULL AND "admissions_2"."subject_id" = 42473 GROUP BY "hadm_id") SELECT DISTINCT PERCENT_RANK() OVER (ORDER BY "labevents"."valuenum" NULLS FIRST) FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "labevents"."hadm_id" WHERE "labevents"."valuenum" = 83.0 AND NOT "_u_0"."" IS NULL AND NOT "_u_2"."" IS NULL
0.658203
CREATE TABLE table_21006 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Game site" TEXT, "Record" TEXT, "Attendance" FLOAT)
How many weeks had an attendance of 60038?
SELECT COUNT("Week") FROM table_21006 WHERE "Attendance" = '60038'
SELECT COUNT("Week") FROM "table_21006" WHERE "Attendance" = '60038'
0.066406
CREATE TABLE Reservations (Code INT, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate FLOAT, LastName TEXT, FirstName TEXT, Adults INT, Kids INT) CREATE TABLE Rooms (RoomId TEXT, roomName TEXT, beds INT, bedType TEXT, maxOccupancy INT, basePrice INT, decor TEXT)
what is the average base price of different bed type? List bed type and average base price, could you list in asc by the Y?
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice)
SELECT "bedType", AVG("basePrice") FROM "Rooms" GROUP BY "bedType" ORDER BY AVG("basePrice") NULLS FIRST
0.101563
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT) CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
Draw a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Road, rank in desc by the x axis.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
SELECT "All_Home", "School_ID" FROM "basketball_match" GROUP BY "ACC_Road", "All_Home" ORDER BY "All_Home" DESC NULLS LAST
0.119141
CREATE TABLE table_name_15 (lost INT, drawn INT)
what is the most games lost when there were 0 draws?
SELECT MAX(lost) FROM table_name_15 WHERE drawn < 0
SELECT MAX("lost") FROM "table_name_15" WHERE "drawn" < 0
0.055664
CREATE TABLE table_18499 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
what's the result with dbeingtrict being florida 4
SELECT "Result" FROM table_18499 WHERE "District" = 'Florida 4'
SELECT "Result" FROM "table_18499" WHERE "District" = 'Florida 4'
0.063477
CREATE TABLE table_49646 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" FLOAT, "To par" TEXT)
What player has a score larger than 67?
SELECT "Player" FROM table_49646 WHERE "Score" > '67'
SELECT "Player" FROM "table_49646" WHERE "Score" > '67'
0.053711
CREATE TABLE table_7135 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" FLOAT)
What's the average Week with the Result l 23 3?
SELECT AVG("Week") FROM table_7135 WHERE "Result" = 'l 23–3'
SELECT AVG("Week") FROM "table_7135" WHERE "Result" = 'l 23–3'
0.060547
CREATE TABLE table_204_431 (id DECIMAL, "yacht" TEXT, "nation" TEXT, "owner" TEXT, "skipper" TEXT, "launch year" DECIMAL)
how many yachts are on the list total ?
SELECT COUNT("yacht") FROM table_204_431
SELECT COUNT("yacht") FROM "table_204_431"
0.041016
CREATE TABLE table_2622469_1 (starts VARCHAR, avg_finish VARCHAR)
How many different starts had an average finish of 17.9?
SELECT COUNT(starts) FROM table_2622469_1 WHERE avg_finish = "17.9"
SELECT COUNT("starts") FROM "table_2622469_1" WHERE "17.9" = "avg_finish"
0.071289
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
how many patients posses self pay insurance and are tested with c-reactive protein in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "C-Reactive Protein"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "C-Reactive Protein" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "Self Pay" = "demographic"."insurance"
0.205078
CREATE TABLE table_40604 ("Rank" FLOAT, "Name" TEXT, "Team" TEXT, "Games" FLOAT, "Rebounds" FLOAT)
What is the highest Games, when Rebounds is greater than 100, when Name is Nikola Pekovi , and when Rank is less than 4?
SELECT MAX("Games") FROM table_40604 WHERE "Rebounds" > '100' AND "Name" = 'nikola peković' AND "Rank" < '4'
SELECT MAX("Games") FROM "table_40604" WHERE "Name" = 'nikola peković' AND "Rank" < '4' AND "Rebounds" > '100'
0.107422
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT) CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
Bar chart of minimal price from each name, and order by the y-axis from high to low.
SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY MIN(Price) DESC
SELECT "Name", MIN("Price") FROM "Products" GROUP BY "Name" ORDER BY MIN("Price") DESC NULLS LAST
0.094727
CREATE TABLE table_name_86 (home_team VARCHAR, venue VARCHAR)
What was the home team score at junction oval?
SELECT home_team AS score FROM table_name_86 WHERE venue = "junction oval"
SELECT "home_team" AS "score" FROM "table_name_86" WHERE "junction oval" = "venue"
0.080078
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
Find Posts with a Reopen Votes review queue resulted in Leave Closed.
SELECT P.Id AS Post_Id, P.LastEditDate AS Post_LastEditDate, 'site://posts/' + CAST(P.Id AS TEXT) + '/timeline' AS Timeline_Link, P.Title AS Post_Title FROM ReviewTasks AS RT INNER JOIN ReviewTaskResults AS RTR ON RT.CompletedByReviewTaskId = RTR.Id INNER JOIN Posts AS P ON RT.PostId = P.Id WHERE (RT.ReviewTaskTypeId = 6 AND RTR.ReviewTaskResultTypeId = 13) ORDER BY P.LastEditDate DESC LIMIT 500
SELECT "P"."Id" AS "Post_Id", "P"."LastEditDate" AS "Post_LastEditDate", CONCAT(CONCAT('site://posts/', CAST("P"."Id" AS TEXT)), '/timeline') AS "Timeline_Link", "P"."Title" AS "Post_Title" FROM "ReviewTasks" AS "RT" JOIN "Posts" AS "P" ON "P"."Id" = "RT"."PostId" JOIN "ReviewTaskResults" AS "RTR" ON "RT"."CompletedByReviewTaskId" = "RTR"."Id" AND "RTR"."ReviewTaskResultTypeId" = 13 WHERE "RT"."ReviewTaskTypeId" = 6 ORDER BY "P"."LastEditDate" DESC NULLS LAST LIMIT 500
0.461914
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
what is the maximum arterial bp mean of patient 16904 on the first intensive care unit visit?
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16904) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents')
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 16904 GROUP BY "hadm_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp mean' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT MAX("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE "chartevents"."icustay_id" IN (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND NOT "icustays"."outtime" IS NULL ORDER BY "icustays"."intime" NULLS FIRST LIMIT 1) AND NOT "_u_2"."" IS NULL
0.672852
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
what is the amount of sump #1 patient 52898 has since 01/12/2100?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sump #1' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2100-01-12'
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 52898 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'sump #1' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT SUM("outputevents"."value") FROM "outputevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") >= '2100-01-12'
0.741211
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
count the number of patients whose diagnoses short title is status autm crd dfbrltr?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Status autm crd dfbrltr" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id"
0.189453
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
what is a drug that patient 61591 was prescribed for within the same hospital visit after receiving cont inv mec ven 96+ hrs in 05/this year?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv mec ven 96+ hrs') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', procedures_icd.charttime) = '05') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', prescriptions.startdate) = '05') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id
WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate", "admissions"."hadm_id" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" AND "admissions"."subject_id" = 61591 WHERE DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', "prescriptions"."startdate") = '05') SELECT "t2"."drug" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'cont inv mec ven 96+ hrs' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" AND "admissions"."subject_id" = 61591 JOIN "t2" AS "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "procedures_icd"."charttime" < "t2"."startdate" WHERE DATETIME("procedures_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', "procedures_icd"."charttime") = '05'
1.043945
CREATE TABLE table_15472061_1 (title VARCHAR, production_code VARCHAR)
Name the total number of titles for 3020 production code
SELECT COUNT(title) FROM table_15472061_1 WHERE production_code = "3020"
SELECT COUNT("title") FROM "table_15472061_1" WHERE "3020" = "production_code"
0.076172
CREATE TABLE table_45617 ("Week #" TEXT, "Theme" TEXT, "Song choice" TEXT, "Original artist" TEXT, "Result" TEXT)
What was the result during the week # of top 8?
SELECT "Result" FROM table_45617 WHERE "Week #" = 'top 8'
SELECT "Result" FROM "table_45617" WHERE "Week #" = 'top 8'
0.057617
CREATE TABLE table_22289 ("Departure" TEXT, "Going to" TEXT, "Calling at" TEXT, "Arrival" TEXT, "Operator" TEXT)
What was the train destination when it has a calling at Boston, Sleaford, Nottingham Victoria?
SELECT "Going to" FROM table_22289 WHERE "Calling at" = 'Boston, Sleaford, Nottingham Victoria'
SELECT "Going to" FROM "table_22289" WHERE "Calling at" = 'Boston, Sleaford, Nottingham Victoria'
0.094727
CREATE TABLE table_name_90 (home VARCHAR, score VARCHAR)
Who was the home team when the score was 0:1?
SELECT home FROM table_name_90 WHERE score = "0:1"
SELECT "home" FROM "table_name_90" WHERE "0:1" = "score"
0.054688
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
how many patients are diagnosed with secundum atrial septum defect?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Secundum atrial sept def"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Secundum atrial sept def" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id"
0.19043
CREATE TABLE table_36803 ("Player" TEXT, "Attempts" FLOAT, "Yards" FLOAT, "Average" FLOAT, "Long" FLOAT, "Touchdowns" FLOAT)
What is the total number for long when there are 19 attempts?
SELECT COUNT("Long") FROM table_36803 WHERE "Attempts" = '19'
SELECT COUNT("Long") FROM "table_36803" WHERE "Attempts" = '19'
0.061523
CREATE TABLE table_67093 ("Year" FLOAT, "Class" TEXT, "Team" TEXT, "Points" FLOAT, "Rank" TEXT, "Wins" FLOAT)
Name the rank for wins of 0 and points of 2
SELECT "Rank" FROM table_67093 WHERE "Wins" = '0' AND "Points" = '2'
SELECT "Rank" FROM "table_67093" WHERE "Points" = '2' AND "Wins" = '0'
0.068359
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE gsi (course_offering_id INT, student_id INT) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
Would any requirements be fulfilled by MKT 399 besides general elective ?
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'MKT' AND course.number = 399 AND program_course.course_id = course.course_id
SELECT DISTINCT "program_course"."category" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" WHERE "course"."department" = 'MKT' AND "course"."number" = 399
0.193359
CREATE TABLE table_name_34 (circuit VARCHAR, winner VARCHAR, series VARCHAR)
What is the Circuit in the ATCC Round 1 Series with Winner Jim Richards?
SELECT circuit FROM table_name_34 WHERE winner = "jim richards" AND series = "atcc round 1"
SELECT "circuit" FROM "table_name_34" WHERE "atcc round 1" = "series" AND "jim richards" = "winner"
0.09668
CREATE TABLE code_description (code VARCHAR, description TEXT) CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR) CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT) CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT) CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR) CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT) CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR) CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT) CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT) CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT) CREATE TABLE days (days_code VARCHAR, day_name VARCHAR) CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR) CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR) CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT) CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT) CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT) CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR) CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR) CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT) CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR) CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT) CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT) CREATE TABLE month (month_number INT, month_name TEXT) CREATE TABLE flight_fare (flight_id INT, fare_id INT)
i'd like a ticket from DENVER to ATLANTA with a stopover in PITTSBURGH is this possible
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'PITTSBURGH' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DENVER' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "flight_stop" ON "flight"."flight_id" = "flight_stop"."flight_id" JOIN "airport_service" AS "AIRPORT_SERVICE_2" ON "AIRPORT_SERVICE_2"."airport_code" = "flight_stop"."stop_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'ATLANTA' JOIN "city" AS "CITY_2" ON "AIRPORT_SERVICE_2"."city_code" = "CITY_2"."city_code" AND "CITY_2"."city_name" = 'PITTSBURGH'
0.793945
CREATE TABLE table_dev_50 ("id" INT, "gender" TEXT, "hemoglobin_a1c_hba1c" FLOAT, "diabetic" TEXT, "estimated_glomerular_filtration_rate_egfr" INT, "hba1c" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
type ii diabetes mellitus with a hemoglobin a1c ( hba1c ) greater than or equal to ( >= ) 6.5 percent ( % ) and less than or equal to ( <= ) 12 % , with an estimated glomerular filtration rate ( egfr ) of >= 30 milliliter ( ml ) / minute ( min ) / 1.73 meter ( m ) ^2 and less than ( < ) 90 ml / min / 1.73 m^2
SELECT * FROM table_dev_50 WHERE diabetic = 'ii' AND hemoglobin_a1c_hba1c >= 6.5 AND hemoglobin_a1c_hba1c <= 12 AND (estimated_glomerular_filtration_rate_egfr >= 30 AND estimated_glomerular_filtration_rate_egfr < 90)
SELECT * FROM "table_dev_50" WHERE "diabetic" = 'ii' AND "estimated_glomerular_filtration_rate_egfr" < 90 AND "estimated_glomerular_filtration_rate_egfr" >= 30 AND "hemoglobin_a1c_hba1c" <= 12 AND "hemoglobin_a1c_hba1c" >= 6.5
0.220703
CREATE TABLE table_name_8 (total INT, rank VARCHAR, silver VARCHAR)
Rank of 5, and a Silver larger than 0 had what sum of total?
SELECT SUM(total) FROM table_name_8 WHERE rank = "5" AND silver > 0
SELECT SUM("total") FROM "table_name_8" WHERE "5" = "rank" AND "silver" > 0
0.073242
CREATE TABLE table_name_44 (money___ INT, country VARCHAR)
What shows for money ( ) when South Africa is the country?
SELECT MAX(money___) AS Β£__ FROM table_name_44 WHERE country = "south africa"
SELECT MAX("money___") AS "Β£__" FROM "table_name_44" WHERE "country" = "south africa"
0.083008
CREATE TABLE table_4387 ("Rank" TEXT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
The Soviet Union has won more than 2 Silver, but how many Bronzes?
SELECT COUNT("Bronze") FROM table_4387 WHERE "Nation" = 'soviet union' AND "Silver" > '2'
SELECT COUNT("Bronze") FROM "table_4387" WHERE "Nation" = 'soviet union' AND "Silver" > '2'
0.088867
CREATE TABLE table_9382 ("Date" TEXT, "Opponent" TEXT, "Site" TEXT, "Result" TEXT, "Attendance" TEXT)
What is Attendance, when Opponent is 'At Syracuse'?
SELECT "Attendance" FROM table_9382 WHERE "Opponent" = 'at syracuse'
SELECT "Attendance" FROM "table_9382" WHERE "Opponent" = 'at syracuse'
0.068359
CREATE TABLE table_name_36 (being__qualities_ VARCHAR, having__things_ VARCHAR)
Name the being qualities for having things of language, religions, work, customs, values, norms
SELECT being__qualities_ FROM table_name_36 WHERE having__things_ = "language, religions, work, customs, values, norms"
SELECT "being__qualities_" FROM "table_name_36" WHERE "having__things_" = "language, religions, work, customs, values, norms"
0.12207
CREATE TABLE table_name_29 (championship_game VARCHAR, final_four VARCHAR, conference VARCHAR)
What is the Championship Game when the Final Four is 1 and the conference is American South?
SELECT championship_game FROM table_name_29 WHERE final_four = "1" AND conference = "american south"
SELECT "championship_game" FROM "table_name_29" WHERE "1" = "final_four" AND "american south" = "conference"
0.105469
CREATE TABLE table_4876 ("Place" FLOAT, "Team" TEXT, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Goals For" FLOAT, "Goals Against" FLOAT)
How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1?
SELECT COUNT("Goals Against") FROM table_4876 WHERE "Lost" > '7' AND "Goals For" < '27' AND "Drawn" > '1'
SELECT COUNT("Goals Against") FROM "table_4876" WHERE "Drawn" > '1' AND "Goals For" < '27' AND "Lost" > '7'
0.104492
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
what is the total number of unmarried patients who had insertion of 2 vascular stents?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "Insert 2 vascular stents"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Insert 2 vascular stents" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "SINGLE" = "demographic"."marital_status"
0.240234
CREATE TABLE table_62401 ("Team 1" TEXT, "Score" TEXT, "Team 2" TEXT, "1st round" TEXT, "2nd round" TEXT)
What is the first round when team 1 was toulouse fc (d1)?
SELECT "1st round" FROM table_62401 WHERE "Team 1" = 'toulouse fc (d1)'
SELECT "1st round" FROM "table_62401" WHERE "Team 1" = 'toulouse fc (d1)'
0.071289
CREATE TABLE table_73968 ("No." FLOAT, "#" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Patient Portrayer" TEXT, "Original air date" TEXT, "Production code" TEXT)
What is the total number of patient portayers for the episode directed by Craig Zisk and written by Brad Falchuk?
SELECT COUNT("Patient Portrayer") FROM table_73968 WHERE "Directed by" = 'Craig Zisk' AND "Written by" = 'Brad Falchuk'
SELECT COUNT("Patient Portrayer") FROM "table_73968" WHERE "Directed by" = 'Craig Zisk' AND "Written by" = 'Brad Falchuk'
0.118164
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
what is the number of patients whose year of birth is less than 2053 and item id is 51383?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2053" AND lab.itemid = "51383"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "51383" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2053" > "demographic"."dob_year"
0.188477
CREATE TABLE table_17289224_1 (team_name VARCHAR, season VARCHAR)
Which team started 2010?
SELECT team_name FROM table_17289224_1 WHERE season = "2010"
SELECT "team_name" FROM "table_17289224_1" WHERE "2010" = "season"
0.064453
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
Questions with answer along with tag.
SELECT p.Id, p.Title, p.Score, p.ViewCount, p.AnswerCount, p.CommentCount FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id JOIN Posts AS a ON p.AcceptedAnswerId = a.Id WHERE (t.TagName = '##TagName:string##') AND (NOT p.AcceptedAnswerId IS NULL) AND (p.CreationDate >= '##Date1?2016-01-01##') AND (p.CreationDate <= '##Date2?2019-12-10##') ORDER BY p.Score DESC
SELECT "p"."Id", "p"."Title", "p"."Score", "p"."ViewCount", "p"."AnswerCount", "p"."CommentCount" FROM "Posts" AS "p" JOIN "Posts" AS "a" ON "a"."Id" = "p"."AcceptedAnswerId" JOIN "PostTags" AS "pt" ON "p"."Id" = "pt"."PostId" JOIN "Tags" AS "t" ON "pt"."TagId" = "t"."Id" AND "t"."TagName" = '##TagName:string##' WHERE "p"."CreationDate" <= '##Date2?2019-12-10##' AND "p"."CreationDate" >= '##Date1?2016-01-01##' AND NOT "p"."AcceptedAnswerId" IS NULL ORDER BY "p"."Score" DESC NULLS LAST
0.477539
CREATE TABLE table_name_82 (mascot VARCHAR, county VARCHAR)
what is the mascot when the county is 43 kosciusko?
SELECT mascot FROM table_name_82 WHERE county = "43 kosciusko"
SELECT "mascot" FROM "table_name_82" WHERE "43 kosciusko" = "county"
0.066406
CREATE TABLE table_name_16 (attendance INT, week INT)
What is the total attendance before week 1?
SELECT SUM(attendance) FROM table_name_16 WHERE week < 1
SELECT SUM("attendance") FROM "table_name_16" WHERE "week" < 1
0.060547
CREATE TABLE salary (year INT, team_id TEXT, league_id TEXT, player_id TEXT, salary INT) CREATE TABLE player_award (player_id TEXT, award_id TEXT, year INT, league_id TEXT, tie TEXT, notes TEXT) CREATE TABLE fielding_outfield (player_id TEXT, year INT, stint INT, glf DECIMAL, gcf DECIMAL, grf DECIMAL) CREATE TABLE player_award_vote (award_id TEXT, year INT, league_id TEXT, player_id TEXT, points_won DECIMAL, points_max INT, votes_first DECIMAL) CREATE TABLE manager (player_id TEXT, year INT, team_id TEXT, league_id TEXT, inseason INT, g INT, w INT, l INT, rank DECIMAL, plyr_mgr TEXT) CREATE TABLE park (park_id TEXT, park_name TEXT, park_alias TEXT, city TEXT, state TEXT, country TEXT) CREATE TABLE hall_of_fame (player_id TEXT, yearid INT, votedby TEXT, ballots DECIMAL, needed DECIMAL, votes DECIMAL, inducted TEXT, category TEXT, needed_note TEXT) CREATE TABLE fielding_postseason (player_id TEXT, year INT, team_id TEXT, league_id TEXT, round TEXT, pos TEXT, g INT, gs DECIMAL, inn_outs DECIMAL, po INT, a INT, e INT, dp INT, tp INT, pb DECIMAL, sb DECIMAL, cs DECIMAL) CREATE TABLE team_franchise (franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT) CREATE TABLE batting_postseason (year INT, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INT, ab INT, r INT, h INT, double INT, triple INT, hr INT, rbi INT, sb INT, cs DECIMAL, bb INT, so INT, ibb DECIMAL, hbp DECIMAL, sh DECIMAL, sf DECIMAL, g_idp DECIMAL) CREATE TABLE team (year INT, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INT, g INT, ghome DECIMAL, w INT, l INT, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r INT, ab INT, h INT, double INT, triple INT, hr INT, bb INT, so DECIMAL, sb DECIMAL, cs DECIMAL, hbp DECIMAL, sf DECIMAL, ra INT, er INT, era DECIMAL, cg INT, sho INT, sv INT, ipouts INT, ha INT, hra INT, bba INT, soa INT, e INT, dp DECIMAL, fp DECIMAL, name TEXT, park TEXT, attendance DECIMAL, bpf INT, ppf INT, team_id_br TEXT, team_id_lahman45 TEXT, team_id_retro TEXT) CREATE TABLE batting (player_id TEXT, year INT, stint INT, team_id TEXT, league_id TEXT, g INT, ab DECIMAL, r DECIMAL, h DECIMAL, double DECIMAL, triple DECIMAL, hr DECIMAL, rbi DECIMAL, sb DECIMAL, cs DECIMAL, bb DECIMAL, so DECIMAL, ibb DECIMAL, hbp DECIMAL, sh DECIMAL, sf DECIMAL, g_idp DECIMAL) CREATE TABLE manager_award_vote (award_id TEXT, year INT, league_id TEXT, player_id TEXT, points_won INT, points_max INT, votes_first INT) CREATE TABLE pitching (player_id TEXT, year INT, stint INT, team_id TEXT, league_id TEXT, w INT, l INT, g INT, gs INT, cg INT, sho INT, sv INT, ipouts DECIMAL, h INT, er INT, hr INT, bb INT, so INT, baopp DECIMAL, era DECIMAL, ibb DECIMAL, wp DECIMAL, hbp DECIMAL, bk INT, bfp DECIMAL, gf DECIMAL, r INT, sh DECIMAL, sf DECIMAL, g_idp DECIMAL) CREATE TABLE fielding (player_id TEXT, year INT, stint INT, team_id TEXT, league_id TEXT, pos TEXT, g INT, gs DECIMAL, inn_outs DECIMAL, po DECIMAL, a DECIMAL, e DECIMAL, dp DECIMAL, pb DECIMAL, wp DECIMAL, sb DECIMAL, cs DECIMAL, zr DECIMAL) CREATE TABLE team_half (year INT, league_id TEXT, team_id TEXT, half INT, div_id TEXT, div_win TEXT, rank INT, g INT, w INT, l INT) CREATE TABLE manager_award (player_id TEXT, award_id TEXT, year INT, league_id TEXT, tie TEXT, notes DECIMAL) CREATE TABLE postseason (year INT, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INT, losses INT, ties INT) CREATE TABLE pitching_postseason (player_id TEXT, year INT, round TEXT, team_id TEXT, league_id TEXT, w INT, l INT, g INT, gs INT, cg INT, sho INT, sv INT, ipouts INT, h INT, er INT, hr INT, bb INT, so INT, baopp TEXT, era DECIMAL, ibb DECIMAL, wp DECIMAL, hbp DECIMAL, bk DECIMAL, bfp DECIMAL, gf INT, r INT, sh DECIMAL, sf DECIMAL, g_idp DECIMAL) CREATE TABLE all_star (player_id TEXT, year INT, game_num INT, game_id TEXT, team_id TEXT, league_id TEXT, gp DECIMAL, starting_pos DECIMAL) CREATE TABLE player (player_id TEXT, birth_year DECIMAL, birth_month DECIMAL, birth_day DECIMAL, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year DECIMAL, death_month DECIMAL, death_day DECIMAL, death_country TEXT, death_state TEXT, death_city TEXT, name_first TEXT, name_last TEXT, name_given TEXT, weight DECIMAL, height DECIMAL, bats TEXT, throws TEXT, debut TEXT, final_game TEXT, retro_id TEXT, bbref_id TEXT) CREATE TABLE player_college (player_id TEXT, college_id TEXT, year INT) CREATE TABLE manager_half (player_id TEXT, year INT, team_id TEXT, league_id TEXT, inseason INT, half INT, g INT, w INT, l INT, rank INT) CREATE TABLE college (college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT) CREATE TABLE home_game (year INT, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INT, openings INT, attendance INT) CREATE TABLE appearances (year INT, team_id TEXT, league_id TEXT, player_id TEXT, g_all DECIMAL, gs DECIMAL, g_batting INT, g_defense DECIMAL, g_p INT, g_c INT, g_1b INT, g_2b INT, g_3b INT, g_ss INT, g_lf INT, g_cf INT, g_rf INT, g_of INT, g_dh DECIMAL, g_ph DECIMAL, g_pr DECIMAL)
Show me the frequency of those years (bin year into year interval) that the team Boston Red Stockings won in the postseasons with a bar chart, I want to order by the x axis in desc please.
SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
SELECT "year", COUNT("year") FROM "postseason" AS "T1" JOIN "team" AS "T2" ON "T1"."team_id_winner" = "T2"."team_id_br" AND "T2"."name" = 'Boston Red Stockings' ORDER BY "year" DESC NULLS LAST
0.1875
CREATE TABLE table_63371 ("Constituency number" TEXT, "Name" TEXT, "Reserved for ( SC / ST /None ) " TEXT, "District" TEXT, "Number of electorates ( 2009 ) " FLOAT)
what is the name when the constituency number is 150?
SELECT "Name" FROM table_63371 WHERE "Constituency number" = '150'
SELECT "Name" FROM "table_63371" WHERE "Constituency number" = '150'
0.066406
CREATE TABLE table_40705 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" TEXT)
What is the latest week with a game with a result of l 12 7?
SELECT MAX("Week") FROM table_40705 WHERE "Result" = 'l 12–7'
SELECT MAX("Week") FROM "table_40705" WHERE "Result" = 'l 12–7'
0.061523
CREATE TABLE table_name_44 (date VARCHAR, score VARCHAR, result VARCHAR, competition VARCHAR)
Result of l, and a Competition of 1966 asian games, and a Score of 0 1 had what date?
SELECT date FROM table_name_44 WHERE result = "l" AND competition = "1966 asian games" AND score = "0–1"
SELECT "date" FROM "table_name_44" WHERE "0–1" = "score" AND "1966 asian games" = "competition" AND "l" = "result"
0.111328
CREATE TABLE table_name_64 (draw VARCHAR, performer VARCHAR, points VARCHAR)
What is the total number of draws for songs performed by Miranda with fewer than 48 points?
SELECT COUNT(draw) FROM table_name_64 WHERE performer = "miranda" AND points < 48
SELECT COUNT("draw") FROM "table_name_64" WHERE "miranda" = "performer" AND "points" < 48
0.086914
CREATE TABLE table_name_65 (venue VARCHAR, home_team VARCHAR)
What venue features essendon at home?
SELECT venue FROM table_name_65 WHERE home_team = "essendon"
SELECT "venue" FROM "table_name_65" WHERE "essendon" = "home_team"
0.064453
CREATE TABLE table_63078 ("Rank ( 2012 ) " FLOAT, "Rank ( 2010 ) " FLOAT, "Employer" TEXT, "Industry" TEXT, "2012 Employees ( Total ) " FLOAT, "2010 Employees ( Total ) " FLOAT, "2007 Employees ( Total ) " TEXT, "Head office" TEXT)
What is the total number of 2012 Employees (Total) when 2007 Employees (Total) is 8,985, and rank (2010) is smaller than 9?
SELECT COUNT("2012 Employees (Total)") FROM table_63078 WHERE "2007 Employees (Total)" = '8,985' AND "Rank (2010)" < '9'
SELECT COUNT("2012 Employees (Total)") FROM "table_63078" WHERE "2007 Employees (Total)" = '8,985' AND "Rank (2010)" < '9'
0.119141
CREATE TABLE table_70363 ("Rank" TEXT, "Margin" TEXT, "Club" TEXT, "Opponent" TEXT, "Year" TEXT, "Round" TEXT, "Venue" TEXT)
which round has a margin of 178?
SELECT "Round" FROM table_70363 WHERE "Margin" = '178'
SELECT "Round" FROM "table_70363" WHERE "Margin" = '178'
0.054688
CREATE TABLE table_14655917_1 (date VARCHAR, opponent VARCHAR)
What day was the oppenent the detroit lions?
SELECT date FROM table_14655917_1 WHERE opponent = "Detroit Lions"
SELECT "date" FROM "table_14655917_1" WHERE "Detroit Lions" = "opponent"
0.070313
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
Votos/Publicaciones y Votos/Vistas paratodos los sitios de Stack Exchange.
SELECT * FROM Posts WHERE PostTypeId = 3
SELECT * FROM "Posts" WHERE "PostTypeId" = 3
0.042969
CREATE TABLE table_12165135_1 (position VARCHAR, overall_pick__number VARCHAR)
What is the position for the pick number 17?
SELECT position FROM table_12165135_1 WHERE overall_pick__number = 17
SELECT "position" FROM "table_12165135_1" WHERE "overall_pick__number" = 17
0.073242
CREATE TABLE Courses (course_id INT, author_id INT, subject_id INT, course_name VARCHAR, course_description VARCHAR) CREATE TABLE Subjects (subject_id INT, subject_name VARCHAR) CREATE TABLE Student_Tests_Taken (registration_id INT, date_test_taken DATETIME, test_result VARCHAR) CREATE TABLE Course_Authors_and_Tutors (author_id INT, author_tutor_ATB VARCHAR, login_name VARCHAR, password VARCHAR, personal_name VARCHAR, middle_name VARCHAR, family_name VARCHAR, gender_mf VARCHAR, address_line_1 VARCHAR) CREATE TABLE Students (student_id INT, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR, password VARCHAR, personal_name VARCHAR, middle_name VARCHAR, family_name VARCHAR) CREATE TABLE Student_Course_Enrolment (registration_id INT, student_id INT, course_id INT, date_of_enrolment DATETIME, date_of_completion DATETIME)
Find the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and count them by a bar chart
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh"
SELECT "date_of_latest_logon", COUNT("date_of_latest_logon") FROM "Students" WHERE "Jaskolski" = "family_name" OR "Langosh" = "family_name"
0.135742
CREATE TABLE table_12643 ("South West DFL" TEXT, "Wins" FLOAT, "Byes" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
What is the average value for Wins, when South West DFL is 'Coleraine', and when Byes is greater than 0?
SELECT AVG("Wins") FROM table_12643 WHERE "South West DFL" = 'coleraine' AND "Byes" > '0'
SELECT AVG("Wins") FROM "table_12643" WHERE "Byes" > '0' AND "South West DFL" = 'coleraine'
0.088867
CREATE TABLE table_name_51 (player VARCHAR, place VARCHAR, score VARCHAR)
who is the player when the place is t5 and the score is 69-66-71=206?
SELECT player FROM table_name_51 WHERE place = "t5" AND score = 69 - 66 - 71 = 206
SELECT "player" FROM "table_name_51" WHERE "place" = "t5" AND "score" = FALSE
0.075195