schema
stringlengths 28
6.63k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE table_39048 ("Unit" VARCHAR(MAX), "Russian" VARCHAR(MAX), "Translation" VARCHAR(MAX), "Ratio" VARCHAR(MAX), "Cubic inches ( exact ) " VARCHAR(MAX), "Metric value" VARCHAR(MAX), "Imperial" VARCHAR(MAX), "US Customary" VARCHAR(MAX))
| What are the imperial size for the unit that has a ratio of 1/20? | SELECT "Imperial" FROM table_39048 WHERE "Ratio" = '1/20' | SELECT "Imperial" FROM "table_39048" WHERE "Ratio" = '1/20' | 0.057617 |
CREATE TABLE table_18428 ("District" VARCHAR(MAX), "Incumbent" VARCHAR(MAX), "Party" VARCHAR(MAX), "First elected" REAL, "Result" VARCHAR(MAX), "Candidates" VARCHAR(MAX))
| what is the political affiliation of ray roberts | SELECT "Party" FROM table_18428 WHERE "Incumbent" = 'Ray Roberts' | SELECT "Party" FROM "table_18428" WHERE "Incumbent" = 'Ray Roberts' | 0.06543 |
CREATE TABLE table_72185 ("Week" VARCHAR(MAX), "Date" VARCHAR(MAX), "Opponent" VARCHAR(MAX), "Result" VARCHAR(MAX), "Kickoff [a ]" VARCHAR(MAX), "Game site" VARCHAR(MAX), "TV" VARCHAR(MAX), "Attendance" VARCHAR(MAX), "Record" VARCHAR(MAX))
| Give me the kickoff time of the game that was aired on CBS against the St. Louis Cardinals. | SELECT "Kickoff [a ]" FROM table_72185 WHERE "TV" = 'CBS' AND "Opponent" = 'St. Louis Cardinals' | SELECT "Kickoff [a ]" FROM "table_72185" WHERE "Opponent" = 'St. Louis Cardinals' AND "TV" = 'CBS' | 0.095703 |
CREATE TABLE table_name_97 (opponent VARCHAR, game_site VARCHAR)
| What was the Opponent at Arrowhead Stadium? | SELECT opponent FROM table_name_97 WHERE game_site = "arrowhead stadium" | SELECT "opponent" FROM "table_name_97" WHERE "arrowhead stadium" = "game_site" | 0.076172 |
CREATE TABLE table_46132 ("First Vice President" VARCHAR(MAX), "Second Vice President" VARCHAR(MAX), "Third Vice president" VARCHAR(MAX), "Inaugurated" VARCHAR(MAX), "Left Office" VARCHAR(MAX))
| What is Third Vice President, when Second Vice President is 'Baudelio Palma'? | SELECT "Third Vice president" FROM table_46132 WHERE "Second Vice President" = 'baudelio palma' | SELECT "Third Vice president" FROM "table_46132" WHERE "Second Vice President" = 'baudelio palma' | 0.094727 |
CREATE TABLE table_45807 ("Pick" REAL, "Player" VARCHAR(MAX), "Nationality" VARCHAR(MAX), "New WNBA Team" VARCHAR(MAX), "Former WNBA Team" VARCHAR(MAX), "College/Country/Team" VARCHAR(MAX))
| What was the new WNBA team of the player selected with a pick over 7? | SELECT "New WNBA Team" FROM table_45807 WHERE "Pick" > '7' | SELECT "New WNBA Team" FROM "table_45807" WHERE "Pick" > '7' | 0.058594 |
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname VARCHAR(MAX), labresult DECIMAL, labresulttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, eventtype VARCHAR(MAX), eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| what is the monthly maximum value of patient 005-9883's magnesium until 3 years ago? | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-9883')) AND lab.labname = 'magnesium' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('%y-%m', lab.labresulttime) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '005-9883' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT MAX("lab"."labresult") FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'magnesium' AND DATETIME("lab"."labresulttime") <= DATETIME(CURRENT_TIME(), '-3 year') AND NOT "_u_1"."" IS NULL GROUP BY STRFTIME('%y-%m', "lab"."labresulttime") | 0.636719 |
CREATE TABLE table_58509 ("Round" VARCHAR(MAX), "Date" VARCHAR(MAX), "Home Team" VARCHAR(MAX), "Score" VARCHAR(MAX), "Away Team" VARCHAR(MAX), "Crowd" REAL, "Stadium" VARCHAR(MAX), "Match Details" VARCHAR(MAX))
| Im the match where the home team is Melbourne Victory, what was the crowd attendance? | SELECT COUNT("Crowd") FROM table_58509 WHERE "Home Team" = 'melbourne victory' | SELECT COUNT("Crowd") FROM "table_58509" WHERE "Home Team" = 'melbourne victory' | 0.078125 |
CREATE TABLE member_attendance (Member_ID INTEGER, Performance_ID INTEGER, Num_of_Pieces INTEGER)
CREATE TABLE performance (Performance_ID REAL, Date VARCHAR(MAX), Host VARCHAR(MAX), Location VARCHAR(MAX), Attendance INTEGER)
CREATE TABLE member (Member_ID VARCHAR(MAX), Name VARCHAR(MAX), Nationality VARCHAR(MAX), Role VARCHAR(MAX))
| Bar chart of the total number from each location, and could you list from low to high by the Y? | SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY COUNT(*) | SELECT "Location", COUNT(*) FROM "performance" GROUP BY "Location" ORDER BY COUNT(*) NULLS FIRST | 0.09375 |
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INTEGER, propulsion VARCHAR, wide_body VARCHAR, wing_span INTEGER, length INTEGER, weight INTEGER, capacity INTEGER, pay_load INTEGER, cruising_speed INTEGER, range_miles INTEGER, pressurized VARCHAR)
CREATE TABLE flight_stop (flight_id INTEGER, stop_number INTEGER, stop_days VARCHAR(MAX), stop_airport VARCHAR(MAX), arrival_time INTEGER, arrival_airline VARCHAR(MAX), arrival_flight_number INTEGER, departure_time INTEGER, departure_airline VARCHAR(MAX), departure_flight_number INTEGER, stop_time INTEGER)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INTEGER, class_description VARCHAR(MAX))
CREATE TABLE month (month_number INTEGER, month_name VARCHAR(MAX))
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INTEGER, direction VARCHAR, minutes_distant INTEGER)
CREATE TABLE airline (airline_code VARCHAR, airline_name VARCHAR(MAX), note VARCHAR(MAX))
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE fare_basis (fare_basis_code VARCHAR(MAX), booking_class VARCHAR(MAX), class_type VARCHAR(MAX), premium VARCHAR(MAX), economy VARCHAR(MAX), discounted VARCHAR(MAX), night VARCHAR(MAX), season VARCHAR(MAX), basis_days VARCHAR(MAX))
CREATE TABLE ground_service (city_code VARCHAR(MAX), airport_code VARCHAR(MAX), transport_type VARCHAR(MAX), ground_fare INTEGER)
CREATE TABLE flight_fare (flight_id INTEGER, fare_id INTEGER)
CREATE TABLE fare (fare_id INTEGER, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code VARCHAR(MAX), fare_airline VARCHAR(MAX), restriction_code VARCHAR(MAX), one_direction_cost INTEGER, round_trip_cost INTEGER, round_trip_required VARCHAR)
CREATE TABLE state (state_code VARCHAR(MAX), state_name VARCHAR(MAX), country_name VARCHAR(MAX))
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE flight (aircraft_code_sequence VARCHAR(MAX), airline_code VARCHAR, airline_flight VARCHAR(MAX), arrival_time INTEGER, connections INTEGER, departure_time INTEGER, dual_carrier VARCHAR(MAX), flight_days VARCHAR(MAX), flight_id INTEGER, flight_number INTEGER, from_airport VARCHAR, meal_code VARCHAR(MAX), stops INTEGER, time_elapsed INTEGER, to_airport VARCHAR)
CREATE TABLE flight_leg (flight_id INTEGER, leg_number INTEGER, leg_flight INTEGER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE code_description (code VARCHAR, description VARCHAR(MAX))
CREATE TABLE airport (airport_code VARCHAR, airport_name VARCHAR(MAX), airport_location VARCHAR(MAX), state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INTEGER)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INTEGER, high_flight_number INTEGER, dual_airline VARCHAR, service_name VARCHAR(MAX))
CREATE TABLE time_interval (period VARCHAR(MAX), begin_time INTEGER, end_time INTEGER)
CREATE TABLE food_service (meal_code VARCHAR(MAX), meal_number INTEGER, compartment VARCHAR(MAX), meal_description VARCHAR)
CREATE TABLE date_day (month_number INTEGER, day_number INTEGER, year INTEGER, day_name VARCHAR)
CREATE TABLE time_zone (time_zone_code VARCHAR(MAX), time_zone_name VARCHAR(MAX), hours_from_gmt INTEGER)
CREATE TABLE restriction (restriction_code VARCHAR(MAX), advance_purchase INTEGER, stopovers VARCHAR(MAX), saturday_stay_required VARCHAR(MAX), minimum_stay INTEGER, maximum_stay INTEGER, application VARCHAR(MAX), no_discounts VARCHAR(MAX))
| list the cheapest fare from CHARLOTTE to LAS VEGAS | SELECT DISTINCT fare_id FROM fare WHERE (fare_id IN (SELECT FLIGHT_FAREalias1.fare_id FROM flight_fare AS FLIGHT_FAREalias1 WHERE FLIGHT_FAREalias1.flight_id IN (SELECT FLIGHTalias1.flight_id FROM flight AS FLIGHTalias1 WHERE (FLIGHTalias1.from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'CHARLOTTE')) AND FLIGHTalias1.to_airport IN (SELECT AIRPORT_SERVICEalias3.airport_code FROM airport_service AS AIRPORT_SERVICEalias3 WHERE AIRPORT_SERVICEalias3.city_code IN (SELECT CITYalias3.city_code FROM city AS CITYalias3 WHERE CITYalias3.city_name = 'LAS VEGAS'))))) AND one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM fare AS FAREalias1 WHERE FAREalias1.fare_id IN (SELECT FLIGHT_FARE_ID FROM flight_fare AS FLIGHT_FARE WHERE FLIGHT_FLIGHT_ID IN (SELECT FLIGHTalias0.flight_id FROM flight AS FLIGHTalias0 WHERE (FLIGHTalias0.from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'CHARLOTTE')) AND FLIGHTalias0.to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'LAS VEGAS'))))))) | WITH "_u_6" AS (SELECT "CITYalias0"."city_code" FROM "city" AS "CITYalias0" WHERE "CITYalias0"."city_name" = 'CHARLOTTE' GROUP BY "city_code"), "_u_7" AS (SELECT "AIRPORT_SERVICEalias0"."airport_code" FROM "airport_service" AS "AIRPORT_SERVICEalias0" LEFT JOIN "_u_6" AS "_u_6" ON "AIRPORT_SERVICEalias0"."city_code" = "_u_6"."" WHERE NOT "_u_6"."" IS NULL GROUP BY "airport_code"), "_u_8" AS (SELECT "CITYalias1"."city_code" FROM "city" AS "CITYalias1" WHERE "CITYalias1"."city_name" = 'LAS VEGAS' GROUP BY "city_code"), "_u_9" AS (SELECT "AIRPORT_SERVICEalias1"."airport_code" FROM "airport_service" AS "AIRPORT_SERVICEalias1" LEFT JOIN "_u_8" AS "_u_8" ON "AIRPORT_SERVICEalias1"."city_code" = "_u_8"."" WHERE NOT "_u_8"."" IS NULL GROUP BY "airport_code"), "_u_10" AS (SELECT "FLIGHTalias0"."flight_id" FROM "flight" AS "FLIGHTalias0" LEFT JOIN "_u_7" AS "_u_7" ON "FLIGHTalias0"."from_airport" = "_u_7"."" LEFT JOIN "_u_9" AS "_u_9" ON "FLIGHTalias0"."to_airport" = "_u_9"."" WHERE NOT "_u_7"."" IS NULL AND NOT "_u_9"."" IS NULL GROUP BY "flight_id"), "_u_0" AS (SELECT "CITYalias2"."city_code" FROM "city" AS "CITYalias2" WHERE "CITYalias2"."city_name" = 'CHARLOTTE' GROUP BY "city_code"), "_u_1" AS (SELECT "AIRPORT_SERVICEalias2"."airport_code" FROM "airport_service" AS "AIRPORT_SERVICEalias2" LEFT JOIN "_u_0" AS "_u_0" ON "AIRPORT_SERVICEalias2"."city_code" = "_u_0"."" WHERE NOT "_u_0"."" IS NULL GROUP BY "airport_code"), "_u_2" AS (SELECT "CITYalias3"."city_code" FROM "city" AS "CITYalias3" WHERE "CITYalias3"."city_name" = 'LAS VEGAS' GROUP BY "city_code"), "_u_3" AS (SELECT "AIRPORT_SERVICEalias3"."airport_code" FROM "airport_service" AS "AIRPORT_SERVICEalias3" LEFT JOIN "_u_2" AS "_u_2" ON "AIRPORT_SERVICEalias3"."city_code" = "_u_2"."" WHERE NOT "_u_2"."" IS NULL GROUP BY "airport_code"), "_u_4" AS (SELECT "FLIGHTalias1"."flight_id" FROM "flight" AS "FLIGHTalias1" LEFT JOIN "_u_1" AS "_u_1" ON "FLIGHTalias1"."from_airport" = "_u_1"."" LEFT JOIN "_u_3" AS "_u_3" ON "FLIGHTalias1"."to_airport" = "_u_3"."" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_3"."" IS NULL GROUP BY "flight_id"), "_u_5" AS (SELECT "FLIGHT_FAREalias1"."fare_id" FROM "flight_fare" AS "FLIGHT_FAREalias1" LEFT JOIN "_u_4" AS "_u_4" ON "FLIGHT_FAREalias1"."flight_id" = "_u_4"."" WHERE NOT "_u_4"."" IS NULL GROUP BY "fare_id") SELECT DISTINCT "fare_id" FROM "fare" LEFT JOIN "_u_5" AS "_u_5" ON "_u_5"."" = "fare_id" WHERE "one_direction_cost" = (SELECT MIN("FAREalias1"."one_direction_cost") FROM "fare" AS "FAREalias1" WHERE "FAREalias1"."fare_id" IN (SELECT "FLIGHT_FARE_ID" FROM "flight_fare" AS "FLIGHT_FARE" LEFT JOIN "_u_10" AS "_u_10" ON "FLIGHT_FLIGHT_ID" = "_u_10"."" WHERE NOT "_u_10"."" IS NULL)) AND NOT "_u_5"."" IS NULL | 2.665039 |
CREATE TABLE table_72016 ("Wicket" VARCHAR(MAX), "Runs" VARCHAR(MAX), "Partnerships" VARCHAR(MAX), "Venue" VARCHAR(MAX), "Date" VARCHAR(MAX))
| What venue did the parntership of shoaib malik / misbah-ul-haq occur? | SELECT "Venue" FROM table_72016 WHERE "Partnerships" = 'shoaib malik / misbah-ul-haq' | SELECT "Venue" FROM "table_72016" WHERE "Partnerships" = 'shoaib malik / misbah-ul-haq' | 0.084961 |
CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR, transaction_type_description VARCHAR)
CREATE TABLE Investors (investor_id INTEGER, Investor_details VARCHAR)
CREATE TABLE Lots (lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR)
CREATE TABLE Sales (sales_transaction_id INTEGER, sales_details VARCHAR)
CREATE TABLE Transactions (transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR, date_of_transaction TIMESTAMP, amount_of_transaction DECIMAL, share_count VARCHAR, other_details VARCHAR)
CREATE TABLE Transactions_Lots (transaction_id INTEGER, lot_id INTEGER)
CREATE TABLE Purchases (purchase_transaction_id INTEGER, purchase_details VARCHAR)
| Show me a bar chart that bin all date of transactions into the weekday interval and the y-axis is their total number, and show y-axis in ascending order. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY COUNT(date_of_transaction) | SELECT "date_of_transaction", COUNT("date_of_transaction") FROM "Transactions" ORDER BY COUNT("date_of_transaction") NULLS FIRST | 0.125 |
CREATE TABLE table_name_34 (rank INTEGER, athlete VARCHAR)
| what is the highest rank for tim maeyens? | SELECT MAX(rank) FROM table_name_34 WHERE athlete = "tim maeyens" | SELECT MAX("rank") FROM "table_name_34" WHERE "athlete" = "tim maeyens" | 0.069336 |
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
| For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and department_id , order y-axis from low to high order. | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID | SELECT "PHONE_NUMBER", "DEPARTMENT_ID" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "DEPARTMENT_ID" NULLS FIRST | 0.209961 |
CREATE TABLE table_971 ("Quarter" VARCHAR(MAX), "Android" VARCHAR(MAX), "iOS" VARCHAR(MAX), "Symbian" VARCHAR(MAX), "BlackBerry OS" VARCHAR(MAX), "Linux" VARCHAR(MAX), "Windows Phone" VARCHAR(MAX), "Other" VARCHAR(MAX), "Total" VARCHAR(MAX))
| During the quarter of 2012 Q2, how many millions of Blackberry OS phones where shipped when 0.1 million others were shipped? | SELECT COUNT("BlackBerry OS") FROM table_971 WHERE "Other" = '0.1' AND "Quarter" = '2012 Q2' | SELECT COUNT("BlackBerry OS") FROM "table_971" WHERE "Other" = '0.1' AND "Quarter" = '2012 Q2' | 0.091797 |
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname VARCHAR(MAX), labresult DECIMAL, labresulttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, eventtype VARCHAR(MAX), eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
| what percentile is the bedside glucose of 229.0 for patients of the same age as patient 002-59265 on their first hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'bedside glucose' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '002-59265' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1))) AS t1 WHERE t1.labresult = 229.0 | WITH "_u_0" AS (SELECT "patient"."age" FROM "patient" WHERE "patient"."uniquepid" = '002-59265' AND NOT "patient"."hospitaldischargetime" IS NULL ORDER BY "patient"."hospitaladmittime" NULLS FIRST LIMIT 1) SELECT DISTINCT PERCENT_RANK() OVER (ORDER BY "lab"."labresult" NULLS FIRST) FROM "lab" WHERE "lab"."labname" = 'bedside glucose' AND "lab"."labresult" = 229.0 AND "lab"."patientunitstayid" IN (SELECT "patient"."patientunitstayid" FROM "patient" JOIN "_u_0" AS "_u_0" ON "_u_0"."age" = "patient"."age") | 0.496094 |
CREATE TABLE people (People_ID INTEGER, Name VARCHAR(MAX), Height REAL, Weight REAL, Date_of_Birth VARCHAR(MAX))
CREATE TABLE entrepreneur (Entrepreneur_ID INTEGER, People_ID INTEGER, Company VARCHAR(MAX), Money_Requested REAL, Investor VARCHAR(MAX))
| What are the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones', and count them by a line chart | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" | SELECT "Date_of_Birth", COUNT("Date_of_Birth") FROM "entrepreneur" AS "T1" JOIN "people" AS "T2" ON "T1"."people_id" = "T2"."people_id" WHERE "Peter Jones" = "T1"."investor" OR "Simon Woodroffe" = "T1"."investor" | 0.207031 |
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId DECIMAL)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName VARCHAR(MAX), Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment VARCHAR(MAX))
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name VARCHAR(MAX), Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId DECIMAL, ContentLicense VARCHAR(MAX))
CREATE TABLE VoteTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE FlagTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
| Top users by average score in a given tag. | SELECT a.OwnerUserId AS "user_link", a.OwnerDisplayName, AVG(CAST(a.Score AS FLOAT)) AS "average_score", SUM(a.Score) AS "total_score", COUNT(a.Id) AS "num_answers" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.PostTypeId = 2 AND q.Tags LIKE '%<##tagName##>%' GROUP BY a.OwnerUserId, a.OwnerDisplayName HAVING COUNT(a.Score) >= '##min?5##' ORDER BY AVG(a.Score) DESC LIMIT 100 | SELECT "a"."owneruserid" AS "user_link", "a"."ownerdisplayname", AVG(CAST("a"."score" AS REAL)) AS "average_score", SUM("a"."score") AS "total_score", COUNT("a"."id") AS "num_answers" FROM "Posts" AS "a" JOIN "Posts" AS "q" ON "a"."parentid" = "q"."id" AND "q"."tags" LIKE '%<##tagName##>%' WHERE "a"."posttypeid" = 2 GROUP BY "a"."owneruserid", "a"."ownerdisplayname" HAVING COUNT("a"."score") >= '##min?5##' ORDER BY AVG("a"."score") DESC NULLS LAST LIMIT 100 | 0.450195 |
CREATE TABLE table_35974 ("Date" VARCHAR(MAX), "Opponent" VARCHAR(MAX), "Score" VARCHAR(MAX), "Loss" VARCHAR(MAX), "Attendance" REAL, "Record" VARCHAR(MAX))
| Record of 16 29 is how many attendance? | SELECT "Attendance" FROM table_35974 WHERE "Record" = '16–29' | SELECT "Attendance" FROM "table_35974" WHERE "Record" = '16–29' | 0.061523 |
CREATE TABLE table_16409745_1 (interface VARCHAR, pages_per_minute__color_ VARCHAR)
| What interface is used on the scanner that has a 36 pages per minute? | SELECT interface FROM table_16409745_1 WHERE pages_per_minute__color_ = 36 | SELECT "interface" FROM "table_16409745_1" WHERE "pages_per_minute__color_" = 36 | 0.078125 |
CREATE TABLE table_name_34 (stage VARCHAR, venue VARCHAR)
| Which stage was being played in Romania? | SELECT stage FROM table_name_34 WHERE venue = "romania" | SELECT "stage" FROM "table_name_34" WHERE "romania" = "venue" | 0.05957 |
CREATE TABLE table_203_735 (id DECIMAL, "rd" DECIMAL, "pick" DECIMAL, "player" VARCHAR(MAX), "position" VARCHAR(MAX), "school" VARCHAR(MAX))
| highest rd number ? | SELECT MAX("rd") FROM table_203_735 | SELECT MAX("rd") FROM "table_203_735" | 0.036133 |
CREATE TABLE table_203_90 (id DECIMAL, "religious\ group" VARCHAR(MAX), "population\ %" VARCHAR(MAX), "growth\ ( 1991-2001 ) " VARCHAR(MAX), "sex ratio\ ( total ) " DECIMAL, "literacy\ ( % ) " VARCHAR(MAX), "work participation\ ( % ) " VARCHAR(MAX), "sex ratio\ ( rural ) " DECIMAL, "sex ratio\ ( urban ) " DECIMAL, "sex ratio\ ( child ) " DECIMAL)
| the number of religious groups with a sex ratio of more than 1000 is how many ? | SELECT COUNT("religious\ngroup") FROM table_203_90 WHERE "sex ratio\n(total)" > 1000 | SELECT COUNT("religious\ngroup") FROM "table_203_90" WHERE "sex ratio\n(total)" > 1000 | 0.083984 |
CREATE TABLE table_name_23 (games INTEGER, points VARCHAR, goals_for VARCHAR)
| What are the most games when the points are 100 and goals for less than 356? | SELECT MAX(games) FROM table_name_23 WHERE points = 100 AND goals_for < 356 | SELECT MAX("games") FROM "table_name_23" WHERE "goals_for" < 356 AND "points" = 100 | 0.081055 |
CREATE TABLE table_34378 ("Place" REAL, "Nation" VARCHAR(MAX), "6 Ropes" REAL, "4 Hoops , 2 Clubs" REAL, "Total" REAL)
| What is the total of the nation with 19.025 4 hoops, 2 clubs? | SELECT "Total" FROM table_34378 WHERE "4 Hoops, 2 Clubs" = '19.025' | SELECT "Total" FROM "table_34378" WHERE "4 Hoops, 2 Clubs" = '19.025' | 0.067383 |
CREATE TABLE table_45099 ("Date" VARCHAR(MAX), "Tournament" VARCHAR(MAX), "Winning score" VARCHAR(MAX), "Margin of victory" VARCHAR(MAX), "Runner ( s ) -up" VARCHAR(MAX))
| What is the Margin of Victory, when Tournament is Mercedes Championships (3)? | SELECT "Margin of victory" FROM table_45099 WHERE "Tournament" = 'mercedes championships (3)' | SELECT "Margin of victory" FROM "table_45099" WHERE "Tournament" = 'mercedes championships (3)' | 0.092773 |
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc VARCHAR(MAX), org_name VARCHAR(MAX))
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom VARCHAR(MAX))
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender VARCHAR(MAX), dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label VARCHAR(MAX))
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit VARCHAR(MAX), last_careunit VARCHAR(MAX), first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label VARCHAR(MAX), linksto VARCHAR(MAX))
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug VARCHAR(MAX), dose_val_rx VARCHAR(MAX), dose_unit_rx VARCHAR(MAX), route VARCHAR(MAX))
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom VARCHAR(MAX))
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type VARCHAR(MAX), event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), insurance VARCHAR(MAX), language VARCHAR(MAX), marital_status VARCHAR(MAX), ethnicity VARCHAR(MAX), age DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype VARCHAR(MAX), careunit VARCHAR(MAX), wardid DECIMAL, intime TIME, outtime TIME)
| indicate the daily average sao2 of patient 4401 since 05/2102. | SELECT AVG(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 = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m', chartevents.charttime) >= '2102-05' GROUP BY STRFTIME('%y-%m-%d', chartevents.charttime) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 4401 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'sao2' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT AVG("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m', "chartevents"."charttime") >= '2102-05' GROUP BY STRFTIME('%y-%m-%d', "chartevents"."charttime") | 0.78418 |
CREATE TABLE student (stuid DECIMAL, lname VARCHAR(MAX), fname VARCHAR(MAX), age DECIMAL, sex VARCHAR(MAX), major DECIMAL, advisor DECIMAL, city_code VARCHAR(MAX))
CREATE TABLE has_amenity (dormid DECIMAL, amenid DECIMAL)
CREATE TABLE dorm_amenity (amenid DECIMAL, amenity_name VARCHAR(MAX))
CREATE TABLE lives_in (stuid DECIMAL, dormid DECIMAL, room_number DECIMAL)
CREATE TABLE dorm (dormid DECIMAL, dorm_name VARCHAR(MAX), student_capacity DECIMAL, gender VARCHAR(MAX))
| What is the first and last name of all students who are younger than average? | SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student) | SELECT "fname", "lname" FROM "student" WHERE "age" < (SELECT AVG("age") FROM "student") | 0.084961 |
CREATE TABLE table_name_17 (bike VARCHAR, grid VARCHAR, rider VARCHAR)
| What is the Bike with a grid more than 4 and the rider is Michel Fabrizio? | SELECT bike FROM table_name_17 WHERE grid > 4 AND rider = "michel fabrizio" | SELECT "bike" FROM "table_name_17" WHERE "grid" > 4 AND "michel fabrizio" = "rider" | 0.081055 |
CREATE TABLE table_60241 ("Player" VARCHAR(MAX), "Country" VARCHAR(MAX), "Year ( s ) won" VARCHAR(MAX), "Total" REAL, "To par" REAL, "Finish" VARCHAR(MAX))
| What is the total number for Seve Ballesteros? | SELECT COUNT("Total") FROM table_60241 WHERE "Player" = 'seve ballesteros' | SELECT COUNT("Total") FROM "table_60241" WHERE "Player" = 'seve ballesteros' | 0.074219 |
CREATE TABLE table_name_83 (tournament VARCHAR, date VARCHAR, location VARCHAR)
| What tournament located is mississippi was nov 5 | SELECT tournament FROM table_name_83 WHERE date = "nov 5" AND location = "mississippi" | SELECT "tournament" FROM "table_name_83" WHERE "date" = "nov 5" AND "location" = "mississippi" | 0.091797 |
CREATE TABLE table_8040 ("Year started" REAL, "Number of cars" REAL, "Current car" VARCHAR(MAX), "Car #" REAL, "Website" VARCHAR(MAX))
| WHAT WAS THE LOWEST CAR # WITH SON-E-WA, AND 2012 START YEAR? | SELECT MIN("Car #") FROM table_8040 WHERE "Current car" = 'son-e-wa' AND "Year started" < '2012' | SELECT MIN("Car #") FROM "table_8040" WHERE "Current car" = 'son-e-wa' AND "Year started" < '2012' | 0.095703 |
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type VARCHAR(MAX), event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc VARCHAR(MAX), org_name VARCHAR(MAX))
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom VARCHAR(MAX))
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype VARCHAR(MAX), careunit VARCHAR(MAX), wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label VARCHAR(MAX))
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit VARCHAR(MAX), last_careunit VARCHAR(MAX), first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug VARCHAR(MAX), dose_val_rx VARCHAR(MAX), dose_unit_rx VARCHAR(MAX), route VARCHAR(MAX))
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), insurance VARCHAR(MAX), language VARCHAR(MAX), marital_status VARCHAR(MAX), ethnicity VARCHAR(MAX), age DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender VARCHAR(MAX), dob TIME, dod TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label VARCHAR(MAX), linksto VARCHAR(MAX))
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom VARCHAR(MAX))
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code VARCHAR(MAX), charttime TIME)
| had patient 8098 have a respiratory rate less than 24.0 until 02/09/2104? | SELECT COUNT(*) > 0 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 = 8098)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate' AND d_items.linksto = 'chartevents') AND chartevents.valuenum < 24.0 AND STRFTIME('%y-%m-%d', chartevents.charttime) <= '2104-02-09' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 8098 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'respiratory rate' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE "chartevents"."valuenum" < 24.0 AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "chartevents"."charttime") <= '2104-02-09' | 0.764648 |
CREATE TABLE record (ID INTEGER, Result VARCHAR(MAX), Swimmer_ID INTEGER, Event_ID INTEGER)
CREATE TABLE event (ID INTEGER, Name VARCHAR(MAX), Stadium_ID INTEGER, Year VARCHAR(MAX))
CREATE TABLE stadium (ID INTEGER, name VARCHAR(MAX), Capacity INTEGER, City VARCHAR(MAX), Country VARCHAR(MAX), Opening_year INTEGER)
CREATE TABLE swimmer (ID INTEGER, name VARCHAR(MAX), Nationality VARCHAR(MAX), meter_100 REAL, meter_200 VARCHAR(MAX), meter_300 VARCHAR(MAX), meter_400 VARCHAR(MAX), meter_500 VARCHAR(MAX), meter_600 VARCHAR(MAX), meter_700 VARCHAR(MAX), Time VARCHAR(MAX))
| Visualize a bar chart about the distribution of meter_600 and meter_100 , show y-axis in ascending order. | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 | SELECT "meter_600", "meter_100" FROM "swimmer" ORDER BY "meter_100" NULLS FIRST | 0.077148 |
CREATE TABLE keyphrase (keyphraseid INTEGER, keyphrasename VARCHAR)
CREATE TABLE paperkeyphrase (paperid INTEGER, keyphraseid INTEGER)
CREATE TABLE dataset (datasetid INTEGER, datasetname VARCHAR)
CREATE TABLE field (fieldid INTEGER)
CREATE TABLE paperdataset (paperid INTEGER, datasetid INTEGER)
CREATE TABLE paperfield (fieldid INTEGER, paperid INTEGER)
CREATE TABLE cite (citingpaperid INTEGER, citedpaperid INTEGER)
CREATE TABLE writes (paperid INTEGER, authorid INTEGER)
CREATE TABLE author (authorid INTEGER, authorname VARCHAR)
CREATE TABLE paper (paperid INTEGER, title VARCHAR, venueid INTEGER, year INTEGER, numciting INTEGER, numcitedby INTEGER, journalid INTEGER)
CREATE TABLE journal (journalid INTEGER, journalname VARCHAR)
CREATE TABLE venue (venueid INTEGER, venuename VARCHAR)
| Which papers are about about Deep Learning ? | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Deep Learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | SELECT DISTINCT "paper"."paperid" FROM "keyphrase" JOIN "paperkeyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" JOIN "paper" ON "paper"."paperid" = "paperkeyphrase"."paperid" WHERE "keyphrase"."keyphrasename" = 'Deep Learning' | 0.243164 |
CREATE TABLE table_74355 ("Series #" REAL, "Season #" REAL, "Title" VARCHAR(MAX), "Directed by" VARCHAR(MAX), "Written by" VARCHAR(MAX), "Original air date" VARCHAR(MAX), "Prod. code" REAL, "U.S. viewers ( millions ) " VARCHAR(MAX))
| What is the title of the episode directed by Rich Correll and written by Dennis Rinsler? | SELECT "Title" FROM table_74355 WHERE "Directed by" = 'Rich Correll' AND "Written by" = 'Dennis Rinsler' | SELECT "Title" FROM "table_74355" WHERE "Directed by" = 'Rich Correll' AND "Written by" = 'Dennis Rinsler' | 0.103516 |
CREATE TABLE table_38247 ("Games" REAL, "Drawn" REAL, "Lost" REAL, "Points difference" VARCHAR(MAX), "Points" REAL)
| Which Games have a Drawn smaller than 1, and a Lost smaller than 1? | SELECT "Games" FROM table_38247 WHERE "Drawn" < '1' AND "Lost" < '1' | SELECT "Games" FROM "table_38247" WHERE "Drawn" < '1' AND "Lost" < '1' | 0.068359 |
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
| give me the number of patients with hypoxia primary disease who had inpatient hospital admission. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "HYPOXIA" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "HYPOXIA" = "demographic"."diagnosis" AND "TRANSFER FROM HOSP/EXTRAM" = "demographic"."admission_location" | 0.176758 |
CREATE TABLE Reviewer (rID INTEGER, name VARCHAR(MAX))
CREATE TABLE Rating (rID INTEGER, mID INTEGER, stars INTEGER, ratingDate DATE)
CREATE TABLE Movie (mID INTEGER, title VARCHAR(MAX), year INTEGER, director VARCHAR(MAX))
| Find the average rating star for each movie that received at least 2 ratings. | SELECT mID, AVG(stars) FROM Rating GROUP BY mID | SELECT "mID", AVG("stars") FROM "Rating" GROUP BY "mID" | 0.053711 |
CREATE TABLE table_71939 ("Rank" REAL, "Lane" REAL, "Name" VARCHAR(MAX), "Nationality" VARCHAR(MAX), "Time" REAL)
| What is the highest Lane number of a person with a time of 55.94 with a Rank that's bigger than 8? | SELECT MAX("Lane") FROM table_71939 WHERE "Time" > '55.94' AND "Rank" > '8' | SELECT MAX("Lane") FROM "table_71939" WHERE "Rank" > '8' AND "Time" > '55.94' | 0.075195 |
CREATE TABLE table_name_94 (draws INTEGER, goal_difference VARCHAR, losses VARCHAR)
| For a goal difference greater than 3 and fewer than 8 losses, what is the most draws scored? | SELECT MAX(draws) FROM table_name_94 WHERE goal_difference > 3 AND losses < 8 | SELECT MAX("draws") FROM "table_name_94" WHERE "goal_difference" > 3 AND "losses" < 8 | 0.083008 |
CREATE TABLE table_35109 ("Callsign" VARCHAR(MAX), "Area served" VARCHAR(MAX), "Frequency" VARCHAR(MAX), "Band" VARCHAR(MAX), "Freq currently" VARCHAR(MAX), "Purpose" VARCHAR(MAX))
| Which freq currently has 0 657? | SELECT "Freq currently" FROM table_35109 WHERE "Frequency" = '0 657' | SELECT "Freq currently" FROM "table_35109" WHERE "Frequency" = '0 657' | 0.068359 |
CREATE TABLE table_12962773_12 (current_club VARCHAR, year_born VARCHAR)
| What current club does the player born in 1984 play for? | SELECT current_club FROM table_12962773_12 WHERE year_born = 1984 | SELECT "current_club" FROM "table_12962773_12" WHERE "year_born" = 1984 | 0.069336 |
CREATE TABLE APPELLATIONS (County VARCHAR)
| How many appelations are in Napa Country? | SELECT COUNT(*) FROM APPELLATIONS WHERE County = "Napa" | SELECT COUNT(*) FROM "APPELLATIONS" WHERE "County" = "Napa" | 0.057617 |
CREATE TABLE management (department_ID INTEGER, head_ID INTEGER, temporary_acting VARCHAR(MAX))
CREATE TABLE department (Department_ID INTEGER, Name VARCHAR(MAX), Creation VARCHAR(MAX), Ranking INTEGER, Budget_in_Billions REAL, Num_Employees REAL)
CREATE TABLE head (head_ID INTEGER, name VARCHAR(MAX), born_state VARCHAR(MAX), age REAL)
| Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' with a bar chart, show from low to high by the X. | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name | SELECT "Name", SUM("Num_Employees") FROM "department" AS "T1" JOIN "management" AS "T2" ON "T1"."department_id" = "T2"."department_id" AND "T2"."temporary_acting" = 'Yes' GROUP BY "Name" ORDER BY "Name" NULLS FIRST | 0.208984 |
CREATE TABLE table_29087004_3 (series__number VARCHAR, written_by VARCHAR)
| Which episode/s were written by Evan Gore? | SELECT series__number FROM table_29087004_3 WHERE written_by = "Evan Gore" | SELECT "series__number" FROM "table_29087004_3" WHERE "Evan Gore" = "written_by" | 0.078125 |
CREATE TABLE table_204_340 (id DECIMAL, "name" VARCHAR(MAX), "year inducted" DECIMAL, "position" VARCHAR(MAX), "apps" DECIMAL, "goals" DECIMAL)
| who had more goals , ross jenkins or nigel gibbs ? | SELECT "name" FROM table_204_340 WHERE "name" IN ('ross jenkins', 'nigel gibbs') ORDER BY "goals" DESC LIMIT 1 | SELECT "name" FROM "table_204_340" WHERE "name" IN ('ross jenkins', 'nigel gibbs') ORDER BY "goals" DESC NULLS LAST LIMIT 1 | 0.120117 |
CREATE TABLE table_32443 ("Home team" VARCHAR(MAX), "Home team score" VARCHAR(MAX), "Away team" VARCHAR(MAX), "Away team score" VARCHAR(MAX), "Venue" VARCHAR(MAX), "Crowd" REAL, "Date" VARCHAR(MAX))
| What is the total of the crowd when the away team score is 4.8 (32)? | SELECT SUM("Crowd") FROM table_32443 WHERE "Away team score" = '4.8 (32)' | SELECT SUM("Crowd") FROM "table_32443" WHERE "Away team score" = '4.8 (32)' | 0.073242 |
CREATE TABLE table_10018 ("Rank" VARCHAR(MAX), "Team" VARCHAR(MAX), "Athletes" VARCHAR(MAX), "Run 1" VARCHAR(MAX), "Run 2" VARCHAR(MAX), "Run 3" VARCHAR(MAX), "Run 4" VARCHAR(MAX), "Final" VARCHAR(MAX))
| What is Run 1, when Team is 'Italy (ITA) Italy I'? | SELECT "Run 1" FROM table_10018 WHERE "Team" = 'italy (ita) italy i' | SELECT "Run 1" FROM "table_10018" WHERE "Team" = 'italy (ita) italy i' | 0.068359 |
CREATE TABLE table_name_5 (Id VARCHAR)
| What is the 2013 with virgin in 2009? | SELECT 2013 FROM table_name_5 WHERE 2009 = "virgin" | SELECT 2013 FROM "table_name_5" WHERE "virgin" = 2009 | 0.051758 |
CREATE TABLE table_18974269_1 (original_season VARCHAR, player VARCHAR)
| What was the season where Evelyn Smith was on? | SELECT original_season FROM table_18974269_1 WHERE player = "Evelyn Smith" | SELECT "original_season" FROM "table_18974269_1" WHERE "Evelyn Smith" = "player" | 0.078125 |
CREATE TABLE table_4634 ("Date" VARCHAR(MAX), "Pages" VARCHAR(MAX), "Hero" VARCHAR(MAX), "Story" VARCHAR(MAX), "Story code" VARCHAR(MAX))
| How many pages does the story from 1987-08 have? | SELECT "Pages" FROM table_4634 WHERE "Date" = '1987-08' | SELECT "Pages" FROM "table_4634" WHERE "Date" = '1987-08' | 0.055664 |
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name VARCHAR(MAX), Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment VARCHAR(MAX))
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName VARCHAR(MAX), Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId DECIMAL, ContentLicense VARCHAR(MAX))
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE PostTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
| Most viewed questions in a tag. Show top 2000 posts by ViewCount in a tag | SELECT * FROM PostTypes | SELECT * FROM "PostTypes" | 0.024414 |
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype VARCHAR(MAX), careunit VARCHAR(MAX), wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), insurance VARCHAR(MAX), language VARCHAR(MAX), marital_status VARCHAR(MAX), ethnicity VARCHAR(MAX), age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom VARCHAR(MAX))
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc VARCHAR(MAX), org_name VARCHAR(MAX))
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type VARCHAR(MAX), event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit VARCHAR(MAX), last_careunit VARCHAR(MAX), first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom VARCHAR(MAX))
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label VARCHAR(MAX), linksto VARCHAR(MAX))
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug VARCHAR(MAX), dose_val_rx VARCHAR(MAX), dose_unit_rx VARCHAR(MAX), route VARCHAR(MAX))
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender VARCHAR(MAX), dob TIME, dod TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label VARCHAR(MAX))
| what are the five most frequent output event during a year before? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5) | WITH "t1" AS (SELECT "outputevents"."itemid", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "outputevents" WHERE DATETIME("outputevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "outputevents"."itemid"), "_u_0" AS (SELECT "t1"."itemid" FROM "t1" AS "t1" WHERE "t1"."c1" <= 5 GROUP BY "itemid") SELECT "d_items"."label" FROM "d_items" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "d_items"."itemid" WHERE NOT "_u_0"."" IS NULL | 0.484375 |
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
| how many patients whose admission year is less than 2198 and drug name is gentamicin sulfate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2198" AND prescriptions.drug = "Gentamicin Sulfate" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Gentamicin Sulfate" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2198" > "demographic"."admityear" | 0.229492 |
CREATE TABLE table_22825058_23 (result VARCHAR, opponents VARCHAR)
| Name the result for ji nov k radek t p nek | SELECT result FROM table_22825058_23 WHERE opponents = "Jiřà Novák Radek Štěpánek" | SELECT "result" FROM "table_22825058_23" WHERE "Jiřà Novák Radek Štěpánek" = "opponents" | 0.085938 |
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE cost (costid DECIMAL, uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, eventtype VARCHAR(MAX), eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname VARCHAR(MAX), labresult DECIMAL, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| tell me the intake method for propofol 1000 mg/100 ml? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'propofol 1000 mg/100 ml' | SELECT DISTINCT "medication"."routeadmin" FROM "medication" WHERE "medication"."drugname" = 'propofol 1000 mg/100 ml' | 0.114258 |
CREATE TABLE table_2365150_1 (open_cup VARCHAR, league VARCHAR, playoffs VARCHAR)
| Name the open cup for usl pdl for did not qualify | SELECT open_cup FROM table_2365150_1 WHERE league = "USL PDL" AND playoffs = "Did not qualify" | SELECT "open_cup" FROM "table_2365150_1" WHERE "Did not qualify" = "playoffs" AND "USL PDL" = "league" | 0.099609 |
CREATE TABLE table_43906 ("Date" VARCHAR(MAX), "Home team" VARCHAR(MAX), "Score" VARCHAR(MAX), "Away team" VARCHAR(MAX), "Venue" VARCHAR(MAX), "Crowd" REAL, "Box Score" VARCHAR(MAX), "Report" VARCHAR(MAX))
| What was the score of the game where the venue was cairns convention centre? | SELECT "Score" FROM table_43906 WHERE "Venue" = 'cairns convention centre' | SELECT "Score" FROM "table_43906" WHERE "Venue" = 'cairns convention centre' | 0.074219 |
CREATE TABLE table_name_20 (tournament VARCHAR, date VARCHAR)
| Which tournament was held on July 13, 2008? | SELECT tournament FROM table_name_20 WHERE date = "july 13, 2008" | SELECT "tournament" FROM "table_name_20" WHERE "date" = "july 13, 2008" | 0.069336 |
CREATE TABLE table_name_8 (year VARCHAR, events_won_by_kclMS INTEGER)
| How many years were the events won by KCLMS less than 7? | SELECT COUNT(year) FROM table_name_8 WHERE events_won_by_kclMS < 7 | SELECT COUNT("year") FROM "table_name_8" WHERE "events_won_by_kclMS" < 7 | 0.070313 |
CREATE TABLE table_name_13 (year INTEGER, points INTEGER)
| What is the latest year with more than 0 points? | SELECT MAX(year) FROM table_name_13 WHERE points > 0 | SELECT MAX("year") FROM "table_name_13" WHERE "points" > 0 | 0.056641 |
CREATE TABLE table_23508196_2 (officers_o_s INTEGER, total_usaaf VARCHAR)
| How many officers o/s were there on the day when the number of USAAF was 2373882? | SELECT MAX(officers_o_s) FROM table_23508196_2 WHERE total_usaaf = 2373882 | SELECT MAX("officers_o_s") FROM "table_23508196_2" WHERE "total_usaaf" = 2373882 | 0.078125 |
CREATE TABLE table_59338 ("Res." VARCHAR(MAX), "Record" VARCHAR(MAX), "Opponent" VARCHAR(MAX), "Method" VARCHAR(MAX), "Event" VARCHAR(MAX), "Round" REAL, "Time" VARCHAR(MAX), "Location" VARCHAR(MAX))
| What was the location where the opponent was Jae Young Kim? | SELECT "Location" FROM table_59338 WHERE "Opponent" = 'jae young kim' | SELECT "Location" FROM "table_59338" WHERE "Opponent" = 'jae young kim' | 0.069336 |
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
| how many patients have drug code morp0.5-4? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "MORP0.5-4" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "MORP0.5-4" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.193359 |
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE Tags (Id DECIMAL, TagName VARCHAR(MAX), Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment VARCHAR(MAX))
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId DECIMAL, ContentLicense VARCHAR(MAX))
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name VARCHAR(MAX), Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE FlagTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress VARCHAR(MAX))
| Comments asking for a jurisdiction on a question. | SELECT Posts.Id AS "post_link", Comments.Text FROM Comments, Posts WHERE Text LIKE '%which%jurisdiction%' AND Comments.PostId = Posts.Id AND Posts.PostTypeId = 1 | SELECT "Posts"."id" AS "post_link", "Comments"."text" FROM "Comments" JOIN "Posts" ON "Comments"."postid" = "Posts"."id" AND "Posts"."posttypeid" = 1 WHERE "Text" LIKE '%which%jurisdiction%' | 0.185547 |
CREATE TABLE table_62746 ("Year" REAL, "Game" VARCHAR(MAX), "Genre" VARCHAR(MAX), "Platform ( s ) " VARCHAR(MAX), "Developer ( s ) " VARCHAR(MAX))
| What platform has a year of 2007? | SELECT "Platform(s)" FROM table_62746 WHERE "Year" = '2007' | SELECT "Platform(s)" FROM "table_62746" WHERE "Year" = '2007' | 0.05957 |
CREATE TABLE table_4038 ("Pick #" REAL, "Player" VARCHAR(MAX), "Position" VARCHAR(MAX), "Nationality" VARCHAR(MAX), "NHL team" VARCHAR(MAX), "College/junior/club team" VARCHAR(MAX))
| How many different college/junior/club teams had player John Dzikowski? | SELECT COUNT("College/junior/club team") FROM table_4038 WHERE "Player" = 'John Dzikowski' | SELECT COUNT("College/junior/club team") FROM "table_4038" WHERE "Player" = 'John Dzikowski' | 0.089844 |
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| what is days of hospital stay of subject name sheila riley? | SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Sheila Riley" | SELECT "demographic"."days_stay" FROM "demographic" WHERE "Sheila Riley" = "demographic"."name" | 0.092773 |
CREATE TABLE Products (Code INTEGER, Name VARCHAR, Price DECIMAL, Manufacturer INTEGER)
CREATE TABLE Manufacturers (Code INTEGER, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue REAL)
| For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter in a bar chart, and I want to display x axis in descending order please. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | SELECT "Headquarter", COUNT("Headquarter") FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."manufacturer" = "T2"."code" GROUP BY "Headquarter" ORDER BY "Headquarter" DESC NULLS LAST | 0.189453 |
CREATE TABLE table_name_71 (females___percentage_ INTEGER, males_rank VARCHAR, hiv_awareness__males_percentage_ VARCHAR, females_rank VARCHAR)
| Which Females (%) has an HIV awareness (males%) larger than 92, and Females Rank larger than 2, and Males Rank smaller than 3? | SELECT SUM(females___percentage_) FROM table_name_71 WHERE hiv_awareness__males_percentage_ > 92 AND females_rank > 2 AND males_rank < 3 | SELECT SUM("females___percentage_") FROM "table_name_71" WHERE "females_rank" > 2 AND "hiv_awareness__males_percentage_" > 92 AND "males_rank" < 3 | 0.142578 |
CREATE TABLE table_26341 ("Team #1" VARCHAR(MAX), "Points" VARCHAR(MAX), "Team #2" VARCHAR(MAX), "1st leg" VARCHAR(MAX), "2nd leg" VARCHAR(MAX))
| Name the 2nd leg for boca juniors | SELECT "2nd leg" FROM table_26341 WHERE "Team #1" = 'Boca Juniors' | SELECT "2nd leg" FROM "table_26341" WHERE "Team #1" = 'Boca Juniors' | 0.066406 |
CREATE TABLE table_name_34 (moving_to VARCHAR, name VARCHAR)
| Where did Konchesky move to? | SELECT moving_to FROM table_name_34 WHERE name = "konchesky" | SELECT "moving_to" FROM "table_name_34" WHERE "konchesky" = "name" | 0.064453 |
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId DECIMAL, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment VARCHAR(MAX))
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name VARCHAR(MAX), Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE VoteTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PostTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE FlagTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName VARCHAR(MAX), Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
| highly viewed or highly voted posts that were asked in 2011 and got closed. | SELECT COUNT(*) FROM Posts WHERE (Score >= 250 OR ViewCount >= 150000) AND NOT ClosedDate IS NULL AND CreationDate BETWEEN '2011-01-01' AND '2011-12-31' | SELECT COUNT(*) FROM "Posts" WHERE "CreationDate" <= '2011-12-31' AND "CreationDate" >= '2011-01-01' AND ("Score" >= 250 OR "ViewCount" >= 150000) AND NOT "ClosedDate" IS NULL | 0.170898 |
CREATE TABLE table_62120 ("Season" VARCHAR(MAX), "Competition" VARCHAR(MAX), "Round" VARCHAR(MAX), "Opponent" VARCHAR(MAX), "Home" VARCHAR(MAX), "Away" VARCHAR(MAX), "Aggregate" VARCHAR(MAX))
| What season has roma as the opponent? | SELECT "Season" FROM table_62120 WHERE "Opponent" = 'roma' | SELECT "Season" FROM "table_62120" WHERE "Opponent" = 'roma' | 0.058594 |
CREATE TABLE table_22069 ("Position" REAL, "Club" VARCHAR(MAX), "Games played" REAL, "Wins" REAL, "Draws" REAL, "Loses" REAL, "Goals scored" REAL, "Goals conceded" REAL, "Points" REAL)
| How many games had 22 points? | SELECT COUNT("Games played") FROM table_22069 WHERE "Points" = '22' | SELECT COUNT("Games played") FROM "table_22069" WHERE "Points" = '22' | 0.067383 |
CREATE TABLE table_26263954_1 (kana_spelling VARCHAR, english VARCHAR)
| how many kana spelling when english is mount fuji | SELECT kana_spelling FROM table_26263954_1 WHERE english = "Mount Fuji" | SELECT "kana_spelling" FROM "table_26263954_1" WHERE "Mount Fuji" = "english" | 0.075195 |
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| what is the number of patients whose gender is m and procedure icd9 code is 5110? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "5110" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "5110" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "M" = "demographic"."gender" | 0.206055 |
CREATE TABLE table_12426 ("Outcome" VARCHAR(MAX), "Date" VARCHAR(MAX), "Tournament" VARCHAR(MAX), "Surface" VARCHAR(MAX), "Partner" VARCHAR(MAX), "Opponents" VARCHAR(MAX), "Score" VARCHAR(MAX))
| What Score has a Date of 11 september 2010? | SELECT "Score" FROM table_12426 WHERE "Date" = '11 september 2010' | SELECT "Score" FROM "table_12426" WHERE "Date" = '11 september 2010' | 0.066406 |
CREATE TABLE table_2889810_2 (country VARCHAR, moto3_125cc VARCHAR)
| how many country has moto3/125cc with 15 | SELECT country FROM table_2889810_2 WHERE moto3_125cc = 15 | SELECT "country" FROM "table_2889810_2" WHERE "moto3_125cc" = 15 | 0.0625 |
CREATE TABLE table_21326 ("Game" REAL, "Date" VARCHAR(MAX), "Opponent" VARCHAR(MAX), "Score" VARCHAR(MAX), "High points" VARCHAR(MAX), "High rebounds" VARCHAR(MAX), "High assists" VARCHAR(MAX), "Location/Attendance" VARCHAR(MAX), "Record" VARCHAR(MAX))
| On July 8, what was the score? | SELECT "Score" FROM table_21326 WHERE "Date" = 'July 8' | SELECT "Score" FROM "table_21326" WHERE "Date" = 'July 8' | 0.055664 |
CREATE TABLE student (ID VARCHAR, name VARCHAR, dept_name VARCHAR, tot_cred DECIMAL)
CREATE TABLE classroom (building VARCHAR, room_number VARCHAR, capacity DECIMAL)
CREATE TABLE course (course_id VARCHAR, title VARCHAR, dept_name VARCHAR, credits DECIMAL)
CREATE TABLE prereq (course_id VARCHAR, prereq_id VARCHAR)
CREATE TABLE time_slot (time_slot_id VARCHAR, day VARCHAR, start_hr DECIMAL, start_min DECIMAL, end_hr DECIMAL, end_min DECIMAL)
CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget DECIMAL)
CREATE TABLE advisor (s_ID VARCHAR, i_ID VARCHAR)
CREATE TABLE teaches (ID VARCHAR, course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL)
CREATE TABLE instructor (ID VARCHAR, name VARCHAR, dept_name VARCHAR, salary DECIMAL)
CREATE TABLE section (course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL, building VARCHAR, room_number VARCHAR, time_slot_id VARCHAR)
CREATE TABLE takes (ID VARCHAR, course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL, grade VARCHAR)
| Display a bar chart for what are the names and budgets of departments with budgets greater than the average?, and order by the budget from high to low. | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget DESC | SELECT "dept_name", "budget" FROM "department" WHERE "budget" > (SELECT AVG("budget") FROM "department") ORDER BY "budget" DESC NULLS LAST | 0.134766 |
CREATE TABLE keyword (keyword VARCHAR, kid INTEGER)
CREATE TABLE domain_publication (did INTEGER, pid INTEGER)
CREATE TABLE domain_keyword (did INTEGER, kid INTEGER)
CREATE TABLE domain_journal (did INTEGER, jid INTEGER)
CREATE TABLE publication_keyword (kid INTEGER, pid INTEGER)
CREATE TABLE cite (cited INTEGER, citing INTEGER)
CREATE TABLE publication (abstract VARCHAR, cid INTEGER, citation_num INTEGER, jid INTEGER, pid INTEGER, reference_num INTEGER, title VARCHAR, year INTEGER)
CREATE TABLE domain_author (aid INTEGER, did INTEGER)
CREATE TABLE domain_conference (cid INTEGER, did INTEGER)
CREATE TABLE author (aid INTEGER, homepage VARCHAR, name VARCHAR, oid INTEGER)
CREATE TABLE domain (did INTEGER, name VARCHAR)
CREATE TABLE writes (aid INTEGER, pid INTEGER)
CREATE TABLE journal (homepage VARCHAR, jid INTEGER, name VARCHAR)
CREATE TABLE organization (continent VARCHAR, homepage VARCHAR, name VARCHAR, oid INTEGER)
CREATE TABLE conference (cid INTEGER, homepage VARCHAR, name VARCHAR)
| return me the journals, which have more than 10 papers by ' H. V. Jagadish ' . | SELECT journal.name FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY journal.name HAVING COUNT(DISTINCT (publication.title)) > 10 | SELECT "journal"."name" FROM "author" CROSS JOIN "journal" JOIN "publication" ON "journal"."jid" = "publication"."jid" JOIN "writes" ON "author"."aid" = "writes"."aid" AND "publication"."pid" = "writes"."pid" WHERE "author"."name" = 'H. V. Jagadish' GROUP BY "journal"."name" HAVING COUNT(DISTINCT "publication"."title") > 10 | 0.317383 |
CREATE TABLE table_name_96 (points INTEGER, wins VARCHAR, team VARCHAR, year VARCHAR)
| Before 1981, how many Points did Team Suzuki have with less than 0 Wins? | SELECT SUM(points) FROM table_name_96 WHERE team = "suzuki" AND year < 1981 AND wins < 0 | SELECT SUM("points") FROM "table_name_96" WHERE "suzuki" = "team" AND "wins" < 0 AND "year" < 1981 | 0.095703 |
CREATE TABLE Acceptance (Submission_ID INTEGER, Workshop_ID INTEGER, Result VARCHAR(MAX))
CREATE TABLE submission (Submission_ID INTEGER, Scores REAL, Author VARCHAR(MAX), College VARCHAR(MAX))
CREATE TABLE workshop (Workshop_ID INTEGER, Date VARCHAR(MAX), Venue VARCHAR(MAX), Name VARCHAR(MAX))
| Show each author and the number of workshops they submitted to with a bar chart, and could you rank by the X-axis in desc? | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC | SELECT "Author", COUNT(DISTINCT "T1"."workshop_id") FROM "Acceptance" AS "T1" JOIN "submission" AS "T2" ON "T1"."submission_id" = "T2"."submission_id" ORDER BY "Author" DESC NULLS LAST | 0.179688 |
CREATE TABLE table_55175 ("Team" VARCHAR(MAX), "Games Played" REAL, "Wins" REAL, "Losses" REAL, "Ties" REAL, "Goals For" REAL, "Goals Against" REAL)
| How many ties did the Montreal Victorias have with a GA of less than 24? | SELECT MAX("Ties") FROM table_55175 WHERE "Team" = 'montreal victorias' AND "Goals Against" < '24' | SELECT MAX("Ties") FROM "table_55175" WHERE "Goals Against" < '24' AND "Team" = 'montreal victorias' | 0.097656 |
CREATE TABLE table_1524 ("Poll Source" VARCHAR(MAX), "Dates administered" VARCHAR(MAX), "Democrat: Jim Martin" VARCHAR(MAX), "Republican: Saxby Chambliss" VARCHAR(MAX), "Lead Margin" REAL)
| How many times did Saxby Chambliss have a lead margin of 21? | SELECT COUNT("Republican: Saxby Chambliss") FROM table_1524 WHERE "Lead Margin" = '21' | SELECT COUNT("Republican: Saxby Chambliss") FROM "table_1524" WHERE "Lead Margin" = '21' | 0.085938 |
CREATE TABLE table_name_21 (name VARCHAR, best VARCHAR)
| Who had the best time of 1:32.269? | SELECT name FROM table_name_21 WHERE best = "1:32.269" | SELECT "name" FROM "table_name_21" WHERE "1:32.269" = "best" | 0.058594 |
CREATE TABLE table_29202276_2 (origin VARCHAR, destination VARCHAR)
| What is the origin when the destination is Mumbai? | SELECT origin FROM table_29202276_2 WHERE destination = "Mumbai" | SELECT "origin" FROM "table_29202276_2" WHERE "Mumbai" = "destination" | 0.068359 |
CREATE TABLE Documents_with_Expenses (Document_ID INTEGER, Budget_Type_Code CHAR, Document_Details VARCHAR)
CREATE TABLE Documents (Document_ID INTEGER, Document_Type_Code CHAR, Project_ID INTEGER, Document_Date TIMESTAMP, Document_Name VARCHAR, Document_Description VARCHAR, Other_Details VARCHAR)
CREATE TABLE Statements (Statement_ID INTEGER, Statement_Details VARCHAR)
CREATE TABLE Accounts (Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR)
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR, Document_Type_Name VARCHAR, Document_Type_Description VARCHAR)
CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR, Budget_Type_Description VARCHAR)
CREATE TABLE Projects (Project_ID INTEGER, Project_Details VARCHAR)
| Count the number of documents with the type code BK that correspond to each product id. Plot them as scatter chart. | SELECT COUNT(*), Project_ID FROM Documents WHERE Document_Type_Code = "BK" GROUP BY Project_ID | SELECT COUNT(*), "Project_ID" FROM "Documents" WHERE "BK" = "Document_Type_Code" GROUP BY "Project_ID" | 0.099609 |
CREATE TABLE table_1211545_2 (name VARCHAR, heavy_vehicle__2_axles_ VARCHAR)
| What is the name of the plaza where the toll for heavy vehicles with 2 axles is r87.00? | SELECT name FROM table_1211545_2 WHERE heavy_vehicle__2_axles_ = "R87.00" | SELECT "name" FROM "table_1211545_2" WHERE "R87.00" = "heavy_vehicle__2_axles_" | 0.077148 |
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE Tags (Id DECIMAL, TagName VARCHAR(MAX), Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId DECIMAL, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name VARCHAR(MAX), Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE FlagTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body VARCHAR(MAX), OwnerUserId DECIMAL, OwnerDisplayName VARCHAR(MAX), LastEditorUserId DECIMAL, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment VARCHAR(MAX))
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE VoteTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name VARCHAR(MAX))
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
| # Questions asked with 0 answers. | SELECT Users.Id AS "user_link", Reputation, COUNT(Posts.Id) AS QuestionsAskedWithoutAnswers FROM Posts LEFT JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 1 AND AnswerCount = 0 GROUP BY Users.Id, Reputation ORDER BY COUNT(Posts.Id) DESC LIMIT 10 | SELECT "Users"."id" AS "user_link", "Reputation", COUNT("Posts"."id") AS "QuestionsAskedWithoutAnswers" FROM "Posts" LEFT JOIN "Users" ON "Posts"."owneruserid" = "Users"."id" WHERE "AnswerCount" = 0 AND "Posts"."posttypeid" = 1 GROUP BY "Users"."id", "Reputation" ORDER BY COUNT("Posts"."id") DESC NULLS LAST LIMIT 10 | 0.30957 |
CREATE TABLE table_26914759_3 (manner_of_departure VARCHAR, team VARCHAR, incoming_manager VARCHAR)
| What was the manner of departure for notts county with an incoming manager of martin allen | SELECT manner_of_departure FROM table_26914759_3 WHERE team = "Notts County" AND incoming_manager = "Martin Allen" | SELECT "manner_of_departure" FROM "table_26914759_3" WHERE "Martin Allen" = "incoming_manager" AND "Notts County" = "team" | 0.119141 |
CREATE TABLE table_43980 ("Season" REAL, "Team 1" VARCHAR(MAX), "Score" VARCHAR(MAX), "Team 2" VARCHAR(MAX), "Venue" VARCHAR(MAX))
| What year did Bangkok University and Chunnam Dragons have a score of 0-0? | SELECT SUM("Season") FROM table_43980 WHERE "Team 1" = 'bangkok university' AND "Score" = '0-0' AND "Team 2" = 'chunnam dragons' | SELECT SUM("Season") FROM "table_43980" WHERE "Score" = '0-0' AND "Team 1" = 'bangkok university' AND "Team 2" = 'chunnam dragons' | 0.126953 |
CREATE TABLE table_34430 ("Tournament" VARCHAR(MAX), "2003" VARCHAR(MAX), "2004" VARCHAR(MAX), "2005" VARCHAR(MAX), "2006" VARCHAR(MAX), "2007" VARCHAR(MAX), "2008" VARCHAR(MAX), "2009" VARCHAR(MAX), "2010" VARCHAR(MAX), "2011" VARCHAR(MAX), "2012" VARCHAR(MAX), "2013" VARCHAR(MAX), "Win %" REAL)
| Which 2011 has a 2009 of 15 2? | SELECT "2011" FROM table_34430 WHERE "2009" = '15–2' | SELECT "2011" FROM "table_34430" WHERE "2009" = '15–2' | 0.052734 |
CREATE TABLE table_3484 ("Episode #" REAL, "Series #" REAL, "Title" VARCHAR(MAX), "Director" VARCHAR(MAX), "Writer" VARCHAR(MAX), "Original airdate" VARCHAR(MAX), "Viewers ( in millions ) " VARCHAR(MAX))
| What number in the series episode was titled 'Puppy Love'? | SELECT "Series #" FROM table_3484 WHERE "Title" = 'Puppy Love' | SELECT "Series #" FROM "table_3484" WHERE "Title" = 'Puppy Love' | 0.0625 |
CREATE TABLE table_29436238_1 (no_in_series VARCHAR, written_by VARCHAR)
| How many episodes were written by Gregg Mettler? | SELECT COUNT(no_in_series) FROM table_29436238_1 WHERE written_by = "Gregg Mettler" | SELECT COUNT("no_in_series") FROM "table_29436238_1" WHERE "Gregg Mettler" = "written_by" | 0.086914 |
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| provide the number of patients whose diagnoses long title is unspecified fetal and neonatal jaundice and drug name is tamsulosin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified fetal and neonatal jaundice" AND prescriptions.drug = "Tamsulosin" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Unspecified fetal and neonatal jaundice" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "Tamsulosin" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.319336 |
CREATE TABLE table_name_43 (years_for_jazz VARCHAR, position VARCHAR, school_club_team VARCHAR)
| At Position of guard, from the School/Club Team Notre Dame, how many Years for Jazz did that person play? | SELECT years_for_jazz FROM table_name_43 WHERE position = "guard" AND school_club_team = "notre dame" | SELECT "years_for_jazz" FROM "table_name_43" WHERE "guard" = "position" AND "notre dame" = "school_club_team" | 0.106445 |
CREATE TABLE cost (costid DECIMAL, uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, eventtype VARCHAR(MAX), eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname VARCHAR(MAX), labresult DECIMAL, labresulttime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname VARCHAR(MAX), treatmenttime TIME)
| tell me the allergies patient 006-21388 had until 11/2105? | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-21388')) AND STRFTIME('%y-%m', allergy.allergytime) <= '2105-11' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-21388' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "allergy"."allergyname" FROM "allergy" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "allergy"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "allergy"."allergytime") <= '2105-11' | 0.549805 |