schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE table_15100 ("Model" TEXT, "Seats" TEXT, "Period" TEXT, "Built" TEXT, "Country" TEXT)
| In what time period were 578 built? | SELECT "Period" FROM table_15100 WHERE "Built" = '578' | SELECT "Period" FROM "table_15100" WHERE "Built" = '578' | 0.054688 |
CREATE TABLE table_41336 ("Rider" TEXT, "Bike" TEXT, "Laps" FLOAT, "Time" TEXT, "Grid" FLOAT)
| Which bike had fewer than 23 laps and a grid number of 4? | SELECT "Bike" FROM table_41336 WHERE "Laps" < '23' AND "Grid" = '4' | SELECT "Bike" FROM "table_41336" WHERE "Grid" = '4' AND "Laps" < '23' | 0.067383 |
CREATE TABLE Web_client_accelerator (id INT, name TEXT, Operating_system TEXT, Client TEXT, Connection TEXT)
CREATE TABLE browser (id INT, name TEXT, market_share FLOAT)
CREATE TABLE accelerator_compatible_browser (accelerator_id INT, browser_id INT, compatible_since_year INT)
| A pie chart showing the proportion of the number of accelerators for each browser. | SELECT T2.name, COUNT(T2.name) FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN Web_client_accelerator AS T3 ON T1.accelerator_id = T3.id GROUP BY T2.name ORDER BY T1.compatible_since_year DESC | SELECT "T2"."name", COUNT("T2"."name") FROM "accelerator_compatible_browser" AS "T1" JOIN "browser" AS "T2" ON "T1"."browser_id" = "T2"."id" JOIN "Web_client_accelerator" AS "T3" ON "T1"."accelerator_id" = "T3"."id" GROUP BY "T2"."name" ORDER BY "T1"."compatible_since_year" DESC NULLS LAST | 0.283203 |
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
| When has Jon Skeet commented on my posts. | SELECT p.Id AS "post_link", p.CreationDate FROM Posts AS p INNER JOIN Comments AS c ON p.Id = c.PostId WHERE p.OwnerUserId = 12725 AND c.UserId = 22656 ORDER BY p.CreationDate DESC | SELECT "p"."Id" AS "post_link", "p"."CreationDate" FROM "Posts" AS "p" JOIN "Comments" AS "c" ON "c"."PostId" = "p"."Id" AND "c"."UserId" = 22656 WHERE "p"."OwnerUserId" = 12725 ORDER BY "p"."CreationDate" DESC NULLS LAST | 0.21582 |
CREATE TABLE table_56204 ("Year" TEXT, "Date" TEXT, "Venue" TEXT, "Winner" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT, "Margin of victory" TEXT, "Runner ( s ) -up" TEXT, "Winner's share ( \\u20ac ) " TEXT)
| What is the margin of victory for nikki garrett? | SELECT "Margin of victory" FROM table_56204 WHERE "Winner" = 'nikki garrett' | SELECT "Margin of victory" FROM "table_56204" WHERE "Winner" = 'nikki garrett' | 0.076172 |
CREATE TABLE table_27871460_2 (channel_number INT)
| What is the highest channel number? | SELECT MAX(channel_number) FROM table_27871460_2 | SELECT MAX("channel_number") FROM "table_27871460_2" | 0.050781 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| count the number of patients whose diagnoses short title is acute necrosis of liver and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute necrosis of liver" AND prescriptions.drug_type = "BASE" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Acute necrosis of liver" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "BASE" = "prescriptions"."drug_type" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.303711 |
CREATE TABLE table_71153 ("Year" FLOAT, "Entrant" TEXT, "Chassis" TEXT, "Engine" TEXT, "Pts." TEXT)
| What is the entrant for 1967? | SELECT "Entrant" FROM table_71153 WHERE "Year" = '1967' | SELECT "Entrant" FROM "table_71153" WHERE "Year" = '1967' | 0.055664 |
CREATE TABLE table_19495707_1 (platforms VARCHAR, application VARCHAR)
| Name the platforms for cityengine | SELECT platforms FROM table_19495707_1 WHERE application = "CityEngine" | SELECT "platforms" FROM "table_19495707_1" WHERE "CityEngine" = "application" | 0.075195 |
CREATE TABLE table_name_42 (kit_maker VARCHAR, team VARCHAR)
| Which kit maker does Aston Villa use? | SELECT kit_maker FROM table_name_42 WHERE team = "aston villa" | SELECT "kit_maker" FROM "table_name_42" WHERE "aston villa" = "team" | 0.066406 |
CREATE TABLE table_name_5 (region VARCHAR, coach VARCHAR)
| Which region is Coach Trevor Gleeson in? | SELECT region FROM table_name_5 WHERE coach = "trevor gleeson" | SELECT "region" FROM "table_name_5" WHERE "coach" = "trevor gleeson" | 0.066406 |
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
| could you tell me what the earliest flight that goes between ATLANTA and DENVER is which serves a meal | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_service.meal_code = flight.meal_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, flight AS FLIGHTalias1, food_service AS FOOD_SERVICEalias1 WHERE (CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'DENVER' AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code AND FOOD_SERVICEalias1.meal_code = FLIGHTalias1.meal_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'ATLANTA' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) | WITH "_u_0" AS (SELECT MIN("FLIGHTalias1"."departure_time") FROM "airport_service" AS "AIRPORT_SERVICEalias2" JOIN "city" AS "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'ATLANTA' JOIN "flight" AS "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTalias1"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICEalias3" ON "AIRPORT_SERVICEalias3"."airport_code" = "FLIGHTalias1"."to_airport" JOIN "food_service" AS "FOOD_SERVICEalias1" ON "FLIGHTalias1"."meal_code" = "FOOD_SERVICEalias1"."meal_code" JOIN "city" AS "CITYalias3" ON "AIRPORT_SERVICEalias3"."city_code" = "CITYalias3"."city_code" AND "CITYalias3"."city_name" = 'DENVER') SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'ATLANTA' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "flight"."departure_time" JOIN "food_service" ON "flight"."meal_code" = "food_service"."meal_code" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'DENVER' | 1.326172 |
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
| number of times patient 54281 was prescribed emtriva in their first hospital visit. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'emtriva' | SELECT COUNT(*) FROM "prescriptions" WHERE "prescriptions"."drug" = 'emtriva' AND "prescriptions"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 54281 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" NULLS FIRST LIMIT 1) | 0.288086 |
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
| Does the university offer MDE or PreMajor classes for the Summer term ? | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('MDE', 'PreMajor') AND program_course.course_id = course.course_id AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 GROUP BY course.department, course.number | SELECT DISTINCT "course"."department", "course"."name", "course"."number", "program_course"."category" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" IN ('MDE', 'PreMajor') JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Summer' AND "semester"."year" = 2016 GROUP BY "course"."department", "course"."number" | 0.505859 |
CREATE TABLE team_half (year DECIMAL, league_id TEXT, team_id TEXT, half DECIMAL, div_id TEXT, div_win TEXT, rank DECIMAL, g DECIMAL, w DECIMAL, l DECIMAL)
CREATE TABLE manager_award_vote (award_id TEXT, year DECIMAL, league_id TEXT, player_id TEXT, points_won DECIMAL, points_max DECIMAL, votes_first DECIMAL)
CREATE TABLE batting (player_id TEXT, year DECIMAL, stint DECIMAL, team_id TEXT, league_id TEXT, g DECIMAL, ab DECIMAL, r DECIMAL, h DECIMAL, double DECIMAL, triple DECIMAL, hr DECIMAL, rbi DECIMAL, sb DECIMAL, cs DECIMAL, bb DECIMAL, so DECIMAL, ibb DECIMAL, hbp DECIMAL, sh DECIMAL, sf DECIMAL, g_idp DECIMAL)
CREATE TABLE player_award (player_id TEXT, award_id TEXT, year DECIMAL, league_id TEXT, tie TEXT, notes TEXT)
CREATE TABLE manager_award (player_id TEXT, award_id TEXT, year DECIMAL, league_id TEXT, tie TEXT, notes DECIMAL)
CREATE TABLE fielding_outfield (player_id TEXT, year DECIMAL, stint DECIMAL, glf DECIMAL, gcf DECIMAL, grf DECIMAL)
CREATE TABLE hall_of_fame (player_id TEXT, yearid DECIMAL, votedby TEXT, ballots DECIMAL, needed DECIMAL, votes DECIMAL, inducted TEXT, category TEXT, needed_note TEXT)
CREATE TABLE fielding (player_id TEXT, year DECIMAL, stint DECIMAL, team_id TEXT, league_id TEXT, pos TEXT, g DECIMAL, gs DECIMAL, inn_outs DECIMAL, po DECIMAL, a DECIMAL, e DECIMAL, dp DECIMAL, pb DECIMAL, wp DECIMAL, sb DECIMAL, cs DECIMAL, zr DECIMAL)
CREATE TABLE player (player_id TEXT, birth_year DECIMAL, birth_month DECIMAL, birth_day DECIMAL, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year DECIMAL, death_month DECIMAL, death_day DECIMAL, death_country TEXT, death_state TEXT, death_city TEXT, name_first TEXT, name_last TEXT, name_given TEXT, weight DECIMAL, height DECIMAL, bats TEXT, throws TEXT, debut TEXT, final_game TEXT, retro_id TEXT, bbref_id TEXT)
CREATE TABLE batting_postseason (year DECIMAL, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g DECIMAL, ab DECIMAL, r DECIMAL, h DECIMAL, double DECIMAL, triple DECIMAL, hr DECIMAL, rbi DECIMAL, sb DECIMAL, cs DECIMAL, bb DECIMAL, so DECIMAL, ibb DECIMAL, hbp DECIMAL, sh DECIMAL, sf DECIMAL, g_idp DECIMAL)
CREATE TABLE team_franchise (franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT)
CREATE TABLE college (college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT)
CREATE TABLE salary (year DECIMAL, team_id TEXT, league_id TEXT, player_id TEXT, salary DECIMAL)
CREATE TABLE appearances (year DECIMAL, team_id TEXT, league_id TEXT, player_id TEXT, g_all DECIMAL, gs DECIMAL, g_batting DECIMAL, g_defense DECIMAL, g_p DECIMAL, g_c DECIMAL, g_1b DECIMAL, g_2b DECIMAL, g_3b DECIMAL, g_ss DECIMAL, g_lf DECIMAL, g_cf DECIMAL, g_rf DECIMAL, g_of DECIMAL, g_dh DECIMAL, g_ph DECIMAL, g_pr DECIMAL)
CREATE TABLE team (year DECIMAL, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank DECIMAL, g DECIMAL, ghome DECIMAL, w DECIMAL, l DECIMAL, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r DECIMAL, ab DECIMAL, h DECIMAL, double DECIMAL, triple DECIMAL, hr DECIMAL, bb DECIMAL, so DECIMAL, sb DECIMAL, cs DECIMAL, hbp DECIMAL, sf DECIMAL, ra DECIMAL, er DECIMAL, era DECIMAL, cg DECIMAL, sho DECIMAL, sv DECIMAL, ipouts DECIMAL, ha DECIMAL, hra DECIMAL, bba DECIMAL, soa DECIMAL, e DECIMAL, dp DECIMAL, fp DECIMAL, name TEXT, park TEXT, attendance DECIMAL, bpf DECIMAL, ppf DECIMAL, team_id_br TEXT, team_id_lahman45 TEXT, team_id_retro TEXT)
CREATE TABLE pitching (player_id TEXT, year DECIMAL, stint DECIMAL, team_id TEXT, league_id TEXT, w DECIMAL, l DECIMAL, g DECIMAL, gs DECIMAL, cg DECIMAL, sho DECIMAL, sv DECIMAL, ipouts DECIMAL, h DECIMAL, er DECIMAL, hr DECIMAL, bb DECIMAL, so DECIMAL, baopp DECIMAL, era DECIMAL, ibb DECIMAL, wp DECIMAL, hbp DECIMAL, bk DECIMAL, bfp DECIMAL, gf DECIMAL, r DECIMAL, sh DECIMAL, sf DECIMAL, g_idp DECIMAL)
CREATE TABLE home_game (year DECIMAL, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games DECIMAL, openings DECIMAL, attendance DECIMAL)
CREATE TABLE park (park_id TEXT, park_name TEXT, park_alias TEXT, city TEXT, state TEXT, country TEXT)
CREATE TABLE all_star (player_id TEXT, year DECIMAL, game_num DECIMAL, game_id TEXT, team_id TEXT, league_id TEXT, gp DECIMAL, starting_pos DECIMAL)
CREATE TABLE player_award_vote (award_id TEXT, year DECIMAL, league_id TEXT, player_id TEXT, points_won DECIMAL, points_max DECIMAL, votes_first DECIMAL)
CREATE TABLE postseason (year DECIMAL, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins DECIMAL, losses DECIMAL, ties DECIMAL)
CREATE TABLE pitching_postseason (player_id TEXT, year DECIMAL, round TEXT, team_id TEXT, league_id TEXT, w DECIMAL, l DECIMAL, g DECIMAL, gs DECIMAL, cg DECIMAL, sho DECIMAL, sv DECIMAL, ipouts DECIMAL, h DECIMAL, er DECIMAL, hr DECIMAL, bb DECIMAL, so DECIMAL, baopp TEXT, era DECIMAL, ibb DECIMAL, wp DECIMAL, hbp DECIMAL, bk DECIMAL, bfp DECIMAL, gf DECIMAL, r DECIMAL, sh DECIMAL, sf DECIMAL, g_idp DECIMAL)
CREATE TABLE manager (player_id TEXT, year DECIMAL, team_id TEXT, league_id TEXT, inseason DECIMAL, g DECIMAL, w DECIMAL, l DECIMAL, rank DECIMAL, plyr_mgr TEXT)
CREATE TABLE manager_half (player_id TEXT, year DECIMAL, team_id TEXT, league_id TEXT, inseason DECIMAL, half DECIMAL, g DECIMAL, w DECIMAL, l DECIMAL, rank DECIMAL)
CREATE TABLE fielding_postseason (player_id TEXT, year DECIMAL, team_id TEXT, league_id TEXT, round TEXT, pos TEXT, g DECIMAL, gs DECIMAL, inn_outs DECIMAL, po DECIMAL, a DECIMAL, e DECIMAL, dp DECIMAL, tp DECIMAL, pb DECIMAL, sb DECIMAL, cs DECIMAL)
CREATE TABLE player_college (player_id TEXT, college_id TEXT, year DECIMAL)
| Which players won awards in both 1960 and 1961? Return their first names and last names. | SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961 | SELECT "T1"."name_first", "T1"."name_last" FROM "player" AS "T1" JOIN "player_award" AS "T2" ON "T2"."year" = 1960 INTERSECT SELECT "T1"."name_first", "T1"."name_last" FROM "player" AS "T1" JOIN "player_award" AS "T2" ON "T2"."year" = 1961 | 0.233398 |
CREATE TABLE table_name_76 (m809_series VARCHAR, wheelbase VARCHAR, m939_series VARCHAR)
| Name the M809 series for short wheelbase and M939 series of M931/932 | SELECT m809_series FROM table_name_76 WHERE wheelbase = "short" AND m939_series = "m931/932" | SELECT "m809_series" FROM "table_name_76" WHERE "m931/932" = "m939_series" AND "short" = "wheelbase" | 0.097656 |
CREATE TABLE table_name_92 (date VARCHAR, opposing_team VARCHAR)
| What day was United States the opposing team? | SELECT date FROM table_name_92 WHERE opposing_team = "united states" | SELECT "date" FROM "table_name_92" WHERE "opposing_team" = "united states" | 0.072266 |
CREATE TABLE table_41304 ("Team" TEXT, "University" TEXT, "Location" TEXT, "Year entered league" FLOAT, "2013\\u201314 division" TEXT)
| What is the year of entry for the University of Essex? | SELECT "Year entered league" FROM table_41304 WHERE "University" = 'university of essex' | SELECT "Year entered league" FROM "table_41304" WHERE "University" = 'university of essex' | 0.087891 |
CREATE TABLE table_name_39 (grid INT, driver VARCHAR, laps VARCHAR)
| what is the grid when the driver is mario andretti and the laps is less than 54? | SELECT MAX(grid) FROM table_name_39 WHERE driver = "mario andretti" AND laps < 54 | SELECT MAX("grid") FROM "table_name_39" WHERE "driver" = "mario andretti" AND "laps" < 54 | 0.086914 |
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
CREATE TABLE Has_Allergy (StuID INT, Allergy VARCHAR)
CREATE TABLE Allergy_Type (Allergy VARCHAR, AllergyType VARCHAR)
| What is the last name of each student who is not allergic to any type of food? Count them with a bar chart. | SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName | WITH "_u_0" AS (SELECT ARRAY_AGG("StuID") AS "", "T2"."AllergyType" AS "_u_1" FROM "Has_Allergy" AS "T1" JOIN "Allergy_Type" AS "T2" ON "T1"."Allergy" = "T2"."Allergy" GROUP BY "T2"."AllergyType") SELECT "LName", COUNT("LName") FROM "Student" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."_u_1" = "food" WHERE NOT ARRAY_ANY("_u_0"."", "_x" -> "StuID" = "_x") GROUP BY "LName" | 0.358398 |
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
| For those records from the products and each product's manufacturer, give me the comparison about the average of price over the founder , and group by attribute founder by a bar chart, rank in desc by the x-axis. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | SELECT "Founder", AVG("Price") FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder" ORDER BY "Founder" DESC NULLS LAST | 0.169922 |
CREATE TABLE accounts (account_id DECIMAL, customer_id DECIMAL, account_name TEXT, other_account_details TEXT)
CREATE TABLE customers (customer_id DECIMAL, customer_first_name TEXT, customer_last_name TEXT, customer_address TEXT, customer_phone TEXT, customer_email TEXT, other_customer_details TEXT)
CREATE TABLE financial_transactions (transaction_id DECIMAL, previous_transaction_id DECIMAL, account_id DECIMAL, card_id DECIMAL, transaction_type TEXT, transaction_date TIME, transaction_amount DECIMAL, transaction_comment TEXT, other_transaction_details TEXT)
CREATE TABLE customers_cards (card_id DECIMAL, customer_id DECIMAL, card_type_code TEXT, card_number TEXT, date_valid_from TIME, date_valid_to TIME, other_card_details TEXT)
| Return the number of accounts that the customer with the first name Art and last name Turcotte has. | SELECT COUNT(*) FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Art" AND T2.customer_last_name = "Turcotte" | SELECT COUNT(*) FROM "accounts" AS "T1" JOIN "customers" AS "T2" ON "Art" = "T2"."customer_first_name" AND "T1"."customer_id" = "T2"."customer_id" AND "T2"."customer_last_name" = "Turcotte" | 0.18457 |
CREATE TABLE table_74754 ("Region" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Catalog" TEXT)
| What date is associated with the Spunk label? | SELECT "Date" FROM table_74754 WHERE "Label" = 'spunk' | SELECT "Date" FROM "table_74754" WHERE "Label" = 'spunk' | 0.054688 |
CREATE TABLE table_203_637 (id DECIMAL, "player" TEXT, "for" TEXT, "against" TEXT, "result" TEXT, "date" TEXT)
| who does john hendrie play for ? | SELECT "for" FROM table_203_637 WHERE "player" = 'john hendrie' | SELECT "for" FROM "table_203_637" WHERE "player" = 'john hendrie' | 0.063477 |
CREATE TABLE table_name_21 (time_retired VARCHAR, grid VARCHAR)
| Which Time/Retired has a Grid of 2? | SELECT time_retired FROM table_name_21 WHERE grid = 2 | SELECT "time_retired" FROM "table_name_21" WHERE "grid" = 2 | 0.057617 |
CREATE TABLE table_28003 ("Episode #" FLOAT, "The W\\u00f8rd" TEXT, "Guest" TEXT, "Introductory phrase" TEXT, "Original airdate" TEXT, "Production code" FLOAT)
| What is the production code of the episode with an original airdate of december 01? | SELECT "Production code" FROM table_28003 WHERE "Original airdate" = 'December 01' | SELECT "Production code" FROM "table_28003" WHERE "Original airdate" = 'December 01' | 0.082031 |
CREATE TABLE rooms (roomid TEXT, roomname TEXT, beds DECIMAL, bedtype TEXT, maxoccupancy DECIMAL, baseprice DECIMAL, decor TEXT)
CREATE TABLE reservations (code DECIMAL, room TEXT, checkin TEXT, checkout TEXT, rate DECIMAL, lastname TEXT, firstname TEXT, adults DECIMAL, kids DECIMAL)
| How many times does ROY SWEAZY has reserved a room. | SELECT COUNT(*) FROM reservations WHERE firstname = "ROY" AND lastname = "SWEAZY" | SELECT COUNT(*) FROM "reservations" WHERE "ROY" = "firstname" AND "SWEAZY" = "lastname" | 0.084961 |
CREATE TABLE characteristics (characteristic_id DECIMAL, characteristic_type_code TEXT, characteristic_data_type TEXT, characteristic_name TEXT, other_characteristic_details TEXT)
CREATE TABLE product_characteristics (product_id DECIMAL, characteristic_id DECIMAL, product_characteristic_value TEXT)
CREATE TABLE ref_colors (color_code TEXT, color_description TEXT)
CREATE TABLE ref_product_categories (product_category_code TEXT, product_category_description TEXT, unit_of_measure TEXT)
CREATE TABLE products (product_id DECIMAL, color_code TEXT, product_category_code TEXT, product_name TEXT, typical_buying_price TEXT, typical_selling_price TEXT, product_description TEXT, other_product_details TEXT)
CREATE TABLE ref_characteristic_types (characteristic_type_code TEXT, characteristic_type_description TEXT)
| Find the category descriptions of the products whose descriptions include letter 't'. | SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' | SELECT "T1"."product_category_description" FROM "ref_product_categories" AS "T1" JOIN "products" AS "T2" ON "T1"."product_category_code" = "T2"."product_category_code" AND "T2"."product_description" LIKE '%t%' | 0.204102 |
CREATE TABLE entrepreneur (Entrepreneur_ID INT, People_ID INT, Company TEXT, Money_Requested FLOAT, Investor TEXT)
CREATE TABLE people (People_ID INT, Name TEXT, Height FLOAT, Weight FLOAT, Date_of_Birth TEXT)
| how many entrepreneurs correspond to each investor?, and rank Y-axis from high to low order. | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC | SELECT "Investor", COUNT(*) FROM "entrepreneur" GROUP BY "Investor" ORDER BY COUNT(*) DESC NULLS LAST | 0.098633 |
CREATE TABLE customers (customer_id DECIMAL, customer_first_name TEXT, customer_last_name TEXT, customer_address TEXT, customer_phone TEXT, customer_email TEXT, other_customer_details TEXT)
CREATE TABLE accounts (account_id DECIMAL, customer_id DECIMAL, account_name TEXT, other_account_details TEXT)
CREATE TABLE customers_cards (card_id DECIMAL, customer_id DECIMAL, card_type_code TEXT, card_number TEXT, date_valid_from TIME, date_valid_to TIME, other_card_details TEXT)
CREATE TABLE financial_transactions (transaction_id DECIMAL, previous_transaction_id DECIMAL, account_id DECIMAL, card_id DECIMAL, transaction_type TEXT, transaction_date TIME, transaction_amount DECIMAL, transaction_comment TEXT, other_transaction_details TEXT)
| How many accounts do we have? | SELECT COUNT(*) FROM accounts | SELECT COUNT(*) FROM "accounts" | 0.030273 |
CREATE TABLE table_name_16 (team VARCHAR, position VARCHAR, pick VARCHAR)
| What is Team, when Position is 'LHP', and when Pick is '23'? | SELECT team FROM table_name_16 WHERE position = "lhp" AND pick = 23 | SELECT "team" FROM "table_name_16" WHERE "lhp" = "position" AND "pick" = 23 | 0.073242 |
CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR)
| Show the name of ships whose nationality is either United States or United Kingdom. | SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom" | SELECT "Name" FROM "ship" WHERE "Nationality" = "United Kingdom" OR "Nationality" = "United States" | 0.09668 |
CREATE TABLE table_16768245_2 (namesake VARCHAR, longitude VARCHAR)
| When the longitude is 147.1w what is the namesake of the feature? | SELECT namesake FROM table_16768245_2 WHERE longitude = "147.1W" | SELECT "namesake" FROM "table_16768245_2" WHERE "147.1W" = "longitude" | 0.068359 |
CREATE TABLE table_name_62 (outcome VARCHAR, partner VARCHAR)
| What was the outcome of the final with a partner of Brett Steven? | SELECT outcome FROM table_name_62 WHERE partner = "brett steven" | SELECT "outcome" FROM "table_name_62" WHERE "brett steven" = "partner" | 0.068359 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
| how many patients whose age is less than 62 and days of hospital stay is greater than 10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "62" AND demographic.days_stay > "10" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "10" < "demographic"."days_stay" AND "62" > "demographic"."age" | 0.134766 |
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
| This Fall , what are all the upper-level SOC classes that are being offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SOC' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Fall' AND "semester"."year" = 2016 WHERE "course"."department" = 'SOC' | 0.453125 |
CREATE TABLE table_68648 ("Club" TEXT, "City or town" TEXT, "Position in 2012\\u201313 season" TEXT, "First season in top division" TEXT, "Number of seasons in top division" FLOAT, "First season of current spell in top division" TEXT, "Top division titles" TEXT, "Last top division title" TEXT)
| Which City or town has a Top division titles of 17 | SELECT "City or town" FROM table_68648 WHERE "Top division titles" = '17' | SELECT "City or town" FROM "table_68648" WHERE "Top division titles" = '17' | 0.073242 |
CREATE TABLE table_18008 ("No." FLOAT, "#" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" TEXT, "U.S. viewers ( million ) " TEXT)
| How many U.S. viewers (million) are there for the episode whose Production code is 3T7051? | SELECT "U.S. viewers (million)" FROM table_18008 WHERE "Production code" = '3T7051' | SELECT "U.S. viewers (million)" FROM "table_18008" WHERE "Production code" = '3T7051' | 0.083008 |
CREATE TABLE table_12294557_3 (production_code INT)
| what is the minimum production code | SELECT MIN(production_code) FROM table_12294557_3 | SELECT MIN("production_code") FROM "table_12294557_3" | 0.051758 |
CREATE TABLE table_11677691_8 (college VARCHAR, player VARCHAR)
| Where did robert nkemdiche go to college | SELECT college FROM table_11677691_8 WHERE player = "Robert Nkemdiche ‡" | SELECT "college" FROM "table_11677691_8" WHERE "Robert Nkemdiche ‡" = "player" | 0.076172 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the number of patients who were admitted before 2187 via physician referral/normal delivery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2187" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2187" > "demographic"."admityear" AND "PHYS REFERRAL/NORMAL DELI" = "demographic"."admission_location" | 0.173828 |
CREATE TABLE table_23014923_1 (minor__south__winners VARCHAR, primary__south__winners VARCHAR)
| What isthe minor (South) winners total number is the primary (South) winners is Mendip Gate? | SELECT COUNT(minor__south__winners) FROM table_23014923_1 WHERE primary__south__winners = "Mendip Gate" | SELECT COUNT("minor__south__winners") FROM "table_23014923_1" WHERE "Mendip Gate" = "primary__south__winners" | 0.106445 |
CREATE TABLE table_60766 ("Date" TEXT, "Venue" TEXT, "Score" TEXT, "Result" TEXT, "Competition" TEXT)
| What competition was played on 2 June 1992? | SELECT "Competition" FROM table_60766 WHERE "Date" = '2 june 1992' | SELECT "Competition" FROM "table_60766" WHERE "Date" = '2 june 1992' | 0.066406 |
CREATE TABLE table_23003 ("House name" TEXT, "House mascot" TEXT, "House colour" TEXT, "Year opened" FLOAT, "House leader" TEXT)
| How many house colours are associated with house names of Hillary? | SELECT COUNT("House colour") FROM table_23003 WHERE "House name" = 'Hillary' | SELECT COUNT("House colour") FROM "table_23003" WHERE "House name" = 'Hillary' | 0.076172 |
CREATE TABLE table_name_34 (country VARCHAR, date VARCHAR)
| What is the country associated with the date in 2003? | SELECT country FROM table_name_34 WHERE date = "2003" | SELECT "country" FROM "table_name_34" WHERE "2003" = "date" | 0.057617 |
CREATE TABLE table_65476 ("School" TEXT, "Location" TEXT, "Mascot" TEXT, "Enrollment" FLOAT, "IHSAA Class" TEXT, "County" TEXT)
| What is the IHSAA class when the county was 83 vermillion? | SELECT "IHSAA Class" FROM table_65476 WHERE "County" = '83 vermillion' | SELECT "IHSAA Class" FROM "table_65476" WHERE "County" = '83 vermillion' | 0.070313 |
CREATE TABLE table_67778 ("Year" FLOAT, "Team" TEXT, "Co-Drivers" TEXT, "Class" TEXT, "Laps" FLOAT, "Pos." TEXT, "Class Pos." TEXT)
| What was the position of the Racing Organisation Course team? | SELECT "Pos." FROM table_67778 WHERE "Team" = 'racing organisation course' | SELECT "Pos." FROM "table_67778" WHERE "Team" = 'racing organisation course' | 0.074219 |
CREATE TABLE table_39374 ("Date" TEXT, "Visitor" TEXT, "Score" TEXT, "Home" TEXT, "Leading scorer" TEXT, "Record" TEXT)
| Which score was for the Spurs as visitors with record of 35 16? | SELECT "Score" FROM table_39374 WHERE "Visitor" = 'spurs' AND "Record" = '35–16' | SELECT "Score" FROM "table_39374" WHERE "Record" = '35–16' AND "Visitor" = 'spurs' | 0.080078 |
CREATE TABLE table_13902 ("Pick" FLOAT, "Team" TEXT, "Player" TEXT, "Position" TEXT, "College" TEXT)
| Who is the Cincinnati College player? | SELECT "Player" FROM table_13902 WHERE "College" = 'cincinnati' | SELECT "Player" FROM "table_13902" WHERE "College" = 'cincinnati' | 0.063477 |
CREATE TABLE table_name_83 (result VARCHAR, western_champion VARCHAR, eastern_champion VARCHAR)
| What is the score from the Sacramento monarchs from the west and the Connecticut sun from the east? | SELECT result FROM table_name_83 WHERE western_champion = "sacramento monarchs" AND eastern_champion = "connecticut sun" | SELECT "result" FROM "table_name_83" WHERE "connecticut sun" = "eastern_champion" AND "sacramento monarchs" = "western_champion" | 0.125 |
CREATE TABLE table_203_42 (id DECIMAL, "model" TEXT, "class" TEXT, "length" TEXT, "fuel" TEXT, "starting price" TEXT)
| which model has the lowest started price ? | SELECT "model" FROM table_203_42 ORDER BY "starting price" LIMIT 1 | SELECT "model" FROM "table_203_42" ORDER BY "starting price" NULLS FIRST LIMIT 1 | 0.078125 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the diagnosis of patient id 2560? | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "2560" | SELECT "diagnoses"."long_title" FROM "diagnoses" WHERE "2560" = "diagnoses"."subject_id" | 0.085938 |
CREATE TABLE table_71813 ("Date" TEXT, "Visiting Team" TEXT, "Final Score" TEXT, "Host Team" TEXT, "Stadium" TEXT)
| When did Final Score of 31-7 happen? | SELECT "Date" FROM table_71813 WHERE "Final Score" = '31-7' | SELECT "Date" FROM "table_71813" WHERE "Final Score" = '31-7' | 0.05957 |
CREATE TABLE table_36704 ("Conference" TEXT, "Division" TEXT, "Team" TEXT, "City" TEXT, "Home Stadium" TEXT)
| Which Division does the City being jacksonville, florida belong to? | SELECT "Division" FROM table_36704 WHERE "City" = 'jacksonville, florida' | SELECT "Division" FROM "table_36704" WHERE "City" = 'jacksonville, florida' | 0.073242 |
CREATE TABLE table_name_36 (score VARCHAR, home VARCHAR, record VARCHAR)
| What is the score for the Chicago Black Hawks game with a record of 2-1? | SELECT score FROM table_name_36 WHERE home = "chicago black hawks" AND record = "2-1" | SELECT "score" FROM "table_name_36" WHERE "2-1" = "record" AND "chicago black hawks" = "home" | 0.09082 |
CREATE TABLE table_74080 ("Club" TEXT, "Played" TEXT, "Won" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Points" TEXT)
| How many matches were drawn by the teams that won exactly 10? | SELECT COUNT("Drawn") FROM table_74080 WHERE "Won" = '10' | SELECT COUNT("Drawn") FROM "table_74080" WHERE "Won" = '10' | 0.057617 |
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, 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 cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| what are the four most commonly given lab tests for patients who have previously received amputation during the same hospital encounter? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'amputation') AS t1 JOIN (SELECT patient.uniquepid, lab.labname, lab.labresulttime, patient.patienthealthsystemstayid FROM lab JOIN patient ON lab.patientunitstayid = patient.patientunitstayid) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.labresulttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.labname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "lab"."labname", "lab"."labresulttime", "patient"."patienthealthsystemstayid" FROM "lab" JOIN "patient" ON "lab"."patientunitstayid" = "patient"."patientunitstayid"), "t3" AS (SELECT "t2"."labname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" AS "t2" ON "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" AND "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."labresulttime" > "treatment"."treatmenttime" WHERE "treatment"."treatmentname" = 'amputation' GROUP BY "t2"."labname") SELECT "t3"."labname" FROM "t3" AS "t3" WHERE "t3"."c1" <= 4 | 0.714844 |
CREATE TABLE table_name_56 (attendance VARCHAR, group_position VARCHAR)
| How many people were in attendance when the group position was 3rd? | SELECT attendance FROM table_name_56 WHERE group_position = "3rd" | SELECT "attendance" FROM "table_name_56" WHERE "3rd" = "group_position" | 0.069336 |
CREATE TABLE table_18178 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
| Which result did the Republican have with the incumbent, Billy Tauzin? | SELECT "Result" FROM table_18178 WHERE "Party" = 'Republican' AND "Incumbent" = 'Billy Tauzin' | SELECT "Result" FROM "table_18178" WHERE "Incumbent" = 'Billy Tauzin' AND "Party" = 'Republican' | 0.09375 |
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
| Name the courses that include parts of Space-time Symmetries and the Representations and The Graphic Narrative . | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%The Graphic Narrative%' OR course.description LIKE '%The Graphic Narrative%' OR course.name LIKE '%The Graphic Narrative%') AND (area.area LIKE '%Space-time Symmetries and the Representations%' OR course.description LIKE '%Space-time Symmetries and the Representations%' OR course.name LIKE '%Space-time Symmetries and the Representations%') | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "area" ON ("area"."area" LIKE '%Space-time Symmetries and the Representations%' OR "course"."description" LIKE '%Space-time Symmetries and the Representations%' OR "course"."name" LIKE '%Space-time Symmetries and the Representations%') AND ("area"."area" LIKE '%The Graphic Narrative%' OR "course"."description" LIKE '%The Graphic Narrative%' OR "course"."name" LIKE '%The Graphic Narrative%') AND "area"."course_id" = "course"."course_id" | 0.519531 |
CREATE TABLE table_42090 ("Office" TEXT, "Democratic ticket" TEXT, "Republican ticket" TEXT, "American Labor ticket" TEXT, "Socialist ticket" TEXT)
| Which Socialist candidate ran against American Labor candidate Caroline O'Day? | SELECT "Socialist ticket" FROM table_42090 WHERE "American Labor ticket" = 'caroline o''day' | SELECT "Socialist ticket" FROM "table_42090" WHERE "American Labor ticket" = 'caroline o\'day' | 0.091797 |
CREATE TABLE table_15111 ("Week" TEXT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Game site" TEXT, "Record" TEXT, "Attendance" TEXT)
| Name the record with attendance of 73,996 | SELECT "Record" FROM table_15111 WHERE "Attendance" = '73,996' | SELECT "Record" FROM "table_15111" WHERE "Attendance" = '73,996' | 0.0625 |
CREATE TABLE table_name_96 (points INT, opponent VARCHAR, game VARCHAR)
| Which Points have an Opponent of new york islanders, and a Game smaller than 65? | SELECT SUM(points) FROM table_name_96 WHERE opponent = "new york islanders" AND game < 65 | SELECT SUM("points") FROM "table_name_96" WHERE "game" < 65 AND "new york islanders" = "opponent" | 0.094727 |
CREATE TABLE table_name_60 (vmax VARCHAR, type VARCHAR, cylinder VARCHAR, capacity VARCHAR)
| What was the maximum speed for straight-4, 1.466 cc Type r 150? | SELECT vmax FROM table_name_60 WHERE cylinder = "straight-4" AND capacity = "1.466 cc" AND type = "r 150" | SELECT "vmax" FROM "table_name_60" WHERE "1.466 cc" = "capacity" AND "cylinder" = "straight-4" AND "r 150" = "type" | 0.112305 |
CREATE TABLE table_name_93 (points INT, chassis VARCHAR)
| What are the lowest points for an engine with a Dallara F303 chassis? | SELECT MIN(points) FROM table_name_93 WHERE chassis = "dallara f303" | SELECT MIN("points") FROM "table_name_93" WHERE "chassis" = "dallara f303" | 0.072266 |
CREATE TABLE table_41788 ("Landfill" TEXT, "Location" TEXT, "Acres" FLOAT, "Opened" FLOAT, "Capacity" TEXT, "Status" TEXT, "Rehab Period" TEXT)
| What is the total number of acres at Sai Tso Wan, opening before 1978? | SELECT COUNT("Acres") FROM table_41788 WHERE "Landfill" = 'sai tso wan' AND "Opened" < '1978' | SELECT COUNT("Acres") FROM "table_41788" WHERE "Landfill" = 'sai tso wan' AND "Opened" < '1978' | 0.092773 |
CREATE TABLE table_name_33 (pos VARCHAR, player VARCHAR)
| What is Pos., when Player is 'Nigel De Jong'? | SELECT pos FROM table_name_33 WHERE player = "nigel de jong" | SELECT "pos" FROM "table_name_33" WHERE "nigel de jong" = "player" | 0.064453 |
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, 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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| how many current patients are of age 40s? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 40 AND 49 | SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" WHERE "patient"."age" <= 49 AND "patient"."age" >= 40 AND "patient"."hospitaldischargetime" IS NULL | 0.155273 |
CREATE TABLE table_13103 ("Result" TEXT, "Opponent" TEXT, "Type" TEXT, "Rd. , Time" TEXT, "Date" TEXT)
| Who did Tony Oakey win against when he had type of w pts 12? | SELECT "Opponent" FROM table_13103 WHERE "Result" = 'win' AND "Type" = 'w pts 12' | SELECT "Opponent" FROM "table_13103" WHERE "Result" = 'win' AND "Type" = 'w pts 12' | 0.081055 |
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
| what is the variation of patient 016-18575's respiration second measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit? | SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.respiration IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1 OFFSET 1) - (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.respiration IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '016-18575' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."unitdischargetime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."unitdischargetime" IS NULL AND NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT "vitalperiodic"."respiration" FROM "vitalperiodic" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND NOT "vitalperiodic"."respiration" IS NULL ORDER BY "vitalperiodic"."observationtime" NULLS FIRST LIMIT 1 OFFSET 1) - (SELECT "vitalperiodic"."respiration" FROM "vitalperiodic" LEFT JOIN "_u_4" AS "_u_4" ON "_u_4"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_4"."" IS NULL AND NOT "vitalperiodic"."respiration" IS NULL ORDER BY "vitalperiodic"."observationtime" NULLS FIRST LIMIT 1) | 1.182617 |
CREATE TABLE table_5317 ("Player" TEXT, "Position" TEXT, "Date of Birth ( Age ) " TEXT, "Caps" FLOAT, "Club/province" TEXT)
| Which Player has a Position of number 8, and a Club/province of scarlets? | SELECT "Player" FROM table_5317 WHERE "Position" = 'number 8' AND "Club/province" = 'scarlets' | SELECT "Player" FROM "table_5317" WHERE "Club/province" = 'scarlets' AND "Position" = 'number 8' | 0.09375 |
CREATE TABLE table_204_680 (id DECIMAL, "released" TEXT, "title" TEXT, "artist" TEXT, "format" TEXT, "language" TEXT)
| did big bang release more or less albums than 2ne1 ? | SELECT (SELECT COUNT(*) FROM table_204_680 WHERE "artist" = 'big bang') > (SELECT COUNT(*) FROM table_204_680 WHERE "artist" = '2ne1') | WITH "_u_0" AS (SELECT COUNT(*), 'big bang' AS "_u_1" FROM "table_204_680" GROUP BY 'big bang'), "_u_2" AS (SELECT COUNT(*), '2ne1' AS "_u_3" FROM "table_204_680" GROUP BY '2ne1') SELECT COALESCE("_u_0"."", *) > COALESCE("_u_2"."", *) LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."_u_1" = "artist" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."_u_3" = "artist" | 0.335938 |
CREATE TABLE table_33974 ("Date" TEXT, "Site" TEXT, "Sport" TEXT, "Winning team" TEXT, "Series" TEXT)
| Which date had a site of N/A? | SELECT "Date" FROM table_33974 WHERE "Site" = 'n/a' | SELECT "Date" FROM "table_33974" WHERE "Site" = 'n/a' | 0.051758 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
| Which patients have an ambi5 drug code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "AMBI5" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "AMBI5" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.189453 |
CREATE TABLE table_name_21 (acronym VARCHAR, name_in_english VARCHAR)
| What is the acronym for the English name Northern management and technological institute? | SELECT acronym FROM table_name_21 WHERE name_in_english = "northern management and technological institute" | SELECT "acronym" FROM "table_name_21" WHERE "name_in_english" = "northern management and technological institute" | 0.110352 |
CREATE TABLE table_32061 ("Player" TEXT, "Nationality" TEXT, "Position" TEXT, "Years in Toronto" TEXT, "School/Club Team" TEXT)
| What position does Hedo T rko lu play? | SELECT "Position" FROM table_32061 WHERE "Player" = 'hedo türkoğlu' | SELECT "Position" FROM "table_32061" WHERE "Player" = 'hedo türkoğlu' | 0.067383 |
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| is heartrate of patient 028-40638 second measured on the first icu visit less than the first value measured on the first icu visit? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-40638') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND NOT vitalperiodic.heartrate IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1 OFFSET 1) < (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-40638') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND NOT vitalperiodic.heartrate IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '028-40638' GROUP BY "patienthealthsystemstayid") SELECT (SELECT "vitalperiodic"."heartrate" FROM "vitalperiodic" WHERE "vitalperiodic"."patientunitstayid" IN (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."unitdischargetime" IS NULL ORDER BY "patient"."unitadmittime" NULLS FIRST LIMIT 1) AND NOT "vitalperiodic"."heartrate" IS NULL ORDER BY "vitalperiodic"."observationtime" NULLS FIRST LIMIT 1 OFFSET 1) < (SELECT "vitalperiodic"."heartrate" FROM "vitalperiodic" WHERE "vitalperiodic"."patientunitstayid" IN (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL AND NOT "patient"."unitdischargetime" IS NULL ORDER BY "patient"."unitadmittime" NULLS FIRST LIMIT 1) AND NOT "vitalperiodic"."heartrate" IS NULL ORDER BY "vitalperiodic"."observationtime" NULLS FIRST LIMIT 1) | 1.092773 |
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, 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 medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| calculate the three year survival rate of those who were diagnosed with gastric ca. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'gastric ca' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.diagnosistime) > 3 * 365) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid | WITH "t1" AS (SELECT "patient"."uniquepid", "diagnosis"."diagnosistime" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'gastric ca' GROUP BY "patient"."uniquepid" HAVING "diagnosis"."diagnosistime" = MIN("diagnosis"."diagnosistime")) SELECT SUM(CASE WHEN "patient"."hospitaldischargestatus" = 'alive' THEN 1 WHEN STRFTIME('%j', "patient"."hospitaldischargetime") - STRFTIME('%j', "t1"."diagnosistime") > 1095 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM "t1" AS "t1" JOIN "patient" ON "patient"."uniquepid" = "t1"."uniquepid" WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "t1"."diagnosistime") > 1095 | 0.686523 |
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
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 PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
| C# about partial generic type inference. | SELECT Id AS "post_link" FROM Posts WHERE Tags LIKE '%c#%' AND Body LIKE '%generic%' AND Body LIKE '%partial%' AND Body LIKE '%inference%' | SELECT "Id" AS "post_link" FROM "Posts" WHERE "Body" LIKE '%generic%' AND "Body" LIKE '%inference%' AND "Body" LIKE '%partial%' AND "Tags" LIKE '%c#%' | 0.146484 |
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| what were the four most common diagnoses that followed in the same month for patients who were diagnosed with human immuno virus dis since 2105? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'human immuno virus dis') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105') AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', diagnoses_icd.charttime) >= '2105') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 4) | WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."icd9_code", "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" WHERE STRFTIME('%y', "diagnoses_icd"."charttime") >= '2105'), "t3" AS (SELECT "t2"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'human immuno virus dis' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."charttime" AND DATETIME("diagnoses_icd"."charttime", 'start of month') = DATETIME("t2"."charttime", 'start of month') WHERE STRFTIME('%y', "diagnoses_icd"."charttime") >= '2105' GROUP BY "t2"."icd9_code"), "_u_1" AS (SELECT "t3"."icd9_code" FROM "t3" AS "t3" WHERE "t3"."c1" <= 4 GROUP BY "icd9_code") SELECT "d_icd_diagnoses"."short_title" FROM "d_icd_diagnoses" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_icd_diagnoses"."icd9_code" WHERE NOT "_u_1"."" IS NULL | 1.140625 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| tell me the diagnosis icd9 code along with the primary disease from which erik dickerson is suffering. | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Erik Dickerson" | SELECT "demographic"."diagnosis", "diagnoses"."icd9_code" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "Erik Dickerson" = "demographic"."name" | 0.185547 |
CREATE TABLE table_47615 ("Date" TEXT, "Competition" TEXT, "Winners" TEXT, "Score" TEXT, "Runners-up" TEXT)
| What date did the Fai Cup with Derry City F.C. as runners-up take place? | SELECT "Date" FROM table_47615 WHERE "Competition" = 'fai cup' AND "Runners-up" = 'derry city f.c.' | SELECT "Date" FROM "table_47615" WHERE "Competition" = 'fai cup' AND "Runners-up" = 'derry city f.c.' | 0.098633 |
CREATE TABLE Street_Markets (Market_ID INT, Market_Details VARCHAR)
CREATE TABLE Ref_Attraction_Types (Attraction_Type_Code CHAR, Attraction_Type_Description VARCHAR)
CREATE TABLE Tourist_Attractions (Tourist_Attraction_ID INT, Attraction_Type_Code CHAR, Location_ID INT, How_to_Get_There VARCHAR, Name VARCHAR, Description VARCHAR, Opening_Hours VARCHAR, Other_Details VARCHAR)
CREATE TABLE Features (Feature_ID INT, Feature_Details VARCHAR)
CREATE TABLE Shops (Shop_ID INT, Shop_Details VARCHAR)
CREATE TABLE Hotels (hotel_id INT, star_rating_code CHAR, pets_allowed_yn CHAR, price_range FLOAT, other_hotel_details VARCHAR)
CREATE TABLE Photos (Photo_ID INT, Tourist_Attraction_ID INT, Name VARCHAR, Description VARCHAR, Filename VARCHAR, Other_Details VARCHAR)
CREATE TABLE Locations (Location_ID INT, Location_Name VARCHAR, Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Ref_Hotel_Star_Ratings (star_rating_code CHAR, star_rating_description VARCHAR)
CREATE TABLE Museums (Museum_ID INT, Museum_Details VARCHAR)
CREATE TABLE Theme_Parks (Theme_Park_ID INT, Theme_Park_Details VARCHAR)
CREATE TABLE Staff (Staff_ID INT, Tourist_Attraction_ID INT, Name VARCHAR, Other_Details VARCHAR)
CREATE TABLE Visits (Visit_ID INT, Tourist_Attraction_ID INT, Tourist_ID INT, Visit_Date DATETIME, Visit_Details VARCHAR)
CREATE TABLE Royal_Family (Royal_Family_ID INT, Royal_Family_Details VARCHAR)
CREATE TABLE Tourist_Attraction_Features (Tourist_Attraction_ID INT, Feature_ID INT)
CREATE TABLE Visitors (Tourist_ID INT, Tourist_Details VARCHAR)
| what is the average price range of hotels for each each star rating code? | SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code | SELECT "star_rating_code", AVG("price_range") FROM "Hotels" GROUP BY "star_rating_code" | 0.084961 |
CREATE TABLE table_name_17 (gamecenter VARCHAR, attendance VARCHAR)
| Name the gamecenter that has attendance of 65,212 | SELECT gamecenter FROM table_name_17 WHERE attendance = "65,212" | SELECT "gamecenter" FROM "table_name_17" WHERE "65,212" = "attendance" | 0.068359 |
CREATE TABLE table_name_32 (grade VARCHAR)
| Which 2005 is the lowest one that has a Grade smaller than 6, and a 2008 smaller than 80, and a 2006 larger than 72? | SELECT MIN(2005) FROM table_name_32 WHERE grade < 6 AND 2008 < 80 AND 2006 > 72 | SELECT MIN(2005) FROM "table_name_32" WHERE FALSE | 0.047852 |
CREATE TABLE table_name_66 (year_joined VARCHAR, school VARCHAR)
| What's the year that Hagerstown joined? | SELECT year_joined FROM table_name_66 WHERE school = "hagerstown" | SELECT "year_joined" FROM "table_name_66" WHERE "hagerstown" = "school" | 0.069336 |
CREATE TABLE table_28638 ("Rank" FLOAT, "Couple" TEXT, "Judges" FLOAT, "Public" FLOAT, "Total" FLOAT, "Vote percentage" TEXT, "Result" TEXT)
| What is the public when the vote percentage is 16.0% | SELECT "Public" FROM table_28638 WHERE "Vote percentage" = '16.0%' | SELECT "Public" FROM "table_28638" WHERE "Vote percentage" = '16.0%' | 0.066406 |
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| what is the three most frequent drugs that were prescribed within 2 months to a female patient 20s after they have been diagnosed with hyp kid nos w cr kid v, since 4 years ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hyp kid nos w cr kid v') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'f') AND admissions.age BETWEEN 20 AND 29 AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3 | WITH "_u_1" AS (SELECT "patients"."subject_id" FROM "patients" WHERE "patients"."gender" = 'f' GROUP BY "subject_id"), "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."age" <= 29 AND "admissions"."age" >= 20 AND "admissions"."hadm_id" = "prescriptions"."hadm_id" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "admissions"."subject_id" WHERE DATETIME("prescriptions"."startdate") >= DATETIME(CURRENT_TIME(), '-4 year') AND NOT "_u_1"."" IS NULL), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'hyp kid nos w cr kid v' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."startdate" AND DATETIME("diagnoses_icd"."charttime") <= DATETIME("t2"."startdate") AND DATETIME("diagnoses_icd"."charttime", '+2 month') >= DATETIME("t2"."startdate") WHERE DATETIME("diagnoses_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" AS "t3" WHERE "t3"."c1" <= 3 | 1.282227 |
CREATE TABLE table_30286 ("English word" TEXT, "Slovak" TEXT, "Czech" TEXT, "Rusyn" TEXT, "Ukrainian" TEXT, "Belarusian" TEXT, "Polish" TEXT, "Serbo-Croatian" TEXT, "Bulgarian" TEXT)
| How many words are there in rusyn for the bulgarian word (kupuva)? | SELECT COUNT("Rusyn") FROM table_30286 WHERE "Bulgarian" = 'купува (kupuva)' | SELECT COUNT("Rusyn") FROM "table_30286" WHERE "Bulgarian" = 'купува (kupuva)' | 0.076172 |
CREATE TABLE table_23670057_1 (no VARCHAR, height__m_ VARCHAR)
| Name the number for 1.96 height | SELECT no FROM table_23670057_1 WHERE height__m_ = "1.96" | SELECT "no" FROM "table_23670057_1" WHERE "1.96" = "height__m_" | 0.061523 |
CREATE TABLE table_dev_5 ("id" INT, "anemia" BOOLEAN, "gender" TEXT, "hiv_infection" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "panel_reactive_antibodies" INT, "psa" INT, "body_mass_index_bmi" FLOAT, "NOUSE" FLOAT)
| body mass index should be less than 26 | SELECT * FROM table_dev_5 WHERE body_mass_index_bmi < 26 | SELECT * FROM "table_dev_5" WHERE "body_mass_index_bmi" < 26 | 0.058594 |
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| has patient 028-32921 received this year a test for protein c? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-32921')) AND lab.labname = 'protein c' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '028-32921' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'protein c' AND DATETIME("lab"."labresulttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL | 0.611328 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients discharged at home were married? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "HOME" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "HOME" = "demographic"."discharge_location" AND "MARRIED" = "demographic"."marital_status" | 0.143555 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
| Calculate the maximum age of paients admitted to emergency who were born before 2076 | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "2076" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "2076" < "demographic"."dob_year" AND "EMERGENCY" = "demographic"."admission_type" | 0.135742 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| give me the number of patients whose insurance is government and admission location is phys referral/normal deli? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "Government" = "demographic"."insurance" AND "PHYS REFERRAL/NORMAL DELI" = "demographic"."admission_location" | 0.179688 |
CREATE TABLE table_10178 ("Role" TEXT, "Original Broadway production" TEXT, "First US National Tour" TEXT, "Second US National Tour" TEXT, "Original Italian production" TEXT)
| Which Original Broadway production has a Role of dr. victor von frankenstein? | SELECT "Original Broadway production" FROM table_10178 WHERE "Role" = 'dr. victor von frankenstein' | SELECT "Original Broadway production" FROM "table_10178" WHERE "Role" = 'dr. victor von frankenstein' | 0.098633 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
| provide the number of patients whose age is less than 54 and procedure icd9 code is 3142? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "54" AND procedures.icd9_code = "3142" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3142" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "54" > "demographic"."age" | 0.204102 |
CREATE TABLE table_name_22 (team VARCHAR, laps VARCHAR)
| Which team has driven 134 laps? | SELECT team FROM table_name_22 WHERE laps = 134 | SELECT "team" FROM "table_name_22" WHERE "laps" = 134 | 0.051758 |
CREATE TABLE appellations (No INT, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT)
CREATE TABLE wine (No INT, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INT, Price INT, Score INT, Cases INT, Drink TEXT)
CREATE TABLE grapes (ID INT, Grape TEXT, Color TEXT)
| How many wines are there for each grape. | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape | SELECT "Grape", COUNT(*) FROM "wine" GROUP BY "Grape" | 0.051758 |
CREATE TABLE table_13608101_1 (others_percentage VARCHAR, parish VARCHAR)
| what's the others% with parbeingh being tangipahoa | SELECT others_percentage FROM table_13608101_1 WHERE parish = "Tangipahoa" | SELECT "others_percentage" FROM "table_13608101_1" WHERE "Tangipahoa" = "parish" | 0.078125 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.