schema
stringlengths 29
5.42k
| question
stringlengths 0
752
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
8.94k
| weight
float64 0
8.73
|
---|---|---|---|---|
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
| Number of unique answerers per month. | SELECT YR_MONTH, COUNT(*) AS NumAnswerers FROM (SELECT (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%m') - 1) / 12.0) AS YR_MONTH, u.Id AS UID, COUNT(*) AS NumAnswers FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id AND p.PostTypeId = 2 GROUP BY (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%m') - 1) / 12.0), u.Id) AS AnsPerUPerWk WHERE NumAnswers > 0 GROUP BY YR_MONTH ORDER BY YR_MONTH | WITH "AnsPerUPerWk" AS (SELECT MAX(1) AS "_" FROM "Users" "u" JOIN "Posts" "p" ON "p"."OwnerUserId" = "u"."Id" AND "p"."PostTypeId" = 2 GROUP BY (TO_CHAR("p"."CreationDate", 'YY') + (TO_CHAR("p"."CreationDate", 'MM') - 1) / NULLIF(12.0, 0)), "u"."Id") SELECT "YR_MONTH", COUNT(*) AS "NumAnswerers" FROM "AnsPerUPerWk" "AnsPerUPerWk" WHERE "NumAnswers" > 0 GROUP BY "YR_MONTH" ORDER BY "YR_MONTH" | 0.385742 |
CREATE TABLE table_train_249 ("id" NUMBER, "gender" CLOB, "allergy_to_dapagliflozin" BOOLEAN, "body_weight" FLOAT, "estimated_glomerular_filtration_rate_egfr" NUMBER, "body_mass_index_bmi" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
| known or suspected allergy to dapagliflozin | SELECT * FROM table_train_249 WHERE allergy_to_dapagliflozin = 1 | SELECT * FROM "table_train_249" WHERE "allergy_to_dapagliflozin" = 1 | 0.066406 |
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| how many times does patient 94937 come to the hospital during this year. | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 94937 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | SELECT COUNT(DISTINCT "admissions"."hadm_id") FROM "admissions" WHERE "admissions"."subject_id" = 94937 AND DATETIME("admissions"."admittime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | 0.208984 |
CREATE TABLE table_name_53 (surface VARCHAR2, opponents VARCHAR2)
| Which type of surface do Amer Delic Robert Kendrick's opponents have? | SELECT surface FROM table_name_53 WHERE opponents = "amer delic robert kendrick" | SELECT "surface" FROM "table_name_53" WHERE "amer delic robert kendrick" = "opponents" | 0.083984 |
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
| what is AS | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'AS' | SELECT DISTINCT "airline_code" FROM "airline" WHERE "airline_code" = 'AS' | 0.071289 |
CREATE TABLE Participates_in (stuid NUMBER, actid NUMBER)
CREATE TABLE Activity (actid NUMBER, activity_name VARCHAR2)
CREATE TABLE Faculty (FacID NUMBER, Lname VARCHAR2, Fname VARCHAR2, Rank VARCHAR2, Sex VARCHAR2, Phone NUMBER, Room VARCHAR2, Building VARCHAR2)
CREATE TABLE Student (StuID NUMBER, LName VARCHAR2, Fname VARCHAR2, Age NUMBER, Sex VARCHAR2, Major NUMBER, Advisor NUMBER, city_code VARCHAR2)
CREATE TABLE Faculty_Participates_in (FacID NUMBER, actid NUMBER)
| How many faculty members do we have for each rank and gender? Plot them as bar chart, and list from low to high by the names. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY Rank | SELECT "Rank", COUNT(*) FROM "Faculty" GROUP BY "Sex", "Rank" ORDER BY "Rank" | 0.075195 |
CREATE TABLE table_24791 ("Pilot" CLOB, "Organization" CLOB, "Total Flights" FLOAT, "USAF space flights" FLOAT, "FAI space flights" FLOAT, "Max Mach" CLOB, "Max speed ( mph ) " FLOAT, "Max altitude ( miles ) " CLOB)
| Who was the pilot of max altitude of 55.9 miles? | SELECT "Pilot" FROM table_24791 WHERE "Max altitude (miles)" = '55.9' | SELECT "Pilot" FROM "table_24791" WHERE "Max altitude (miles)" = '55.9' | 0.069336 |
CREATE TABLE table_name_10 (area_km_2 NUMBER, official_name VARCHAR2, population VARCHAR2)
| What is the Area of the Allardville Parish with a Population smaller than 2,151? | SELECT SUM(area_km_2) FROM table_name_10 WHERE official_name = "allardville" AND population < 2 OFFSET 151 | SELECT SUM("area_km_2") FROM "table_name_10" WHERE "allardville" = "official_name" AND "population" < 2 OFFSET 151 ROWS | 0.116211 |
CREATE TABLE table_name_18 (coach VARCHAR2, ncaa VARCHAR2, losses VARCHAR2, conference_titles VARCHAR2, seasons VARCHAR2)
| Which coach has 0 conference titles, more than 2 seasons, higher than 87 losses and 0 NCAA? | SELECT coach FROM table_name_18 WHERE conference_titles = "0" AND seasons > 2 AND losses > 87 AND ncaa = "0" | SELECT "coach" FROM "table_name_18" WHERE "0" = "conference_titles" AND "0" = "ncaa" AND "losses" > 87 AND "seasons" > 2 | 0.117188 |
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
| For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of manager_id , and group by attribute job_id. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | SELECT "JOB_ID", AVG("MANAGER_ID") FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' GROUP BY "JOB_ID" | 0.099609 |
CREATE TABLE table_43002 ("Result" CLOB, "Date" CLOB, "Race" CLOB, "Venue" CLOB, "Group" CLOB, "Distance" CLOB, "Weight ( kg ) " FLOAT, "Time" CLOB, "Jockey" CLOB, "Winner/2nd" CLOB)
| In what Distance has a Venue of sale? | SELECT "Distance" FROM table_43002 WHERE "Venue" = 'sale' | SELECT "Distance" FROM "table_43002" WHERE "Venue" = 'sale' | 0.057617 |
CREATE TABLE Addresses (Address_ID VARCHAR2, Line_1 VARCHAR2, Line_2 VARCHAR2, City_Town VARCHAR2, State_County VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Clients (Client_ID NUMBER, Address_ID NUMBER, Customer_Email_Address VARCHAR2, Customer_Name VARCHAR2, Customer_Phone VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Stores (Store_ID VARCHAR2, Address_ID NUMBER, Marketing_Region_Code CHAR, Store_Name VARCHAR2, Store_Phone VARCHAR2, Store_Email_Address VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Customers (Customer_ID VARCHAR2, Address_ID NUMBER, Customer_Name VARCHAR2, Customer_Phone VARCHAR2, Customer_Email_Address VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Services (Service_ID NUMBER, Service_Type_Code CHAR, Workshop_Group_ID NUMBER, Product_Description VARCHAR2, Product_Name VARCHAR2, Product_Price NUMBER, Other_Product_Service_Details VARCHAR2)
CREATE TABLE Customer_Orders (Order_ID NUMBER, Customer_ID NUMBER, Store_ID NUMBER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR2)
CREATE TABLE Bookings (Booking_ID NUMBER, Customer_ID NUMBER, Workshop_Group_ID VARCHAR2, Status_Code CHAR, Store_ID NUMBER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR2)
CREATE TABLE Performers (Performer_ID NUMBER, Address_ID NUMBER, Customer_Name VARCHAR2, Customer_Phone VARCHAR2, Customer_Email_Address VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Performers_in_Bookings (Order_ID NUMBER, Performer_ID NUMBER)
CREATE TABLE Marketing_Regions (Marketing_Region_Code CHAR, Marketing_Region_Name VARCHAR2, Marketing_Region_Descriptrion VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Invoices (Invoice_ID NUMBER, Order_ID NUMBER, payment_method_code CHAR, Product_ID NUMBER, Order_Quantity VARCHAR2, Other_Item_Details VARCHAR2, Order_Item_ID NUMBER)
CREATE TABLE Products (Product_ID VARCHAR2, Product_Name VARCHAR2, Product_Price NUMBER, Product_Description VARCHAR2, Other_Product_Service_Details VARCHAR2)
CREATE TABLE Order_Items (Order_Item_ID NUMBER, Order_ID NUMBER, Product_ID NUMBER, Order_Quantity VARCHAR2, Other_Item_Details VARCHAR2)
CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR, payment_method_description VARCHAR2)
CREATE TABLE Drama_Workshop_Groups (Workshop_Group_ID NUMBER, Address_ID NUMBER, Currency_Code CHAR, Marketing_Region_Code CHAR, Store_Name VARCHAR2, Store_Phone VARCHAR2, Store_Email_Address VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Ref_Service_Types (Service_Type_Code CHAR, Parent_Service_Type_Code CHAR, Service_Type_Description VARCHAR2)
CREATE TABLE Invoice_Items (Invoice_Item_ID NUMBER, Invoice_ID NUMBER, Order_ID NUMBER, Order_Item_ID NUMBER, Product_ID NUMBER, Order_Quantity NUMBER, Other_Item_Details VARCHAR2)
CREATE TABLE Bookings_Services (Order_ID NUMBER, Product_ID NUMBER)
| Compute the total the average of product price across product name as a pie chart. | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name | SELECT "Product_Name", AVG("Product_Price") FROM "Products" GROUP BY "Product_Name" | 0.081055 |
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
| when was patient 1272 first tested at a laboratory in 11/2104? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1272) AND STRFTIME('%y-%m', labevents.charttime) = '2104-11' ORDER BY labevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 1272 GROUP BY "hadm_id") SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y-%m', "labevents"."charttime") = '2104-11' ORDER BY "labevents"."charttime" FETCH FIRST 1 ROWS ONLY | 0.366211 |
CREATE TABLE table_202_191 (id NUMBER, "party" CLOB, "votes" NUMBER, "%" NUMBER, "seats" NUMBER, "+/-" NUMBER)
| name the top three parties ? | SELECT "party" FROM table_202_191 ORDER BY "votes" DESC LIMIT 3 | SELECT "party" FROM "table_202_191" ORDER BY "votes" DESC FETCH FIRST 3 ROWS ONLY | 0.079102 |
CREATE TABLE tip (tip_id NUMBER, business_id VARCHAR2, text TEXT, user_id VARCHAR2, likes NUMBER, year NUMBER, month VARCHAR2)
CREATE TABLE user (uid NUMBER, user_id VARCHAR2, name VARCHAR2)
CREATE TABLE business (bid NUMBER, business_id VARCHAR2, name VARCHAR2, full_address VARCHAR2, city VARCHAR2, latitude VARCHAR2, longitude VARCHAR2, review_count NUMBER, is_open NUMBER, rating FLOAT, state VARCHAR2)
CREATE TABLE review (rid NUMBER, business_id VARCHAR2, user_id VARCHAR2, rating FLOAT, text TEXT, year NUMBER, month VARCHAR2)
CREATE TABLE neighborhood (id NUMBER, business_id VARCHAR2, neighborhood_name VARCHAR2)
CREATE TABLE category (id NUMBER, business_id VARCHAR2, category_name VARCHAR2)
CREATE TABLE checkin (cid NUMBER, business_id VARCHAR2, count NUMBER, day VARCHAR2)
| list all the reviews by Niloofar | SELECT review.text FROM review, user WHERE user.name = 'Niloofar' AND user.user_id = review.user_id | SELECT "review"."text" FROM "review" JOIN "user" ON "review"."user_id" = "user"."user_id" AND "user"."name" = 'Niloofar' | 0.117188 |
CREATE TABLE table_45126 ("Player" CLOB, "Wkts" FLOAT, "Runs" FLOAT, "Econ" FLOAT, "Ovrs" FLOAT)
| what is the sum of the wkts when the ovrs were bigger than 2 and econ was bigger than 7.84? | SELECT SUM("Wkts") FROM table_45126 WHERE "Ovrs" > '2' AND "Econ" > '7.84' | SELECT SUM("Wkts") FROM "table_45126" WHERE "Econ" > '7.84' AND "Ovrs" > '2' | 0.074219 |
CREATE TABLE table_31423 ("Prefix class" CLOB, "Type and usage" CLOB, "Example" CLOB, "Equivalent" CLOB, "Reference" CLOB)
| What is every equivalent for the example of asy28? | SELECT "Equivalent" FROM table_31423 WHERE "Example" = 'ASY28' | SELECT "Equivalent" FROM "table_31423" WHERE "Example" = 'ASY28' | 0.0625 |
CREATE TABLE table_27713721_1 (production_code VARCHAR2, us_viewers__millions_ VARCHAR2)
| How many episodes had an audience of exactly 25.3 million viewers in the U.S.A.? | SELECT COUNT(production_code) FROM table_27713721_1 WHERE us_viewers__millions_ = "25.3" | SELECT COUNT("production_code") FROM "table_27713721_1" WHERE "25.3" = "us_viewers__millions_" | 0.091797 |
CREATE TABLE table_67301 ("Driver" CLOB, "Constructor" CLOB, "Laps" CLOB, "Time/Retired" CLOB, "Grid" CLOB)
| What is the number of laps for Grid 3? | SELECT "Laps" FROM table_67301 WHERE "Grid" = '3' | SELECT "Laps" FROM "table_67301" WHERE "Grid" = '3' | 0.049805 |
CREATE TABLE fires (fire_year NUMBER, discovery_date NUMBER, discovery_doy NUMBER, discovery_time CLOB, stat_cause_code NUMBER, stat_cause_descr CLOB, cont_date CLOB, cont_doy CLOB, cont_time CLOB, fire_size NUMBER, fire_size_class CLOB, latitude NUMBER, longitude NUMBER, owner_code NUMBER, owner_descr CLOB, state CLOB, county CLOB, fips_code CLOB, fips_name CLOB)
| Which state has the largest wildfire? | SELECT state FROM fires ORDER BY fire_size DESC LIMIT 1 | SELECT "state" FROM "fires" ORDER BY "fire_size" DESC FETCH FIRST 1 ROWS ONLY | 0.075195 |
CREATE TABLE table_77357 ("Name" CLOB, "Birth" CLOB, "Marriage" CLOB, "Became Dauphine" CLOB, "Ceased to be Dauphine" CLOB, "Death" CLOB, "Husband" CLOB)
| When was became dauphine when birth is 1393? | SELECT "Became Dauphine" FROM table_77357 WHERE "Birth" = '1393' | SELECT "Became Dauphine" FROM "table_77357" WHERE "Birth" = '1393' | 0.064453 |
CREATE TABLE table_80150 ("Year ( Ceremony ) " CLOB, "Film title used in nomination" CLOB, "Original title" CLOB, "Language ( s ) " CLOB, "Result" CLOB)
| What was the title used for Rosie, the film nominated for the dutch language? | SELECT "Film title used in nomination" FROM table_80150 WHERE "Language(s)" = 'dutch' AND "Original title" = 'rosie' | SELECT "Film title used in nomination" FROM "table_80150" WHERE "Language(s)" = 'dutch' AND "Original title" = 'rosie' | 0.115234 |
CREATE TABLE table_40196 ("Round" CLOB, "Date" CLOB, "Matches" FLOAT, "Clubs" CLOB, "Prize money" CLOB)
| What is Date, when Matches is less than 32, and when Round is Fifth Round Proper? | SELECT "Date" FROM table_40196 WHERE "Matches" < '32' AND "Round" = 'fifth round proper' | SELECT "Date" FROM "table_40196" WHERE "Matches" < '32' AND "Round" = 'fifth round proper' | 0.087891 |
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
| Are A.M. classes available for the HJCS 491 course ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'HJCS' AND course.number = 491 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT COUNT(*) > 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" AND "course_offering"."start_time" < '12:00:00' AND "course_offering"."start_time" >= '08:00:00' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'WN' AND "semester"."year" = 2016 WHERE "course"."department" = 'HJCS' AND "course"."number" = 491 | 0.401367 |
CREATE TABLE table_name_44 (date VARCHAR2, score VARCHAR2, result VARCHAR2, competition VARCHAR2)
| Result of l, and a Competition of 1966 asian games, and a Score of 0 1 had what date? | SELECT date FROM table_name_44 WHERE result = "l" AND competition = "1966 asian games" AND score = "0β1" | SELECT "date" FROM "table_name_44" WHERE "0β1" = "score" AND "1966 asian games" = "competition" AND "l" = "result" | 0.111328 |
CREATE TABLE table_15908 ("Member" CLOB, "Headquarters" CLOB, "Classification" CLOB, "Chapters" FLOAT, "Founded" CLOB, "UCCFS" FLOAT)
| Where is the headquarters of Alpha Nu Omega | SELECT "Headquarters" FROM table_15908 WHERE "Member" = 'Alpha Nu Omega' | SELECT "Headquarters" FROM "table_15908" WHERE "Member" = 'Alpha Nu Omega' | 0.072266 |
CREATE TABLE table_28904 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" CLOB, "Result" CLOB, "Candidates" CLOB)
| what is the district when the party is federalist and first elected is 1814? | SELECT "District" FROM table_28904 WHERE "Party" = 'Federalist' AND "First elected" = '1814' | SELECT "District" FROM "table_28904" WHERE "First elected" = '1814' AND "Party" = 'Federalist' | 0.091797 |
CREATE TABLE table_78586 ("Rank" FLOAT, "Name" CLOB, "Season" CLOB, "Club" CLOB, "minutes" FLOAT)
| What are the minutes of the Player from Real Madrid Club with a Rank of 7 or larger? | SELECT SUM("minutes") FROM table_78586 WHERE "Rank" > '7' AND "Club" = 'real madrid' | SELECT SUM("minutes") FROM "table_78586" WHERE "Club" = 'real madrid' AND "Rank" > '7' | 0.083984 |
CREATE TABLE table_203_173 (id NUMBER, "year ( s ) " CLOB, "serial name" CLOB, "role" CLOB, "co-star" CLOB, "note ( s ) " CLOB, "channel" CLOB)
| did he act longer on sinndoor tere naam ka or saat phere ? | SELECT "serial name" FROM table_203_173 WHERE "serial name" IN ('sinndoor tere naam ka', 'saat phere') ORDER BY "year(s)" - "year(s)" DESC LIMIT 1 | SELECT "serial name" FROM "table_203_173" WHERE "serial name" IN ('sinndoor tere naam ka', 'saat phere') ORDER BY "year(s)" - "year(s)" DESC FETCH FIRST 1 ROWS ONLY | 0.160156 |
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
| Tag counts over time for specific tags. | SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2010-06-01' AND Posts.CreationDate > '2010-05-01' GROUP BY TagName | SELECT COUNT("PostId") AS "Rate", "TagName" FROM "Tags" JOIN "Posts" ON "PostId" = "Posts"."Id" AND "Posts"."CreationDate" < '2010-06-01' AND "Posts"."CreationDate" > '2010-05-01' JOIN "PostTags" ON "PostTags"."TagId" = "Tags"."Id" GROUP BY "TagName" | 0.244141 |
CREATE TABLE table_24160 ("University" CLOB, "Nick" CLOB, "University status" FLOAT, "Founded" FLOAT, "Location" CLOB, "Division" CLOB, "Specialization" CLOB, "Website" CLOB)
| Where is every location with specialization of textile engineering? | SELECT "Location" FROM table_24160 WHERE "Specialization" = 'Textile engineering' | SELECT "Location" FROM "table_24160" WHERE "Specialization" = 'Textile engineering' | 0.081055 |
CREATE TABLE table_name_89 (headquarter VARCHAR2, language VARCHAR2, type VARCHAR2)
| What is Headquarter, when Language is English, and when Type is Independent Online News Portal? | SELECT headquarter FROM table_name_89 WHERE language = "english" AND type = "independent online news portal" | SELECT "headquarter" FROM "table_name_89" WHERE "english" = "language" AND "independent online news portal" = "type" | 0.113281 |
CREATE TABLE table_204_300 (id NUMBER, "date from" CLOB, "date to" CLOB, "pos." CLOB, "name" CLOB, "from" CLOB)
| name a player whose to date is in march and from date is in january . | SELECT "name" FROM table_204_300 WHERE "date to" = 3 AND "date from" = 1 | SELECT "name" FROM "table_204_300" WHERE "date from" = 1 AND "date to" = 3 | 0.072266 |
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| tube feeding had ever been given to patient 30509 until 11/2105? | SELECT COUNT(*) > 0 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 = 30509)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tube feeding' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m', inputevents_cv.charttime) <= '2105-11' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 30509 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_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" = 'tube feeding' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "inputevents_cv" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "inputevents_cv"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m', "inputevents_cv"."charttime") <= '2105-11' | 0.726563 |
CREATE TABLE table_name_47 (birth VARCHAR2, ceased_to_be_queen VARCHAR2)
| What is the birth date of the woman who ceased to be Queen on 18 Jun 1297? | SELECT birth FROM table_name_47 WHERE ceased_to_be_queen = "18 jun 1297" | SELECT "birth" FROM "table_name_47" WHERE "18 jun 1297" = "ceased_to_be_queen" | 0.076172 |
CREATE TABLE table_name_82 (senator VARCHAR2, district VARCHAR2, party VARCHAR2, home_town VARCHAR2)
| Which Senator has a Party of republican, a Home Town of houston, and a District of 7? | SELECT senator FROM table_name_82 WHERE party = "republican" AND home_town = "houston" AND district = 7 | SELECT "senator" FROM "table_name_82" WHERE "district" = 7 AND "home_town" = "houston" AND "party" = "republican" | 0.110352 |
CREATE TABLE table_204_589 (id NUMBER, "season" CLOB, "tier" NUMBER, "division" CLOB, "pos." CLOB, "notes" CLOB)
| does honor b or asobal have the larger tier ? | SELECT "division" FROM table_204_589 WHERE "division" IN ('honor b', 'asobal') ORDER BY "tier" DESC LIMIT 1 | SELECT "division" FROM "table_204_589" WHERE "division" IN ('honor b', 'asobal') ORDER BY "tier" DESC FETCH FIRST 1 ROWS ONLY | 0.12207 |
CREATE TABLE table_name_94 (catalog VARCHAR2, date VARCHAR2)
| What is the catalog of the record released on May 27, 2009? | SELECT catalog FROM table_name_94 WHERE date = "may 27, 2009" | SELECT "catalog" FROM "table_name_94" WHERE "date" = "may 27, 2009" | 0.06543 |
CREATE TABLE table_203_568 (id NUMBER, "town/village" CLOB, "population" NUMBER, "postal code" CLOB, "municipality" CLOB, "island" CLOB, "location" CLOB)
| what is the population size difference between akrar and dalur ? | SELECT ABS((SELECT "population" FROM table_203_568 WHERE "town/village" = 'akrar') - (SELECT "population" FROM table_203_568 WHERE "town/village" = 'dalur')) | SELECT ABS((SELECT "population" FROM "table_203_568" WHERE "town/village" = 'akrar') - (SELECT "population" FROM "table_203_568" WHERE "town/village" = 'dalur')) | 0.157227 |
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| how much did patient 13837 weigh first measured since 166 months ago? | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13837)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) >= DATETIME(CURRENT_TIME(), '-166 month') ORDER BY chartevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 13837 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'admit wt' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT "chartevents"."valuenum" FROM "chartevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE DATETIME("chartevents"."charttime") >= DATETIME(CURRENT_TIME(), '-166 month') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL ORDER BY "chartevents"."charttime" FETCH FIRST 1 ROWS ONLY | 0.796875 |
CREATE TABLE table_name_92 (city_or_town VARCHAR2, top_division_titles VARCHAR2)
| Which City or town has a Top division titles of 17 | SELECT city_or_town FROM table_name_92 WHERE top_division_titles = "17" | SELECT "city_or_town" FROM "table_name_92" WHERE "17" = "top_division_titles" | 0.075195 |
CREATE TABLE table_16056 ("Camp" CLOB, "Estimated deaths" CLOB, "Operational" CLOB, "Occupied territory" CLOB, "Current country of location" CLOB, "Primary means for mass killings" CLOB)
| what's the current country of location with operational period of summer of 1941 to 28 june 1944 | SELECT "Current country of location" FROM table_16056 WHERE "Operational" = 'Summer of 1941 to 28 June 1944' | SELECT "Current country of location" FROM "table_16056" WHERE "Operational" = 'Summer of 1941 to 28 June 1944' | 0.107422 |
CREATE TABLE table_name_79 (laps NUMBER, driver VARCHAR2, grid VARCHAR2)
| Whats teo fabi average lap time while having less than 9 grids? | SELECT AVG(laps) FROM table_name_79 WHERE driver = "teo fabi" AND grid < 9 | SELECT AVG("laps") FROM "table_name_79" WHERE "driver" = "teo fabi" AND "grid" < 9 | 0.080078 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| provide the number of patients whose marital status is single and procedure long title is cardiac mapping? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Cardiac mapping" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Cardiac mapping" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "SINGLE" = "demographic"."marital_status" | 0.230469 |
CREATE TABLE table_name_6 (shirt_no NUMBER, birth_date VARCHAR2, weight VARCHAR2)
| Birth Date of 8 November 1980, and a Weight smaller than 93 has what sum of a shirt number? | SELECT SUM(shirt_no) FROM table_name_6 WHERE birth_date = "8 november 1980" AND weight < 93 | SELECT SUM("shirt_no") FROM "table_name_6" WHERE "8 november 1980" = "birth_date" AND "weight" < 93 | 0.09668 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| how many patients whose days of hospital stay is greater than 6? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "6" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "6" < "demographic"."days_stay" | 0.103516 |
CREATE TABLE table_46862 ("State" CLOB, "Type" CLOB, "Name" CLOB, "Title" CLOB, "Royal house" CLOB, "From" CLOB)
| In which state did Marquis Li rule? | SELECT "State" FROM table_46862 WHERE "Name" = 'li' AND "Title" = 'marquis' | SELECT "State" FROM "table_46862" WHERE "Name" = 'li' AND "Title" = 'marquis' | 0.075195 |
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
| what was the maximum monthly number of patients who were diagnosed with arrhythmia during this year? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'arrhythmia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 | WITH "t1" AS (SELECT COUNT(DISTINCT "diagnosis"."patientunitstayid") AS "c1" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'arrhythmia' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m', "diagnosis"."diagnosistime")) SELECT MAX("t1"."c1") FROM "t1" "t1" | 0.341797 |
CREATE TABLE table_name_87 (date VARCHAR2, opponents VARCHAR2)
| What date was the game against Royal Antwerp? | SELECT date FROM table_name_87 WHERE opponents = "royal antwerp" | SELECT "date" FROM "table_name_87" WHERE "opponents" = "royal antwerp" | 0.068359 |
CREATE TABLE table_26860 ("Season" FLOAT, "Series" CLOB, "Team" CLOB, "Races" FLOAT, "Wins" FLOAT, "Poles" FLOAT, "FLaps" FLOAT, "Podiums" FLOAT, "Points" CLOB, "Position" CLOB)
| Name th most poles for macau grand prix | SELECT MAX("Poles") FROM table_26860 WHERE "Series" = 'Macau Grand Prix' | SELECT MAX("Poles") FROM "table_26860" WHERE "Series" = 'Macau Grand Prix' | 0.072266 |
CREATE TABLE table_name_95 (award VARCHAR2, category VARCHAR2, nominee VARCHAR2)
| What award was Denis Lawson nominated for in the Best Actor in a Musical category? | SELECT award FROM table_name_95 WHERE category = "best actor in a musical" AND nominee = "denis lawson" | SELECT "award" FROM "table_name_95" WHERE "best actor in a musical" = "category" AND "denis lawson" = "nominee" | 0.108398 |
CREATE TABLE table_31205 ("Skip ( Club ) " CLOB, "W" FLOAT, "L" FLOAT, "PF" FLOAT, "PA" FLOAT, "Ends Won" FLOAT, "Ends Lost" FLOAT, "Blank Ends" FLOAT, "Stolen Ends" FLOAT)
| Which skip (club) had 31 PA and 9 blank ends? | SELECT "Skip (Club)" FROM table_31205 WHERE "PA" = '31' AND "Blank Ends" = '9' | SELECT "Skip (Club)" FROM "table_31205" WHERE "Blank Ends" = '9' AND "PA" = '31' | 0.078125 |
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
| Search posts with string after some date. | SELECT Id AS "post_link" FROM Posts WHERE CreationDate >= '##datefrom##' AND Body LIKE '%##string##%' | SELECT "Id" AS "post_link" FROM "Posts" WHERE "Body" LIKE '%##string##%' AND "CreationDate" >= '##datefrom##' | 0.106445 |
CREATE TABLE table_16863 ("Player" CLOB, "No." CLOB, "Nationality" CLOB, "Position" CLOB, "Years for Jazz" CLOB, "School/Club Team" CLOB)
| What is the position for player Blue Edwards? | SELECT "Position" FROM table_16863 WHERE "Player" = 'Blue Edwards' | SELECT "Position" FROM "table_16863" WHERE "Player" = 'Blue Edwards' | 0.066406 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| Give me the number of patients less than 81 years who had an insertion of endotracheal tube procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "81" AND procedures.long_title = "Insertion of endotracheal tube" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Insertion of endotracheal tube" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "81" > "demographic"."age" | 0.230469 |
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
| Busiest times-of-day ranked separately for each of Questions & Answers. | SELECT CAST(TIME_TO_STR(CreationDate, '%H') AS TEXT) + ':00' AS "hourutc", SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS numQuestions, RANK() OVER (ORDER BY SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) DESC) AS rankQuestions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS numAnswers, RANK() OVER (ORDER BY SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) DESC) AS rankAnswers FROM Posts WHERE PostTypeId IN (1, 2) AND YEAR(CreationDate) >= 2018 GROUP BY CAST(TIME_TO_STR(CreationDate, '%H') AS TEXT) + ':00' ORDER BY CAST(TIME_TO_STR(CreationDate, '%H') AS TEXT) + ':00' | SELECT CONCAT(CAST(TO_CHAR("CreationDate", 'HH24') AS CLOB), ':00') AS "hourutc", SUM(CASE WHEN "PostTypeId" = 1 THEN 1 ELSE 0 END) AS "numQuestions", RANK() OVER (ORDER BY SUM(CASE WHEN "PostTypeId" = 1 THEN 1 ELSE 0 END) DESC) AS "rankQuestions", SUM(CASE WHEN "PostTypeId" = 2 THEN 1 ELSE 0 END) AS "numAnswers", RANK() OVER (ORDER BY SUM(CASE WHEN "PostTypeId" = 2 THEN 1 ELSE 0 END) DESC) AS "rankAnswers" FROM "Posts" WHERE "PostTypeId" IN (1, 2) AND YEAR("CreationDate") >= 2018 GROUP BY CONCAT(CAST(TO_CHAR("CreationDate", 'HH24') AS CLOB), ':00') ORDER BY CONCAT(CAST(TO_CHAR("CreationDate", 'HH24') AS CLOB), ':00') | 0.610352 |
CREATE TABLE table_31310 ("Date" CLOB, "Competition" CLOB, "Location" CLOB, "Home Team" CLOB, "Result" CLOB, "Away Team" CLOB)
| Who were the away teams when the competition was the 1st republic of srpska football day and the home team was u 14 republic of srpska? | SELECT "Away Team" FROM table_31310 WHERE "Competition" = '1st ``Republic of Srpska Football Day``' AND "Home Team" = 'U 14 Republic of Srpska' | SELECT "Away Team" FROM "table_31310" WHERE "Competition" = '1st ``Republic of Srpska Football Day``' AND "Home Team" = 'U 14 Republic of Srpska' | 0.141602 |
CREATE TABLE table_72745 ("Former kingdom" CLOB, "Province" CLOB, "Hangul" CLOB, "Hanja" CLOB, "Capital" CLOB, "Modern equivalent" CLOB)
| What is the hangul symbol for the hanja ? | SELECT "Hangul" FROM table_72745 WHERE "Hanja" = 'θ―ε·' | SELECT "Hangul" FROM "table_72745" WHERE "Hanja" = 'θ―ε·' | 0.053711 |
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
| Of the classes offered this Fall , which count towards the CS major ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" CROSS JOIN "course_offering" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Fall' AND "semester"."year" = 2016 JOIN "program" ON "program"."name" LIKE '%CS%' AND "program"."program_id" = "program_course"."program_id" | 0.427734 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| provide the number of patients whose admission location is transfer from hosp/extram and procedure long title is incision of vessel, abdominal arteries? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Incision of vessel, abdominal arteries" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Incision of vessel, abdominal arteries" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "TRANSFER FROM HOSP/EXTRAM" = "demographic"."admission_location" | 0.275391 |
CREATE TABLE table_203_218 (id NUMBER, "pos" NUMBER, "class" CLOB, "no" NUMBER, "team" CLOB, "drivers" CLOB, "chassis" CLOB, "engine" CLOB, "laps" NUMBER)
| how many laps did scuderia ferrari with driver robert manzon complete ? | SELECT "laps" FROM table_203_218 WHERE "team" = 'scuderia ferrari' AND "drivers" = 'robert manzon' | SELECT "laps" FROM "table_203_218" WHERE "drivers" = 'robert manzon' AND "team" = 'scuderia ferrari' | 0.097656 |
CREATE TABLE table_14915 ("Season" CLOB, "Series" CLOB, "Races" CLOB, "Wins" CLOB, "Podiums" CLOB, "Points" CLOB, "Final Placing" CLOB)
| Which Season has a Final Place of 8th and 8 Podiums? | SELECT "Season" FROM table_14915 WHERE "Final Placing" = '8th' AND "Podiums" = '8' | SELECT "Season" FROM "table_14915" WHERE "Final Placing" = '8th' AND "Podiums" = '8' | 0.082031 |
CREATE TABLE table_name_18 (record VARCHAR2, loss VARCHAR2)
| For the Loss of Plesac (1-5), what is the Record? | SELECT record FROM table_name_18 WHERE loss = "plesac (1-5)" | SELECT "record" FROM "table_name_18" WHERE "loss" = "plesac (1-5)" | 0.064453 |
CREATE TABLE table_9204 ("Born as" CLOB, "Consort as" CLOB, "Born" CLOB, "Marriage" CLOB, "Consort from" CLOB, "Consort to" CLOB, "Died" CLOB, "Spouse to" CLOB)
| Who was the spouse of the consort who was born as rania al yassin? | SELECT "Spouse to" FROM table_9204 WHERE "Born as" = 'rania al yassin' | SELECT "Spouse to" FROM "table_9204" WHERE "Born as" = 'rania al yassin' | 0.070313 |
CREATE TABLE table_name_98 (rider VARCHAR2, grid VARCHAR2, laps VARCHAR2, bike VARCHAR2)
| Name the Rider which has Laps smaller than 11 and a Bike of kawasaki zx-10r, and a Grid of 8? | SELECT rider FROM table_name_98 WHERE laps < 11 AND bike = "kawasaki zx-10r" AND grid = 8 | SELECT "rider" FROM "table_name_98" WHERE "bike" = "kawasaki zx-10r" AND "grid" = 8 AND "laps" < 11 | 0.09668 |
CREATE TABLE table_37100 ("Title" CLOB, "Date" CLOB, "Theatre" CLOB, "Role" CLOB, "Dance Partner" CLOB, "Director" CLOB, "Lyrics" CLOB, "Music" CLOB)
| Which Role has a Theatre of globe, and a Music of jerome kern? | SELECT "Role" FROM table_37100 WHERE "Theatre" = 'globe' AND "Music" = 'jerome kern' | SELECT "Role" FROM "table_37100" WHERE "Music" = 'jerome kern' AND "Theatre" = 'globe' | 0.083984 |
CREATE TABLE table_25005714_3 (bus_type VARCHAR2, texture___gt__s_ VARCHAR2)
| What is every bus type for the texture of fillrate? | SELECT bus_type FROM table_25005714_3 WHERE texture___gt__s_ = "Fillrate" | SELECT "bus_type" FROM "table_25005714_3" WHERE "Fillrate" = "texture___gt__s_" | 0.077148 |
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
| For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, I want to sort by the Y in descending. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC | SELECT "JOB_ID", SUM("MANAGER_ID") FROM "employees" WHERE ("COMMISSION_PCT" <> "null" OR "DEPARTMENT_ID" <> 40) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" <= 12000) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" >= 8000) GROUP BY "JOB_ID" ORDER BY SUM("MANAGER_ID") DESC | 0.251953 |
CREATE TABLE table_1104312_5 (original_name VARCHAR2, population_at_2010_census VARCHAR2)
| What are the original names of the districts where the population in the 2010 census was 210450? | SELECT original_name FROM table_1104312_5 WHERE population_at_2010_census = 210450 | SELECT "original_name" FROM "table_1104312_5" WHERE "population_at_2010_census" = 210450 | 0.085938 |
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
| Users from romania by reputation. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS seqnum, Id AS "userid", DisplayName, Reputation, WebsiteUrl FROM Users WHERE LOWER(Location) LIKE '%romania%' | SELECT ROW_NUMBER() OVER (ORDER BY "Reputation" DESC) AS "seqnum", "Id" AS "userid", "DisplayName", "Reputation", "WebsiteUrl" FROM "Users" WHERE LOWER("Location") LIKE '%romania%' | 0.175781 |
CREATE TABLE table_202_240 (id NUMBER, "year" NUMBER, "single" CLOB, "chart" CLOB, "position" NUMBER)
| which of the singles from dosage had the highest billboard hot 100 rating ? | SELECT "single" FROM table_202_240 ORDER BY "position" LIMIT 1 | SELECT "single" FROM "table_202_240" ORDER BY "position" FETCH FIRST 1 ROWS ONLY | 0.078125 |
CREATE TABLE table_25301 ("Station" CLOB, "Line ( s ) " CLOB, "City/Neighborhood" CLOB, "Year opened" FLOAT, "Transit Connections" CLOB, "Park and ride?" CLOB)
| What are the transit connections from Pioneer Square U? | SELECT "Transit Connections" FROM table_25301 WHERE "Station" = 'Pioneer Square U' | SELECT "Transit Connections" FROM "table_25301" WHERE "Station" = 'Pioneer Square U' | 0.082031 |
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
| For those employees whose first name is ending with the letter m, compute their average salary for visualizing a bar chart, and sort bars in descending order please. | SELECT FIRST_NAME, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME DESC | SELECT "FIRST_NAME", AVG("SALARY") FROM "employees" WHERE "FIRST_NAME" LIKE '%m' GROUP BY "FIRST_NAME" ORDER BY "FIRST_NAME" DESC | 0.125977 |
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
| when did patient 027-106613 first take a tv lab test in 04/2103? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-106613')) AND lab.labname = 'tv' AND STRFTIME('%y-%m', lab.labresulttime) = '2103-04' ORDER BY lab.labresulttime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '027-106613' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "lab"."labresulttime" FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'tv' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "lab"."labresulttime") = '2103-04' ORDER BY "lab"."labresulttime" FETCH FIRST 1 ROWS ONLY | 0.612305 |
CREATE TABLE table_name_85 (attendance VARCHAR2, record VARCHAR2)
| What was the attendance of the Mariners game when they had a record of 56 20? | SELECT attendance FROM table_name_85 WHERE record = "56β20" | SELECT "attendance" FROM "table_name_85" WHERE "56β20" = "record" | 0.063477 |
CREATE TABLE table_44867 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" FLOAT, "Money ( $ ) " FLOAT)
| What is the lowest amount of money a player from South Africa with a to par less than 8 has? | SELECT MIN("Money ( $ )") FROM table_44867 WHERE "Country" = 'south africa' AND "To par" < '8' | SELECT MIN("Money ( $ )") FROM "table_44867" WHERE "Country" = 'south africa' AND "To par" < '8' | 0.09375 |
CREATE TABLE table_21755 ("Gatchaman" CLOB, "Battle of the Planets" CLOB, "G-Force" CLOB, "Eagle Riders" CLOB, "OVA ( Harmony Gold Dub ) " CLOB)
| Which gatchaman has eagle riders as lukan? | SELECT "Gatchaman" FROM table_21755 WHERE "Eagle Riders" = 'Lukan' | SELECT "Gatchaman" FROM "table_21755" WHERE "Eagle Riders" = 'Lukan' | 0.066406 |
CREATE TABLE table_71876 ("Date" CLOB, "Venue" CLOB, "Score" CLOB, "Result" CLOB, "Competition" CLOB)
| Which Competition has a Score of 2-0? | SELECT "Competition" FROM table_71876 WHERE "Score" = '2-0' | SELECT "Competition" FROM "table_71876" WHERE "Score" = '2-0' | 0.05957 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
| is patient 031-15666's temperature last measured on the last intensive care unit visit greater than the value first measured on the last intensive care unit visit? | SELECT (SELECT vitalperiodic.temperature FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) AND NOT vitalperiodic.temperature IS NULL ORDER BY vitalperiodic.observationtime DESC LIMIT 1) > (SELECT vitalperiodic.temperature FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) AND NOT vitalperiodic.temperature IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '031-15666' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."unitdischargetime" IS NULL GROUP BY "patientunitstayid" ORDER BY "patient"."unitadmittime" DESC FETCH FIRST 1 ROWS ONLY), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL AND NOT "patient"."unitdischargetime" IS NULL GROUP BY "patientunitstayid" ORDER BY "patient"."unitadmittime" DESC FETCH FIRST 1 ROWS ONLY) SELECT (SELECT "vitalperiodic"."temperature" FROM "vitalperiodic" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND NOT "vitalperiodic"."temperature" IS NULL ORDER BY "vitalperiodic"."observationtime" DESC FETCH FIRST 1 ROWS ONLY) > (SELECT "vitalperiodic"."temperature" FROM "vitalperiodic" LEFT JOIN "_u_4" "_u_4" ON "_u_4"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_4"."" IS NULL AND NOT "vitalperiodic"."temperature" IS NULL ORDER BY "vitalperiodic"."observationtime" FETCH FIRST 1 ROWS ONLY) | 1.307617 |
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
| For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id by a bar chart, and display by the total number of department id from high to low. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC | SELECT "JOB_ID", SUM("DEPARTMENT_ID") FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' GROUP BY "JOB_ID" ORDER BY SUM("DEPARTMENT_ID") DESC | 0.136719 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| what is age and discharge time of subject name jerry deberry? | SELECT demographic.age, demographic.dischtime FROM demographic WHERE demographic.name = "Jerry Deberry" | SELECT "demographic"."age", "demographic"."dischtime" FROM "demographic" WHERE "Jerry Deberry" = "demographic"."name" | 0.114258 |
CREATE TABLE table_53623 ("Year" FLOAT, "Competition Description" CLOB, "Location" CLOB, "Apparatus" CLOB, "Score-Final" FLOAT, "Score-Qualifying" FLOAT)
| Which competition description's apparatus was ribbon? | SELECT "Competition Description" FROM table_53623 WHERE "Apparatus" = 'ribbon' | SELECT "Competition Description" FROM "table_53623" WHERE "Apparatus" = 'ribbon' | 0.078125 |
CREATE TABLE table_10269427_3 (directed_by VARCHAR2, written_by VARCHAR2)
| who directed the movie written by is sib ventress / aydrea ten bosch | SELECT directed_by FROM table_10269427_3 WHERE written_by = "Sib Ventress / Aydrea ten Bosch" | SELECT "directed_by" FROM "table_10269427_3" WHERE "Sib Ventress / Aydrea ten Bosch" = "written_by" | 0.09668 |
CREATE TABLE table_name_10 (purse VARCHAR2, year VARCHAR2)
| What is the Purse listed for the Year of 1998? | SELECT purse FROM table_name_10 WHERE year = "1998" | SELECT "purse" FROM "table_name_10" WHERE "1998" = "year" | 0.055664 |
CREATE TABLE table_name_84 (became_duchess VARCHAR2, death VARCHAR2)
| WHo Became Duchess that has a Death of 26 october 1614? | SELECT became_duchess FROM table_name_84 WHERE death = "26 october 1614" | SELECT "became_duchess" FROM "table_name_84" WHERE "26 october 1614" = "death" | 0.076172 |
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
| the last year what were the three most frequent diagnoses that were given to patients within the same month after the diagnosis of respiratory arrest? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'respiratory arrest' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.diagnosistime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.diagnosistime, 'start of month') GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "patient"."uniquepid", "diagnosis"."diagnosisname", "diagnosis"."diagnosistime" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), "t3" AS (SELECT "t2"."diagnosisname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."diagnosistime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."diagnosistime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'respiratory arrest' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "t2"."diagnosisname") SELECT "t3"."diagnosisname" FROM "t3" "t3" WHERE "t3"."c1" <= 3 | 0.972656 |
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
| For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the sum of code , and group by attribute name, and display by the y axis in asc. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code | SELECT "T1"."Name", "T1"."Code" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name" ORDER BY "T1"."Code" | 0.15332 |
CREATE TABLE table_13543 ("Class" CLOB, "Wheel arrangement" CLOB, "Fleet number ( s ) " CLOB, "Manufacturer" CLOB, "Year made" CLOB, "Quantity made" CLOB, "Quantity preserved" CLOB)
| What wheel arrangement has a fleet number(s) of 45 46? | SELECT "Wheel arrangement" FROM table_13543 WHERE "Fleet number(s)" = '45β46' | SELECT "Wheel arrangement" FROM "table_13543" WHERE "Fleet number(s)" = '45β46' | 0.077148 |
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
| For all employees who have the letters D or S in their first name, give me the comparison about the average of employee_id over the job_id , and group by attribute job_id by a bar chart, I want to order in asc by the y-axis. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | SELECT "JOB_ID", AVG("EMPLOYEE_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' GROUP BY "JOB_ID" ORDER BY AVG("EMPLOYEE_ID") | 0.151367 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| count the number of patients whose days of hospital stay is greater than 34 and procedure icd9 code is 3931? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "34" AND procedures.icd9_code = "3931" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3931" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "34" < "demographic"."days_stay" | 0.209961 |
CREATE TABLE table_name_71 (player VARCHAR2, place VARCHAR2)
| What is the Player in T5 Place? | SELECT player FROM table_name_71 WHERE place = "t5" | SELECT "player" FROM "table_name_71" WHERE "place" = "t5" | 0.055664 |
CREATE TABLE table_793 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" CLOB, "Result" CLOB, "Candidates" CLOB)
| What was the winning party when the incumbent was richard s. whaley? | SELECT "Party" FROM table_793 WHERE "Incumbent" = 'Richard S. Whaley' | SELECT "Party" FROM "table_793" WHERE "Incumbent" = 'Richard S. Whaley' | 0.069336 |
CREATE TABLE table_73316 ("School District" CLOB, "Headquarters" CLOB, "Sector" CLOB, "Enrollment ( 2011-12 ) " FLOAT, "Teachers ( 2008-09" FLOAT, "Student-Teacher ratio ( 2008-09 ) " CLOB, "French enrollment ( 2011-12 ) " CLOB, "Graduation rate ( 2011-12 ) " CLOB, "Withdrawal rate ( 2010-11 ) " CLOB)
| What is the graduation rate for the school district with headquarters located in Sydney? | SELECT "Graduation rate (2011-12)" FROM table_73316 WHERE "Headquarters" = 'Sydney' | SELECT "Graduation rate (2011-12)" FROM "table_73316" WHERE "Headquarters" = 'Sydney' | 0.083008 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| provide the number of patients whose primary disease is hypoxia and procedure short title is coronar arteriogr-1 cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPOXIA" AND procedures.short_title = "Coronar arteriogr-1 cath" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Coronar arteriogr-1 cath" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "HYPOXIA" = "demographic"."diagnosis" | 0.236328 |
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
| how many patients were diagnosed with post neurointerventional procedure - embolization within the same hospital visit in the last year after the first diagnosis with hypervolemia? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'post neurointerventional procedure - embolization' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypervolemia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid | WITH "t2" AS (SELECT "diagnosis"."diagnosistime", "patient"."patienthealthsystemstayid" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'hypervolemia' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."diagnosistime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" WHERE "diagnosis"."diagnosisname" = 'post neurointerventional procedure - embolization' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | 0.824219 |
CREATE TABLE table_42485 ("Rank" FLOAT, "Province" CLOB, "Population" FLOAT, "Area" FLOAT, "Density" FLOAT)
| WHat is the number of Population has a Density of 50.09 and a Rank larger than 30? | SELECT SUM("Population") FROM table_42485 WHERE "Density" = '50.09' AND "Rank" > '30' | SELECT SUM("Population") FROM "table_42485" WHERE "Density" = '50.09' AND "Rank" > '30' | 0.084961 |
CREATE TABLE table_54923 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Leading scorer" CLOB, "Attendance" FLOAT, "Record" CLOB)
| How many people attended the game on 8 March 2008? | SELECT SUM("Attendance") FROM table_54923 WHERE "Date" = '8 march 2008' | SELECT SUM("Attendance") FROM "table_54923" WHERE "Date" = '8 march 2008' | 0.071289 |
CREATE TABLE table_78364 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
| What's the average Grid for a Maserati with less than 80 laps, and a Time/Retired of +2 laps? | SELECT AVG("Grid") FROM table_78364 WHERE "Laps" < '80' AND "Constructor" = 'maserati' AND "Time/Retired" = '+2 laps' | SELECT AVG("Grid") FROM "table_78364" WHERE "Constructor" = 'maserati' AND "Laps" < '80' AND "Time/Retired" = '+2 laps' | 0.116211 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| provide the number of office admission patients who are diagnosed with unspecified obesity. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "Obesity NOS" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Obesity NOS" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "PHYS REFERRAL/NORMAL DELI" = "demographic"."admission_location" | 0.24707 |
CREATE TABLE table_name_98 (nationality VARCHAR2, time VARCHAR2)
| What Nationality's time is 2:07.64? | SELECT nationality FROM table_name_98 WHERE time = "2:07.64" | SELECT "nationality" FROM "table_name_98" WHERE "2:07.64" = "time" | 0.064453 |