schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE table_name_65 (field_goals INT, points INT)
| What is the average number of field goals for players with more than 60 points? | SELECT AVG(field_goals) FROM table_name_65 WHERE points > 60 | SELECT AVG("field_goals") FROM "table_name_65" WHERE "points" > 60 | 0.064453 |
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE 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 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 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 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostTypes (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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
| Old answers edited by me recently. | SELECT a.Id AS "post_link", a.LastActivityDate AS Date FROM Posts AS a WHERE a.PostTypeId = 2 AND a.CreationDate < '2014-01-01' AND a.LastActivityDate > '2017-07-07' AND a.LastEditorUserId = '##userId##' ORDER BY a.LastActivityDate DESC | SELECT "a"."Id" AS "post_link", "a"."LastActivityDate" AS "Date" FROM "Posts" AS "a" WHERE "a"."CreationDate" < '2014-01-01' AND "a"."LastActivityDate" > '2017-07-07' AND "a"."LastEditorUserId" = '##userId##' AND "a"."PostTypeId" = 2 ORDER BY "a"."LastActivityDate" DESC NULLS LAST | 0.274414 |
CREATE TABLE checking (custid DECIMAL, balance DECIMAL)
CREATE TABLE savings (custid DECIMAL, balance DECIMAL)
CREATE TABLE accounts (custid DECIMAL, name TEXT)
| What are the names of customers with a higher checking balance than savings balance? | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance | SELECT "T1"."name" FROM "accounts" AS "T1" JOIN "checking" AS "T2" ON "T1"."custid" = "T2"."custid" JOIN "savings" AS "T3" ON "T1"."custid" = "T3"."custid" AND "T2"."balance" > "T3"."balance" | 0.186523 |
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 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 d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE 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 diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what was the name of the procedure that's been performed to patient 78076 two or more times until 22 months ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78076) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-22 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 >= 2) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 78076 GROUP BY "hadm_id"), "t1" AS (SELECT "procedures_icd"."icd9_code", COUNT("procedures_icd"."charttime") AS "c1" FROM "procedures_icd" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime") <= DATETIME(CURRENT_TIME(), '-22 month') AND NOT "_u_0"."" IS NULL GROUP BY "procedures_icd"."icd9_code"), "_u_1" AS (SELECT "t1"."icd9_code" FROM "t1" AS "t1" WHERE "t1"."c1" >= 2 GROUP BY "icd9_code") SELECT "d_icd_procedures"."short_title" FROM "d_icd_procedures" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_icd_procedures"."icd9_code" WHERE NOT "_u_1"."" IS NULL | 0.701172 |
CREATE TABLE torrents (groupname TEXT, totalsnatched DECIMAL, artist TEXT, groupyear DECIMAL, releasetype TEXT, groupid DECIMAL, id DECIMAL)
CREATE TABLE tags (index DECIMAL, id DECIMAL, tag TEXT)
| what release types are captured in this data set? | SELECT DISTINCT releasetype FROM torrents | SELECT DISTINCT "releasetype" FROM "torrents" | 0.043945 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE 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)
| tell me the number of white ethnic background patients who had removal of t-tube, other bile duct tube, or liver tube. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Remov biliary/liver tube" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Remov biliary/liver tube" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "WHITE" = "demographic"."ethnicity" | 0.234375 |
CREATE TABLE table_171250_2 (census_ranking VARCHAR, area_km_2 VARCHAR)
| What are the census ranking(s) that have an area of 369.25 km2? | SELECT census_ranking FROM table_171250_2 WHERE area_km_2 = "369.25" | SELECT "census_ranking" FROM "table_171250_2" WHERE "369.25" = "area_km_2" | 0.072266 |
CREATE TABLE Invoice_Line_Items (order_item_id INT, invoice_number INT, product_id INT, product_title VARCHAR, product_quantity VARCHAR, product_price DECIMAL, derived_product_cost DECIMAL, derived_vat_payable DECIMAL, derived_total_cost DECIMAL)
CREATE TABLE Products (product_id INT, parent_product_id INT, production_type_code VARCHAR, unit_price DECIMAL, product_name VARCHAR, product_color VARCHAR, product_size VARCHAR)
CREATE TABLE Product_Categories (production_type_code VARCHAR, product_type_description VARCHAR, vat_rating DECIMAL)
CREATE TABLE Orders (order_id INT, customer_id INT, date_order_placed DATETIME, order_details VARCHAR)
CREATE TABLE Customers (customer_id INT, customer_first_name VARCHAR, customer_middle_initial VARCHAR, customer_last_name VARCHAR, gender VARCHAR, email_address VARCHAR, login_name VARCHAR, login_password VARCHAR, phone_number VARCHAR, town_city VARCHAR, state_county_province VARCHAR, country VARCHAR)
CREATE TABLE Accounts (account_id INT, customer_id INT, date_account_opened DATETIME, account_name VARCHAR, other_account_details VARCHAR)
CREATE TABLE Order_Items (order_item_id INT, order_id INT, product_id INT, product_quantity VARCHAR, other_order_item_details VARCHAR)
CREATE TABLE Financial_Transactions (transaction_id INT, account_id INT, invoice_number INT, transaction_type VARCHAR, transaction_date DATETIME, transaction_amount DECIMAL, transaction_comment VARCHAR, other_transaction_details VARCHAR)
CREATE TABLE Invoices (invoice_number INT, order_id INT, invoice_date DATETIME)
| How many accounts for each customer? Show a bar chart that groups by customer's last name, I want to rank from high to low by the total number. | SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC | SELECT "customer_last_name", COUNT(*) FROM "Accounts" AS "T1" JOIN "Customers" AS "T2" ON "T1"."customer_id" = "T2"."customer_id" GROUP BY "T1"."customer_id" ORDER BY COUNT(*) DESC NULLS LAST | 0.186523 |
CREATE TABLE table_203_663 (id DECIMAL, "country" TEXT, "zone" TEXT, "national federation" TEXT, "#gm" DECIMAL, "#fide" DECIMAL, "national championship" TEXT)
| what is the total number of countries on the chart ? | SELECT COUNT("country") FROM table_203_663 | SELECT COUNT("country") FROM "table_203_663" | 0.042969 |
CREATE TABLE table_37549 ("Date" TEXT, "City" TEXT, "Opponent" TEXT, "Results\\u00b9" TEXT, "Type of game" TEXT)
| What city did Yugoslavia play against Poland in? | SELECT "City" FROM table_37549 WHERE "Opponent" = 'poland' | SELECT "City" FROM "table_37549" WHERE "Opponent" = 'poland' | 0.058594 |
CREATE TABLE table_29071 ("Date" TEXT, "Time" TEXT, "Visiting team" TEXT, "Home team" TEXT, "Site" TEXT, "Broadcast" TEXT, "Result" TEXT, "Attendance" FLOAT)
| How many times was the site wallace wade stadium durham, nc? | SELECT COUNT("Attendance") FROM table_29071 WHERE "Site" = 'Wallace Wade Stadium • Durham, NC' | SELECT COUNT("Attendance") FROM "table_29071" WHERE "Site" = 'Wallace Wade Stadium • Durham, NC' | 0.09375 |
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
| For all employees who have the letters D or S in their first name, find hire_date and the sum of employee_id bin hire_date by weekday, and visualize them by a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | SELECT "HIRE_DATE", SUM("EMPLOYEE_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' | 0.109375 |
CREATE TABLE table_name_60 (grid INT, time VARCHAR)
| What is the sum of Grid, when Time is '+16.687'? | SELECT SUM(grid) FROM table_name_60 WHERE time = "+16.687" | SELECT SUM("grid") FROM "table_name_60" WHERE "+16.687" = "time" | 0.0625 |
CREATE TABLE table_63958 ("Name" TEXT, "Nationality" TEXT, "Races won" FLOAT, "Races ridden" FLOAT, "Win average" FLOAT)
| How many races did the German racer that won less than 10 races ride? | SELECT COUNT("Races ridden") FROM table_63958 WHERE "Nationality" = 'german' AND "Races won" < '10' | SELECT COUNT("Races ridden") FROM "table_63958" WHERE "Nationality" = 'german' AND "Races won" < '10' | 0.098633 |
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewTaskResultTypes (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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
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 CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE 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 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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
| Posts with 'post deleted' in history. | SELECT p.Id AS "post_link", h.CreationDate FROM Posts AS p JOIN PostHistory AS h ON h.PostId = p.Id JOIN PostHistoryTypes AS pht ON pht.Id = h.PostHistoryTypeId WHERE pht.Name LIKE '%delet%' | SELECT "p"."Id" AS "post_link", "h"."CreationDate" FROM "Posts" AS "p" JOIN "PostHistory" AS "h" ON "h"."PostId" = "p"."Id" JOIN "PostHistoryTypes" AS "pht" ON "h"."PostHistoryTypeId" = "pht"."Id" AND "pht"."Name" LIKE '%delet%' | 0.222656 |
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE 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 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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod 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)
| count the number of patients who have had a .25 ns+0.5:1 heparin intake since 4 years ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.25 ns+0.5:1 heparin' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-4 year'))) | WITH "_u_0" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = '.25 ns+0.5:1 heparin' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid"), "_u_1" AS (SELECT "inputevents_cv"."icustay_id" FROM "inputevents_cv" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "inputevents_cv"."itemid" WHERE DATETIME("inputevents_cv"."charttime") >= DATETIME(CURRENT_TIME(), '-4 year') AND NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "icustays"."hadm_id" FROM "icustays" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "icustays"."icustay_id" WHERE NOT "_u_1"."" IS NULL GROUP BY "hadm_id") SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "admissions"."hadm_id" WHERE NOT "_u_2"."" IS NULL | 0.750977 |
CREATE TABLE table_name_42 (uci_points INT, cyclist VARCHAR)
| What is the sum of UCI points for Kim Kirchen? | SELECT SUM(uci_points) FROM table_name_42 WHERE cyclist = "kim kirchen" | SELECT SUM("uci_points") FROM "table_name_42" WHERE "cyclist" = "kim kirchen" | 0.075195 |
CREATE TABLE table_10831 ("Team" TEXT, "Season" TEXT, "Regular Season" FLOAT, "Tournament" FLOAT, "Total" FLOAT)
| How many tournament titles for iowa state with 3 total titles? | SELECT MAX("Tournament") FROM table_10831 WHERE "Total" = '3' AND "Team" = 'iowa state' | SELECT MAX("Tournament") FROM "table_10831" WHERE "Team" = 'iowa state' AND "Total" = '3' | 0.086914 |
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
| the list of the patient ids of patients diagnosed with hx-uterus malignancy nec since 2104. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-uterus malignancy nec') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2104') | WITH "_u_1" AS (SELECT "diagnoses_icd"."hadm_id" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'hx-uterus malignancy nec' WHERE STRFTIME('%y', "diagnoses_icd"."charttime") >= '2104' GROUP BY "hadm_id") SELECT "admissions"."subject_id" FROM "admissions" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "admissions"."hadm_id" WHERE NOT "_u_1"."" IS NULL | 0.433594 |
CREATE TABLE table_76689 ("Date" TEXT, "Time" TEXT, "Opponent" TEXT, "Score" TEXT, "Site" TEXT, "City" TEXT)
| Who is the Opponent when the Score is 2-8? | SELECT "Opponent" FROM table_76689 WHERE "Score" = '2-8' | SELECT "Opponent" FROM "table_76689" WHERE "Score" = '2-8' | 0.056641 |
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE 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 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| what was the total replete w/fiber amount that patient 15447 had received on the current intensive care unit visit? | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'replete w/fiber' AND d_items.linksto = 'inputevents_cv') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 15447 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 "icustays"."outtime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'replete w/fiber' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid") SELECT SUM("inputevents_cv"."amount") FROM "inputevents_cv" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "inputevents_cv"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL | 0.724609 |
CREATE TABLE table_name_82 (grid INT, time VARCHAR, laps VARCHAR)
| which grid did less than 20 laps in a time of +58.353? | SELECT MIN(grid) FROM table_name_82 WHERE time = "+58.353" AND laps < 20 | SELECT MIN("grid") FROM "table_name_82" WHERE "+58.353" = "time" AND "laps" < 20 | 0.078125 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| count the number of patients whose ethnicity is black/african american and year of birth is less than 2076? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2076" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2076" > "demographic"."dob_year" AND "BLACK/AFRICAN AMERICAN" = "demographic"."ethnicity" | 0.161133 |
CREATE TABLE table_203_240 (id DECIMAL, "#" DECIMAL, "date" TEXT, "opponent" TEXT, "score" TEXT, "win" TEXT, "loss" TEXT, "save" TEXT, "attendance" DECIMAL, "record" TEXT)
| how many games during this period did the phillies not win ? | SELECT COUNT(*) FROM table_203_240 WHERE "score" < "score" | SELECT COUNT(*) FROM "table_203_240" WHERE "score" < "score" | 0.058594 |
CREATE TABLE table_71649 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| Name the country with +2 to par | SELECT "Country" FROM table_71649 WHERE "To par" = '+2' | SELECT "Country" FROM "table_71649" WHERE "To par" = '+2' | 0.055664 |
CREATE TABLE club (Club_ID INT, Club_name TEXT, Region TEXT, Start_year INT)
CREATE TABLE match_result (Rank INT, Club_ID INT, Gold INT, Big_Silver INT, Small_Silver INT, Bronze INT, Points INT)
CREATE TABLE player (Player_ID INT, Sponsor_name TEXT, Player_name TEXT, Gender TEXT, Residence TEXT, Occupation TEXT, Votes INT, Rank TEXT)
CREATE TABLE player_coach (Player_ID INT, Coach_ID INT, Starting_year INT)
CREATE TABLE coach (Coach_ID INT, Coach_name TEXT, Gender TEXT, Club_ID INT, Rank INT)
| Compare the number of players of different occupations using a bar chart, order in ascending by the Y-axis. | SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation ORDER BY COUNT(Occupation) | SELECT "Occupation", COUNT("Occupation") FROM "player" GROUP BY "Occupation" ORDER BY COUNT("Occupation") NULLS FIRST | 0.114258 |
CREATE TABLE table_name_90 (year_s__withdrawn VARCHAR, year_made VARCHAR)
| What year was the locomotive withdrawn that was made in 1876? | SELECT year_s__withdrawn FROM table_name_90 WHERE year_made = "1876" | SELECT "year_s__withdrawn" FROM "table_name_90" WHERE "1876" = "year_made" | 0.072266 |
CREATE TABLE table_27756314_10 (team VARCHAR, high_points VARCHAR)
| What is the team when the high points were by wesley johnson (20)? | SELECT team FROM table_27756314_10 WHERE high_points = "Wesley Johnson (20)" | SELECT "team" FROM "table_27756314_10" WHERE "Wesley Johnson (20)" = "high_points" | 0.080078 |
CREATE TABLE table_2843 ("Game" FLOAT, "Date" TEXT, "Team" TEXT, "Score" TEXT, "High points" TEXT, "High rebounds" TEXT, "High assists" TEXT, "Location Attendance" TEXT, "Record" TEXT)
| What was the score with the team record was 15-25? | SELECT "Score" FROM table_2843 WHERE "Record" = '15-25' | SELECT "Score" FROM "table_2843" WHERE "Record" = '15-25' | 0.055664 |
CREATE TABLE table_17859 ("Club" TEXT, "Played" TEXT, "Won" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Tries against" TEXT, "Try bonus" TEXT, "Losing bonus" TEXT, "Points" TEXT)
| How many clubs have tries for count of 50? | SELECT COUNT("Played") FROM table_17859 WHERE "Tries for" = '50' | SELECT COUNT("Played") FROM "table_17859" WHERE "Tries for" = '50' | 0.064453 |
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
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 vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
| was there any pyelogram - retrograde on patient 025-60396? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-60396')) AND treatment.treatmentname = 'pyelogram - retrograde' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '025-60396' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "treatment" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'pyelogram - retrograde' AND NOT "_u_1"."" IS NULL | 0.541992 |
CREATE TABLE table_70680 ("Application" TEXT, "Expected Speed Up\\u2020" TEXT, "GPU\\u2021" TEXT, "Multi-GPU Support" TEXT, "Release Status" TEXT)
| Which GPU has the cushaw application? | SELECT "GPU\u2021" FROM table_70680 WHERE "Application" = 'cushaw' | SELECT "GPU\u2021" FROM "table_70680" WHERE "Application" = 'cushaw' | 0.066406 |
CREATE TABLE table_66013 ("School" TEXT, "Location" TEXT, "Mascot" TEXT, "County" TEXT, "Year Joined" TEXT, "Year Left" TEXT)
| Which year did the school with the mascot of the Vikings join? | SELECT "Year Joined" FROM table_66013 WHERE "Mascot" = 'vikings' | SELECT "Year Joined" FROM "table_66013" WHERE "Mascot" = 'vikings' | 0.064453 |
CREATE TABLE table_68462 ("Series 1" TEXT, "Series 2" TEXT, "Series 3" TEXT, "Series 5" TEXT, "Series 9" TEXT, "Series 11" TEXT)
| Who in series 5 corresponds to Deborah Meaden in series 3? | SELECT "Series 5" FROM table_68462 WHERE "Series 3" = 'deborah meaden' | SELECT "Series 5" FROM "table_68462" WHERE "Series 3" = 'deborah meaden' | 0.070313 |
CREATE TABLE table_16644 ("Edition" FLOAT, "Zone" TEXT, "Round" TEXT, "Date" TEXT, "Against" TEXT, "Surface" TEXT, "Opponent" TEXT, "Outcome" TEXT, "Result" TEXT)
| Who did Tina Pisnik verse? | SELECT "Against" FROM table_16644 WHERE "Opponent" = 'Tina Pisnik' | SELECT "Against" FROM "table_16644" WHERE "Opponent" = 'Tina Pisnik' | 0.066406 |
CREATE TABLE table_25816476_2 (team_coxy VARCHAR, air_date VARCHAR, team_guest_captain VARCHAR)
| How many entries are there for team coxy for the air date of 24 january 2010 and team guest captain of gail porter? | SELECT COUNT(team_coxy) FROM table_25816476_2 WHERE air_date = "24 January 2010" AND team_guest_captain = "Gail Porter" | SELECT COUNT("team_coxy") FROM "table_25816476_2" WHERE "24 January 2010" = "air_date" AND "Gail Porter" = "team_guest_captain" | 0.124023 |
CREATE TABLE table_37913 ("Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Loss" TEXT, "Attendance" FLOAT, "Record" TEXT)
| Loss of francis (4 10) happened on what date? | SELECT "Date" FROM table_37913 WHERE "Loss" = 'francis (4–10)' | SELECT "Date" FROM "table_37913" WHERE "Loss" = 'francis (4–10)' | 0.0625 |
CREATE TABLE table_name_51 (byes INT, against VARCHAR, wins VARCHAR)
| How many byes were there with an Against of 1655 and more than 10 wins? | SELECT MIN(byes) FROM table_name_51 WHERE against = 1655 AND wins > 10 | SELECT MIN("byes") FROM "table_name_51" WHERE "against" = 1655 AND "wins" > 10 | 0.076172 |
CREATE TABLE table_name_51 (position INT, goals_for VARCHAR, goals_against VARCHAR)
| Which Position has Goals For of 52, and Goals Against larger than 70? | SELECT MAX(position) FROM table_name_51 WHERE goals_for = 52 AND goals_against > 70 | SELECT MAX("position") FROM "table_name_51" WHERE "goals_against" > 70 AND "goals_for" = 52 | 0.088867 |
CREATE TABLE table_25030512_12 (party VARCHAR, incumbent VARCHAR)
| When bill young redistricted from the 10th district is the incumbent what is the party? | SELECT party FROM table_25030512_12 WHERE incumbent = "Bill Young Redistricted from the 10th district" | SELECT "party" FROM "table_25030512_12" WHERE "Bill Young Redistricted from the 10th district" = "incumbent" | 0.105469 |
CREATE TABLE table_53720 ("Date" TEXT, "Visitor" TEXT, "Score" TEXT, "Home" TEXT, "Decision" TEXT, "Attendance" FLOAT, "Record" TEXT)
| Who is the visiting team when Dipietro received a decision on October 27? | SELECT "Visitor" FROM table_53720 WHERE "Decision" = 'dipietro' AND "Date" = 'october 27' | SELECT "Visitor" FROM "table_53720" WHERE "Date" = 'october 27' AND "Decision" = 'dipietro' | 0.088867 |
CREATE TABLE table_34661 ("Driver" TEXT, "Constructor" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
| What are the highest laps Kazuki Nakajima did with a Grid larger than 19? | SELECT MAX("Laps") FROM table_34661 WHERE "Driver" = 'kazuki nakajima' AND "Grid" > '19' | SELECT MAX("Laps") FROM "table_34661" WHERE "Driver" = 'kazuki nakajima' AND "Grid" > '19' | 0.087891 |
CREATE TABLE table_name_52 (icao VARCHAR, airport VARCHAR)
| What is the ICAO for the Yangon International Airport? | SELECT icao FROM table_name_52 WHERE airport = "yangon international airport" | SELECT "icao" FROM "table_name_52" WHERE "airport" = "yangon international airport" | 0.081055 |
CREATE TABLE table_name_4 (member_senator VARCHAR, first_elected VARCHAR, district VARCHAR)
| Who was firest elected in 2002 in a district larger than 41? | SELECT member_senator FROM table_name_4 WHERE first_elected = 2002 AND district > 41 | SELECT "member_senator" FROM "table_name_4" WHERE "district" > 41 AND "first_elected" = 2002 | 0.089844 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| what number of patients admitted before the year 2200had lab test item id 51222? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2200" AND lab.itemid = "51222" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "51222" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2200" > "demographic"."admityear" | 0.189453 |
CREATE TABLE table_77997 ("Round" TEXT, "Date" TEXT, "Opponent" TEXT, "Venue" TEXT, "Result" TEXT)
| What is the Round with a Opponent with blackburn? | SELECT "Round" FROM table_77997 WHERE "Opponent" = 'blackburn' | SELECT "Round" FROM "table_77997" WHERE "Opponent" = 'blackburn' | 0.0625 |
CREATE TABLE Shops (Shop_ID INT, Shop_Details VARCHAR)
CREATE TABLE Photos (Photo_ID INT, Tourist_Attraction_ID INT, Name VARCHAR, Description VARCHAR, Filename VARCHAR, Other_Details VARCHAR)
CREATE TABLE Museums (Museum_ID INT, Museum_Details VARCHAR)
CREATE TABLE Tourist_Attraction_Features (Tourist_Attraction_ID INT, Feature_ID INT)
CREATE TABLE Street_Markets (Market_ID INT, Market_Details VARCHAR)
CREATE TABLE Locations (Location_ID INT, Location_Name VARCHAR, Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Royal_Family (Royal_Family_ID INT, Royal_Family_Details VARCHAR)
CREATE TABLE Features (Feature_ID INT, Feature_Details VARCHAR)
CREATE TABLE Ref_Hotel_Star_Ratings (star_rating_code CHAR, star_rating_description VARCHAR)
CREATE TABLE Hotels (hotel_id INT, star_rating_code CHAR, pets_allowed_yn CHAR, price_range FLOAT, other_hotel_details VARCHAR)
CREATE TABLE Visitors (Tourist_ID INT, Tourist_Details VARCHAR)
CREATE TABLE Visits (Visit_ID INT, Tourist_Attraction_ID INT, Tourist_ID INT, Visit_Date DATETIME, Visit_Details VARCHAR)
CREATE TABLE Ref_Attraction_Types (Attraction_Type_Code CHAR, Attraction_Type_Description VARCHAR)
CREATE TABLE Tourist_Attractions (Tourist_Attraction_ID INT, Attraction_Type_Code CHAR, Location_ID INT, How_to_Get_There VARCHAR, Name VARCHAR, Description VARCHAR, Opening_Hours VARCHAR, Other_Details VARCHAR)
CREATE TABLE Theme_Parks (Theme_Park_ID INT, Theme_Park_Details VARCHAR)
CREATE TABLE Staff (Staff_ID INT, Tourist_Attraction_ID INT, Name VARCHAR, Other_Details VARCHAR)
| Show the names and ids of tourist attractions that are visited at most once by a bar chart, and I want to show from low to high by the X-axis. | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name | SELECT "T1"."Name", "T1"."Tourist_Attraction_ID" FROM "Tourist_Attractions" AS "T1" JOIN "Visits" AS "T2" ON "T1"."Tourist_Attraction_ID" = "T2"."Tourist_Attraction_ID" ORDER BY "T1"."Name" NULLS FIRST | 0.196289 |
CREATE TABLE table_name_5 (game VARCHAR, date VARCHAR)
| Which game of the season was played on April 22? | SELECT game FROM table_name_5 WHERE date = "april 22" | SELECT "game" FROM "table_name_5" WHERE "april 22" = "date" | 0.057617 |
CREATE TABLE table_57425 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| How many people were in the crowd when the Home Team was Hawthorn? | SELECT SUM("Crowd") FROM table_57425 WHERE "Home team" = 'hawthorn' | SELECT SUM("Crowd") FROM "table_57425" WHERE "Home team" = 'hawthorn' | 0.067383 |
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE 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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text 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)
| Could you tell me what classes Dr. Ashley Bisutti has taught before ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = course_offering.course_id AND instructor.name LIKE '%Ashley Bisutti%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" AS "SEMESTERalias0" ON "SEMESTERalias0"."semester" = 'WN' AND "SEMESTERalias0"."semester_id" > "course_offering"."semester" AND "SEMESTERalias0"."year" = 2016 JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Ashley Bisutti%' | 0.56543 |
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
| For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the average of price , and group by attribute founder, list in ascending by the total number. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price) | SELECT "Founder", AVG("Price") FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder" ORDER BY AVG("Price") NULLS FIRST | 0.168945 |
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
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 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)
| on their current hospital encounter, how many times had patient 009-5001 received a pulmonary/ccm consultation? | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'pulmonary/ccm consultation' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '009-5001' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) FROM "treatment" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'pulmonary/ccm consultation' AND NOT "_u_1"."" IS NULL | 0.585938 |
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE 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 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 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_icd_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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE 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 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)
| what was the first time that patient 1902 had a maximum arterial bp mean today? | SELECT chartevents.charttime 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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') ORDER BY chartevents.valuenum DESC, chartevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 1902 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" = 'arterial bp mean' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT "chartevents"."charttime" 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", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL ORDER BY "chartevents"."valuenum" DESC NULLS LAST, "chartevents"."charttime" NULLS FIRST LIMIT 1 | 0.876953 |
CREATE TABLE table_24890 ("English short name ( upper/lower case ) " TEXT, "Alpha-2 code" TEXT, "Alpha-3 code" TEXT, "Numeric code" FLOAT, "ISO 3166-2 codes" TEXT)
| What is the alpha 2 code for the area also known as NZL? | SELECT "Alpha-2 code" FROM table_24890 WHERE "Alpha-3 code" = 'NZL' | SELECT "Alpha-2 code" FROM "table_24890" WHERE "Alpha-3 code" = 'NZL' | 0.067383 |
CREATE TABLE table_45941 ("Rank" TEXT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| What is the sum of Silver, when Total is less than 1? | SELECT SUM("Silver") FROM table_45941 WHERE "Total" < '1' | SELECT SUM("Silver") FROM "table_45941" WHERE "Total" < '1' | 0.057617 |
CREATE TABLE table_name_74 (rank VARCHAR, total VARCHAR, nation VARCHAR)
| What is the rank for the Mixed Team nation with a total of less than 13? | SELECT rank FROM table_name_74 WHERE total < 13 AND nation = "mixed team" | SELECT "rank" FROM "table_name_74" WHERE "mixed team" = "nation" AND "total" < 13 | 0.079102 |
CREATE TABLE table_61036 ("Season" TEXT, "Class" TEXT, "Bike" TEXT, "Team" TEXT, "Race" FLOAT, "Pole" FLOAT, "FLap" FLOAT)
| What is the highest FLap by a Honda NSR500 bike after Race 16? | SELECT MAX("FLap") FROM table_61036 WHERE "Bike" = 'honda nsr500' AND "Race" > '16' | SELECT MAX("FLap") FROM "table_61036" WHERE "Bike" = 'honda nsr500' AND "Race" > '16' | 0.083008 |
CREATE TABLE table_18536769_1 (frequency VARCHAR, owner VARCHAR)
| When vista radio is the owner what is the frequency? | SELECT frequency FROM table_18536769_1 WHERE owner = "Vista Radio" | SELECT "frequency" FROM "table_18536769_1" WHERE "Vista Radio" = "owner" | 0.070313 |
CREATE TABLE Apartments (apt_id INT, building_id INT, apt_type_code CHAR, apt_number CHAR, bathroom_count INT, bedroom_count INT, room_count CHAR)
CREATE TABLE Apartment_Buildings (building_id INT, building_short_name CHAR, building_full_name VARCHAR, building_description VARCHAR, building_address VARCHAR, building_manager VARCHAR, building_phone VARCHAR)
CREATE TABLE View_Unit_Status (apt_id INT, apt_booking_id INT, status_date DATETIME, available_yn BIT)
CREATE TABLE Apartment_Bookings (apt_booking_id INT, apt_id INT, guest_id INT, booking_status_code CHAR, booking_start_date DATETIME, booking_end_date DATETIME)
CREATE TABLE Apartment_Facilities (apt_id INT, facility_code CHAR)
CREATE TABLE Guests (guest_id INT, gender_code CHAR, guest_first_name VARCHAR, guest_last_name VARCHAR, date_of_birth DATETIME)
| A bar chart for what are the number of the facility codes of the apartments with more than four bedrooms?, and show by the x-axis in descending. | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY facility_code DESC | SELECT "facility_code", COUNT("facility_code") FROM "Apartment_Facilities" AS "T1" JOIN "Apartments" AS "T2" ON "T1"."apt_id" = "T2"."apt_id" AND "T2"."bedroom_count" > 4 GROUP BY "facility_code" ORDER BY "facility_code" DESC NULLS LAST | 0.230469 |
CREATE TABLE Products (product_id INT, product_type_code VARCHAR, product_name VARCHAR, product_price DECIMAL)
CREATE TABLE Department_Stores (dept_store_id INT, dept_store_chain_id INT, store_name VARCHAR, store_address VARCHAR, store_phone VARCHAR, store_email VARCHAR)
CREATE TABLE Staff (staff_id INT, staff_gender VARCHAR, staff_name VARCHAR)
CREATE TABLE Addresses (address_id INT, address_details VARCHAR)
CREATE TABLE Department_Store_Chain (dept_store_chain_id INT, dept_store_chain_name VARCHAR)
CREATE TABLE Suppliers (supplier_id INT, supplier_name VARCHAR, supplier_phone VARCHAR)
CREATE TABLE Supplier_Addresses (supplier_id INT, address_id INT, date_from DATETIME, date_to DATETIME)
CREATE TABLE Departments (department_id INT, dept_store_id INT, department_name VARCHAR)
CREATE TABLE Customer_Addresses (customer_id INT, address_id INT, date_from DATETIME, date_to DATETIME)
CREATE TABLE Product_Suppliers (product_id INT, supplier_id INT, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR, total_value_purchased DECIMAL)
CREATE TABLE Order_Items (order_item_id INT, order_id INT, product_id INT)
CREATE TABLE Customer_Orders (order_id INT, customer_id INT, order_status_code VARCHAR, order_date DATETIME)
CREATE TABLE Staff_Department_Assignments (staff_id INT, department_id INT, date_assigned_from DATETIME, job_title_code VARCHAR, date_assigned_to DATETIME)
CREATE TABLE Customers (customer_id INT, payment_method_code VARCHAR, customer_code VARCHAR, customer_name VARCHAR, customer_address VARCHAR, customer_phone VARCHAR, customer_email VARCHAR)
| What is the highest price of product, grouped by product type? Show a bar chart, I want to display by the Y-axis in descending. | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price) DESC | SELECT "product_type_code", MAX("product_price") FROM "Products" GROUP BY "product_type_code" ORDER BY MAX("product_price") DESC NULLS LAST | 0.135742 |
CREATE TABLE Accounts (account_id INT, customer_id INT, account_name VARCHAR, other_account_details VARCHAR)
CREATE TABLE Financial_Transactions (transaction_id INT, previous_transaction_id INT, account_id INT, card_id INT, transaction_type VARCHAR, transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR, other_transaction_details VARCHAR)
CREATE TABLE Customers_Cards (card_id INT, customer_id INT, card_type_code VARCHAR, card_number VARCHAR, date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR)
CREATE TABLE Customers (customer_id INT, customer_first_name VARCHAR, customer_last_name VARCHAR, customer_address VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, other_customer_details VARCHAR)
| Show the card type codes and the number of transactions with a bar chart, could you order Y in ascending order? | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*) | SELECT "card_type_code", COUNT(*) FROM "Financial_Transactions" AS "T1" JOIN "Customers_Cards" AS "T2" ON "T1"."card_id" = "T2"."card_id" GROUP BY "T2"."card_type_code" ORDER BY COUNT(*) NULLS FIRST | 0.193359 |
CREATE TABLE table_name_52 (money___$__ VARCHAR, player VARCHAR)
| What's the money that Sam Snead won? | SELECT money___$__ FROM table_name_52 WHERE player = "sam snead" | SELECT "money___$__" FROM "table_name_52" WHERE "player" = "sam snead" | 0.068359 |
CREATE TABLE table_11236195_2 (losingteam VARCHAR, score VARCHAR)
| Which losing team had a score of 24-12? | SELECT losingteam FROM table_11236195_2 WHERE score = "24-12" | SELECT "losingteam" FROM "table_11236195_2" WHERE "24-12" = "score" | 0.06543 |
CREATE TABLE table_34520 ("Year" FLOAT, "Performance" TEXT, "World Ranking" FLOAT, "Venue" TEXT, "Date" TEXT)
| The venue of Rome has which date? | SELECT "Date" FROM table_34520 WHERE "Venue" = 'rome' | SELECT "Date" FROM "table_34520" WHERE "Venue" = 'rome' | 0.053711 |
CREATE TABLE farm (farm_id DECIMAL, year DECIMAL, total_horses DECIMAL, working_horses DECIMAL, total_cattle DECIMAL, oxen DECIMAL, bulls DECIMAL, cows DECIMAL, pigs DECIMAL, sheep_and_goats DECIMAL)
CREATE TABLE farm_competition (competition_id DECIMAL, year DECIMAL, theme TEXT, host_city_id DECIMAL, hosts TEXT)
CREATE TABLE competition_record (competition_id DECIMAL, farm_id DECIMAL, rank DECIMAL)
CREATE TABLE city (city_id DECIMAL, official_name TEXT, status TEXT, area_km_2 DECIMAL, population DECIMAL, census_ranking TEXT)
| What are the census rankings of cities that do not have the status 'Village'? | SELECT census_ranking FROM city WHERE status <> "Village" | SELECT "census_ranking" FROM "city" WHERE "Village" <> "status" | 0.061523 |
CREATE TABLE Students_in_Detention (student_id INT, detention_id INT, incident_id INT)
CREATE TABLE Ref_Incident_Type (incident_type_code VARCHAR, incident_type_description VARCHAR)
CREATE TABLE Ref_Address_Types (address_type_code VARCHAR, address_type_description VARCHAR)
CREATE TABLE Assessment_Notes (notes_id INT, student_id INT, teacher_id INT, date_of_notes DATETIME, text_of_notes VARCHAR, other_details VARCHAR)
CREATE TABLE Behavior_Incident (incident_id INT, incident_type_code VARCHAR, student_id INT, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR, recommendations VARCHAR, other_details VARCHAR)
CREATE TABLE Detention (detention_id INT, detention_type_code VARCHAR, teacher_id INT, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR, other_details VARCHAR)
CREATE TABLE Students (student_id INT, address_id INT, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, cell_mobile_number VARCHAR, email_address VARCHAR, date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR)
CREATE TABLE Addresses (address_id INT, line_1 VARCHAR, line_2 VARCHAR, line_3 VARCHAR, city VARCHAR, zip_postcode VARCHAR, state_province_county VARCHAR, country VARCHAR, other_address_details VARCHAR)
CREATE TABLE Student_Addresses (student_id INT, address_id INT, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL, other_details VARCHAR)
CREATE TABLE Teachers (teacher_id INT, address_id INT, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, gender VARCHAR, cell_mobile_number VARCHAR, email_address VARCHAR, other_details VARCHAR)
CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR, detention_type_description VARCHAR)
| Give me the comparison about the amount of date_address_to over the date_address_to , and group by attribute other_details and bin date_address_to by time by a bar chart. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | SELECT "date_address_to", COUNT("date_address_to") FROM "Student_Addresses" GROUP BY "other_details" ORDER BY "monthly_rental" DESC NULLS LAST | 0.138672 |
CREATE TABLE table_name_71 (race_1 VARCHAR, team VARCHAR, race_3 VARCHAR)
| What is Race 1, when Team is 'Dick Johnson Racing', and when Race 3 is 'DNF'? | SELECT race_1 FROM table_name_71 WHERE team = "dick johnson racing" AND race_3 = "dnf" | SELECT "race_1" FROM "table_name_71" WHERE "dick johnson racing" = "team" AND "dnf" = "race_3" | 0.091797 |
CREATE TABLE table_24566 ("Country" TEXT, "% of imports from Russia" TEXT, "% cut" TEXT, "Diversification" TEXT, "Gas storage" TEXT, "Alternative fuel" TEXT)
| What was the percent cunt for the nation that had fuel oil stocks need only for industry as their fuel alternative? | SELECT "% cut" FROM table_24566 WHERE "Alternative fuel" = 'Fuel oil stocks need only for industry' | SELECT "% cut" FROM "table_24566" WHERE "Alternative fuel" = 'Fuel oil stocks need only for industry' | 0.098633 |
CREATE TABLE table_61342 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
| What is the Total of the Player with a To par of 13? | SELECT SUM("Total") FROM table_61342 WHERE "To par" = '–13' | SELECT SUM("Total") FROM "table_61342" WHERE "To par" = '–13' | 0.05957 |
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE 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 comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
| Is it possible to see the difficulty for all the CS-LSA courses ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number", "program_course"."workload" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" JOIN "program" ON "program"."name" LIKE 'CS-LSA' AND "program"."program_id" = "program_course"."program_id" | 0.293945 |
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
| Display a bar chart for what is the average salary for each job title?, and rank in descending by the X please. | SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY JOB_TITLE DESC | SELECT "JOB_TITLE", AVG("SALARY") FROM "employees" AS "T1" JOIN "jobs" AS "T2" ON "T1"."JOB_ID" = "T2"."JOB_ID" GROUP BY "T2"."JOB_TITLE" ORDER BY "JOB_TITLE" DESC NULLS LAST | 0.169922 |
CREATE TABLE table_23281862_6 (location_attendance VARCHAR, high_points VARCHAR)
| Where was the game in which Carl Landry (25) did the most high points played? | SELECT location_attendance FROM table_23281862_6 WHERE high_points = "Carl Landry (25)" | SELECT "location_attendance" FROM "table_23281862_6" WHERE "Carl Landry (25)" = "high_points" | 0.09082 |
CREATE TABLE table_53944 ("Driver" TEXT, "Constructor" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
| Which driver has a Time/Retired of 2:45:46.2? | SELECT "Driver" FROM table_53944 WHERE "Time/Retired" = '2:45:46.2' | SELECT "Driver" FROM "table_53944" WHERE "Time/Retired" = '2:45:46.2' | 0.067383 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| Give me the number of patients with coronary artery disease or coronary artery bypass graft with mvi maze as their primary disease who have a pr route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND prescriptions.route = "PR" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "PR" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" = "demographic"."diagnosis" | 0.27832 |
CREATE TABLE stock (shop_id DECIMAL, device_id DECIMAL, quantity DECIMAL)
CREATE TABLE device (device_id DECIMAL, device TEXT, carrier TEXT, package_version TEXT, applications TEXT, software_platform TEXT)
CREATE TABLE shop (shop_id DECIMAL, shop_name TEXT, location TEXT, open_date TEXT, open_year DECIMAL)
| Show names of shops that have more than one kind of device in stock. | SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id HAVING COUNT(*) > 1 | SELECT "T2"."shop_name" FROM "stock" AS "T1" JOIN "shop" AS "T2" ON "T1"."shop_id" = "T2"."shop_id" GROUP BY "T1"."shop_id" HAVING COUNT(*) > 1 | 0.139648 |
CREATE TABLE table_name_84 (tonnage___grt__ INT, date VARCHAR, ship_name VARCHAR)
| Which tonnage has a Date of 26 september 1940, and a Ship Name of ashantian? | SELECT MIN(tonnage___grt__) FROM table_name_84 WHERE date = "26 september 1940" AND ship_name = "ashantian" | SELECT MIN("tonnage___grt__") FROM "table_name_84" WHERE "26 september 1940" = "date" AND "ashantian" = "ship_name" | 0.112305 |
CREATE TABLE table_17621 ("Number in series" FLOAT, "Broadcast Order" TEXT, "Title" TEXT, "Villain/s" TEXT, "U.S. Air Date" TEXT, "Production Code" TEXT)
| what's the total number of episodes with a US air date of january 15, 2005? | SELECT COUNT("Production Code") FROM table_17621 WHERE "U.S. Air Date" = 'January 15, 2005' | SELECT COUNT("Production Code") FROM "table_17621" WHERE "U.S. Air Date" = 'January 15, 2005' | 0.09082 |
CREATE TABLE table_64441 ("Date ( s ) " TEXT, "Venue" TEXT, "City" TEXT, "Ticket price ( s ) " TEXT, "Ticket sold / available" TEXT, "Ticket grossing" TEXT)
| What is the ticket price at Canadian National Exhibition Stadium? | SELECT "Ticket price(s)" FROM table_64441 WHERE "Venue" = 'canadian national exhibition stadium' | SELECT "Ticket price(s)" FROM "table_64441" WHERE "Venue" = 'canadian national exhibition stadium' | 0.095703 |
CREATE TABLE table_name_74 (number_of_votes VARCHAR, share_of_votes VARCHAR, candidate VARCHAR, election VARCHAR)
| What is the number of the votes of the election before 2004 with edward mahama as the candidate with 3.0% share of votes? | SELECT number_of_votes FROM table_name_74 WHERE candidate = "edward mahama" AND election < 2004 AND share_of_votes = "3.0%" | SELECT "number_of_votes" FROM "table_name_74" WHERE "3.0%" = "share_of_votes" AND "candidate" = "edward mahama" AND "election" < 2004 | 0.129883 |
CREATE TABLE table_name_45 (source VARCHAR, norris VARCHAR)
| What is the Source with a Norris that is 7%? | SELECT source FROM table_name_45 WHERE norris = "7%" | SELECT "source" FROM "table_name_45" WHERE "7%" = "norris" | 0.056641 |
CREATE TABLE table_name_53 (cuts_made VARCHAR, events VARCHAR, top_5 VARCHAR, top_25 VARCHAR)
| Which Cuts made has a Top-5 smaller than 3, and a Top-25 smaller than 6, and an Events of 10? | SELECT cuts_made FROM table_name_53 WHERE top_5 < 3 AND top_25 < 6 AND events = 10 | SELECT "cuts_made" FROM "table_name_53" WHERE "events" = 10 AND "top_25" < 6 AND "top_5" < 3 | 0.089844 |
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction 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 student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE 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 ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
| Are there any courses on UM Chemistry Program at Peking University , Beijing for 17 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%UM Chemistry Program at Peking University , Beijing%' OR name LIKE '%UM Chemistry Program at Peking University , Beijing%') AND credits = 17 | SELECT DISTINCT "department", "name", "number" FROM "course" WHERE "credits" = 17 AND ("description" LIKE '%UM Chemistry Program at Peking University , Beijing%' OR "name" LIKE '%UM Chemistry Program at Peking University , Beijing%') | 0.227539 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
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 discharge location is rehab/distinct part hosp and procedure long title is enteral infusion of concentrated nutritional substances? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.long_title = "Enteral infusion of concentrated nutritional substances" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Enteral infusion of concentrated nutritional substances" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "REHAB/DISTINCT PART HOSP" = "demographic"."discharge_location" | 0.291016 |
CREATE TABLE table_18135 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Results" TEXT, "Candidates" TEXT)
| What year was the first election in the district whose election now was won by Ron Kind? | SELECT MIN("First elected") FROM table_18135 WHERE "Incumbent" = 'Ron Kind' | SELECT MIN("First elected") FROM "table_18135" WHERE "Incumbent" = 'Ron Kind' | 0.075195 |
CREATE TABLE table_204_862 (id DECIMAL, "rank" DECIMAL, "bib" DECIMAL, "athlete" TEXT, "country" TEXT, "run 1" TEXT, "run 2" TEXT, "total" TEXT, "behind" DECIMAL)
| germany had how many consecutive athletes ranked ? | SELECT COUNT("athlete") FROM table_204_862 WHERE "country" = 'germany' | SELECT COUNT("athlete") FROM "table_204_862" WHERE "country" = 'germany' | 0.070313 |
CREATE TABLE table_name_54 (surface VARCHAR, place VARCHAR)
| Which Surface has a Place of lappeenranta? | SELECT surface FROM table_name_54 WHERE place = "lappeenranta" | SELECT "surface" FROM "table_name_54" WHERE "lappeenranta" = "place" | 0.066406 |
CREATE TABLE table_name_4 (grid VARCHAR, driver VARCHAR)
| Tell me the total number of Grid for Rubens Barrichello | SELECT COUNT(grid) FROM table_name_4 WHERE driver = "rubens barrichello" | SELECT COUNT("grid") FROM "table_name_4" WHERE "driver" = "rubens barrichello" | 0.076172 |
CREATE TABLE table_60675 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What is the To par of the Player with a Score of 73-67-68=208? | SELECT "To par" FROM table_60675 WHERE "Score" = '73-67-68=208' | SELECT "To par" FROM "table_60675" WHERE "Score" = '73-67-68=208' | 0.063477 |
CREATE TABLE table_32742 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" TEXT)
| Who was the opponent of the New Orleans Saints? | SELECT "Result" FROM table_32742 WHERE "Opponent" = 'new orleans saints' | SELECT "Result" FROM "table_32742" WHERE "Opponent" = 'new orleans saints' | 0.072266 |
CREATE TABLE table_62116 ("Outcome" TEXT, "Date" TEXT, "Championship" TEXT, "Surface" TEXT, "Opponent in the final" TEXT, "Score in the final" TEXT)
| What type of surface did they play on 21 July 1997 | SELECT "Surface" FROM table_62116 WHERE "Date" = '21 july 1997' | SELECT "Surface" FROM "table_62116" WHERE "Date" = '21 july 1997' | 0.063477 |
CREATE TABLE table_2479 ("Period" TEXT, "Civilians" FLOAT, "Security forces" FLOAT, "Insurgents" FLOAT, "Total per period" FLOAT)
| How many insurgents have 2003 as a period? | SELECT COUNT("Insurgents") FROM table_2479 WHERE "Period" = '2003' | SELECT COUNT("Insurgents") FROM "table_2479" WHERE "Period" = '2003' | 0.066406 |
CREATE TABLE table_24436 ("Team name" TEXT, "Races" FLOAT, "Won" FLOAT, "RR1 Pts." FLOAT, "RR2 Pts." FLOAT, "RR3 Pts." FLOAT, "Total Pts." FLOAT, "Ranking" FLOAT)
| How many points does Swedish America's Cup Challenge have for rr1? | SELECT COUNT("RR1 Pts.") FROM table_24436 WHERE "Team name" = 'Swedish America''s Cup Challenge' | SELECT COUNT("RR1 Pts.") FROM "table_24436" WHERE "Team name" = 'Swedish America\'s Cup Challenge' | 0.095703 |
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 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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| when was the last time patient 005-11182 receive a ddavp injection procedure in the previous year? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182')) AND treatment.treatmentname = 'ddavp injection' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY treatment.treatmenttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '005-11182' 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 "treatment"."treatmenttime" FROM "treatment" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'ddavp injection' AND DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL ORDER BY "treatment"."treatmenttime" DESC NULLS LAST LIMIT 1 | 0.720703 |
CREATE TABLE table_20142629_2 (year VARCHAR, fairburn INT)
| when fairburn is bigger than 54.0, how many years? | SELECT COUNT(year) FROM table_20142629_2 WHERE fairburn > 54.0 | SELECT COUNT("year") FROM "table_20142629_2" WHERE "fairburn" > 54.0 | 0.066406 |
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
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 compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
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 equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
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 days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
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 food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE 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 month (month_number INT, month_name TEXT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
| i would like a flight on CO on 8 20 from WASHINGTON to PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 20 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'CO' | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 20 AND "date_day"."month_number" = 8 AND "date_day"."year" = 1991 JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'WASHINGTON' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND "flight"."airline_code" = 'CO' JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'PITTSBURGH' | 0.745117 |
CREATE TABLE table_35212 ("Pos." FLOAT, "Car #" FLOAT, "Driver" TEXT, "Make" TEXT, "Team" TEXT)
| Who is the team of the Chevrolet, and has a position less than 7, for car # 88? | SELECT "Team" FROM table_35212 WHERE "Make" = 'chevrolet' AND "Pos." < '7' AND "Car #" = '88' | SELECT "Team" FROM "table_35212" WHERE "Car #" = '88' AND "Make" = 'chevrolet' AND "Pos." < '7' | 0.092773 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE 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)
| what is the number of patients whose marital status is single and lab test name is potassium, whole blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Potassium, Whole Blood" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Potassium, Whole Blood" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "SINGLE" = "demographic"."marital_status" | 0.211914 |
CREATE TABLE table_36123 ("Date" TEXT, "Visitor" TEXT, "Score" TEXT, "Home" TEXT, "Record" TEXT)
| Who is the Visitor on april 8? | SELECT "Visitor" FROM table_36123 WHERE "Date" = 'april 8' | SELECT "Visitor" FROM "table_36123" WHERE "Date" = 'april 8' | 0.058594 |
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE 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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE 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 PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
| Undefined Tags with over 50 Posts. | SELECT ('site://tags/' + TagName + '|' + TagName) AS TagName, Count FROM Tags AS T WHERE T.WikiPostId IS NULL AND T.ExcerptPostId IS NULL AND Count > 50 AND Count < 400 ORDER BY T.TagName | SELECT 'site://tags/' + "TagName" + '|' + "TagName" AS "TagName", "Count" FROM "Tags" AS "T" WHERE "Count" < 400 AND "Count" > 50 AND "T"."ExcerptPostId" IS NULL AND "T"."WikiPostId" IS NULL ORDER BY "T"."TagName" NULLS FIRST | 0.219727 |
CREATE TABLE region (region_id DECIMAL, region_code TEXT, region_name TEXT)
CREATE TABLE affected_region (region_id DECIMAL, storm_id DECIMAL, number_city_affected DECIMAL)
CREATE TABLE storm (storm_id DECIMAL, name TEXT, dates_active TEXT, max_speed DECIMAL, damage_millions_usd DECIMAL, number_deaths DECIMAL)
| Show names for all regions except for Denmark. | SELECT region_name FROM region WHERE region_name <> 'Denmark' | SELECT "region_name" FROM "region" WHERE "region_name" <> 'Denmark' | 0.06543 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.