schema
stringlengths 29
5.42k
| question
stringlengths 0
752
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
8.94k
| weight
float64 0
8.73
|
---|---|---|---|---|
CREATE TABLE table_203_743 (id NUMBER, "version" CLOB, "date" CLOB, "development cycle" CLOB, "size ( in kb ) " NUMBER, "download" CLOB, "notes" CLOB)
| what is the last version of the 16 bit cello to be released in the beta cycle ? | SELECT "version" FROM table_203_743 WHERE "development cycle" = 'beta' ORDER BY id DESC LIMIT 1 | SELECT "version" FROM "table_203_743" WHERE "development cycle" = 'beta' ORDER BY "id" DESC FETCH FIRST 1 ROWS ONLY | 0.112305 |
CREATE TABLE table_30272 ("Represent" FLOAT, "Contestant" CLOB, "Age" FLOAT, "Height" CLOB, "Hometown" CLOB, "Sponsor" CLOB)
| What was the height of representative #6? | SELECT "Height" FROM table_30272 WHERE "Represent" = '6' | SELECT "Height" FROM "table_30272" WHERE "Represent" = '6' | 0.056641 |
CREATE TABLE employee (eid NUMBER, name VARCHAR2, salary NUMBER)
CREATE TABLE flight (flno NUMBER, origin VARCHAR2, destination VARCHAR2, distance NUMBER, departure_date DATE, arrival_date DATE, price NUMBER, aid NUMBER)
CREATE TABLE certificate (eid NUMBER, aid NUMBER)
CREATE TABLE aircraft (aid NUMBER, name VARCHAR2, distance NUMBER)
| Show all origins and the number of flights from each origin. Show bar chart. | SELECT origin, COUNT(*) FROM flight GROUP BY origin | SELECT "origin", COUNT(*) FROM "flight" GROUP BY "origin" | 0.055664 |
CREATE TABLE table_1341973_6 (result VARCHAR2, district VARCHAR2)
| What was the result of the election in california 2? | SELECT result FROM table_1341973_6 WHERE district = "California 2" | SELECT "result" FROM "table_1341973_6" WHERE "California 2" = "district" | 0.070313 |
CREATE TABLE table_name_12 (moving_to VARCHAR2, transfer_window VARCHAR2, transfer_fee VARCHAR2, nat VARCHAR2)
| What was the moving that has a free transfer fee, and the nationality of CYP, and winter as the transfer window? | SELECT moving_to FROM table_name_12 WHERE transfer_fee = "free" AND nat = "cyp" AND transfer_window = "winter" | SELECT "moving_to" FROM "table_name_12" WHERE "cyp" = "nat" AND "free" = "transfer_fee" AND "transfer_window" = "winter" | 0.117188 |
CREATE TABLE table_29939 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| What is the record when the date is January 7? | SELECT "Record" FROM table_29939 WHERE "Date" = 'January 7' | SELECT "Record" FROM "table_29939" WHERE "Date" = 'January 7' | 0.05957 |
CREATE TABLE table_23411 ("No. overall" CLOB, "No. in series" FLOAT, "Family/families" CLOB, "Location ( s ) " CLOB, "Original air date" CLOB)
| Name the family for uk31 | SELECT "Family/families" FROM table_23411 WHERE "No. overall" = 'UK31' | SELECT "Family/families" FROM "table_23411" WHERE "No. overall" = 'UK31' | 0.070313 |
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
| Answer length and character rentability. | SELECT p.Id AS "post_link", LENGTH(p.Body) AS Length, p.Score, CAST(p.Score AS FLOAT) / LENGTH(p.Body) AS rentability, v.BountyAmount, v.VoteTypeId FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId JOIN Votes AS v ON v.PostId = p.Id WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 ORDER BY rentability DESC, Length | SELECT "p"."Id" AS "post_link", LENGTH("p"."Body") AS "Length", "p"."Score", CAST("p"."Score" AS FLOAT) / NULLIF(LENGTH("p"."Body"), 0) AS "rentability", "v"."BountyAmount", "v"."VoteTypeId" FROM "Posts" "p" JOIN "Users" "u" ON "p"."OwnerUserId" = "u"."Id" JOIN "Votes" "v" ON "p"."Id" = "v"."PostId" WHERE "p"."OwnerUserId" = '##UserId##' AND "p"."PostTypeId" = 2 ORDER BY "rentability" DESC, "Length" | 0.392578 |
CREATE TABLE catalog_contents (price_in_euros NUMBER)
| What are the average and minimum price (in Euro) of all products? | SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents | SELECT AVG("price_in_euros"), MIN("price_in_euros") FROM "catalog_contents" | 0.073242 |
CREATE TABLE table_45864 ("Player" CLOB, "Club" CLOB, "Games" FLOAT, "Goals" FLOAT, "Assists" FLOAT, "Points" FLOAT)
| What is the average Assists, when Club is Iserlohn Roosters,when Points is 71, and when Goals is greater than 44? | SELECT AVG("Assists") FROM table_45864 WHERE "Club" = 'iserlohn roosters' AND "Points" = '71' AND "Goals" > '44' | SELECT AVG("Assists") FROM "table_45864" WHERE "Club" = 'iserlohn roosters' AND "Goals" > '44' AND "Points" = '71' | 0.111328 |
CREATE TABLE table_18183850_12 (outcome VARCHAR2, opponent VARCHAR2)
| How many outcomes were there when the opponent was Aleksandra Wozniak? | SELECT COUNT(outcome) FROM table_18183850_12 WHERE opponent = "Aleksandra Wozniak" | SELECT COUNT("outcome") FROM "table_18183850_12" WHERE "Aleksandra Wozniak" = "opponent" | 0.085938 |
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
| how many patients had aspart insulin prescriptions during the same hospital visit after being diagnosed with s/p interventional vascular procedure, since 2100? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p interventional vascular procedure' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2100') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'aspart insulin' AND STRFTIME('%y', medication.drugstarttime) >= '2100') AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid | WITH "t2" AS (SELECT "medication"."drugstarttime", "patient"."patienthealthsystemstayid" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'aspart insulin' AND STRFTIME('%y', "medication"."drugstarttime") >= '2100') SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" WHERE "diagnosis"."diagnosisname" = 's/p interventional vascular procedure' AND STRFTIME('%y', "diagnosis"."diagnosistime") >= '2100' | 0.705078 |
CREATE TABLE table_43815 ("Club" CLOB, "League goals" CLOB, "FA Cup goals" CLOB, "League Cup goals" CLOB, "Total" FLOAT)
| Which Total has an FA Cup goals of 1, and a League goals of 4 + 7? | SELECT AVG("Total") FROM table_43815 WHERE "FA Cup goals" = '1' AND "League goals" = '4 + 7' | SELECT AVG("Total") FROM "table_43815" WHERE "FA Cup goals" = '1' AND "League goals" = '4 + 7' | 0.091797 |
CREATE TABLE table_name_76 (visitor VARCHAR2, home VARCHAR2)
| Who were the visitors when the home team were the ny rangers? | SELECT visitor FROM table_name_76 WHERE home = "ny rangers" | SELECT "visitor" FROM "table_name_76" WHERE "home" = "ny rangers" | 0.063477 |
CREATE TABLE accounts (account_id NUMBER, customer_id NUMBER, account_name CLOB, other_account_details CLOB)
CREATE TABLE customers_cards (card_id NUMBER, customer_id NUMBER, card_type_code CLOB, card_number CLOB, date_valid_from TIME, date_valid_to TIME, other_card_details CLOB)
CREATE TABLE financial_transactions (transaction_id NUMBER, previous_transaction_id NUMBER, account_id NUMBER, card_id NUMBER, transaction_type CLOB, transaction_date TIME, transaction_amount NUMBER, transaction_comment CLOB, other_transaction_details CLOB)
CREATE TABLE customers (customer_id NUMBER, customer_first_name CLOB, customer_last_name CLOB, customer_address CLOB, customer_phone CLOB, customer_email CLOB, other_customer_details CLOB)
| Show the first names and last names of customers without any account. | SELECT customer_first_name, customer_last_name FROM customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM customers AS T1 JOIN accounts AS T2 ON T1.customer_id = T2.customer_id | SELECT "customer_first_name", "customer_last_name" FROM "customers" EXCEPT SELECT "T1"."customer_first_name", "T1"."customer_last_name" FROM "customers" "T1" JOIN "accounts" "T2" ON "T1"."customer_id" = "T2"."customer_id" | 0.21582 |
CREATE TABLE table_name_16 (pl_gp VARCHAR2, pick__number VARCHAR2, reg_gp VARCHAR2, team__league_ VARCHAR2)
| What is the total number of playoff games played by the Seattle Thunderbirds team where the number of regular games played is less than 5 and pick number is less than 131? | SELECT COUNT(pl_gp) FROM table_name_16 WHERE reg_gp < 5 AND team__league_ = "seattle thunderbirds" AND pick__number < 131 | SELECT COUNT("pl_gp") FROM "table_name_16" WHERE "pick__number" < 131 AND "reg_gp" < 5 AND "seattle thunderbirds" = "team__league_" | 0.12793 |
CREATE TABLE table_59381 ("Week 2" CLOB, "Week 3" CLOB, "Week 4" CLOB, "Week 5" CLOB, "Week 6" CLOB, "Week 7" CLOB)
| What is week 5 when week 2 is 36.80, and week 4 is 39.75? | SELECT "Week 5" FROM table_59381 WHERE "Week 2" = '36.80' AND "Week 4" = '39.75' | SELECT "Week 5" FROM "table_59381" WHERE "Week 2" = '36.80' AND "Week 4" = '39.75' | 0.080078 |
CREATE TABLE table_19635 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Record" CLOB, "Game Site" CLOB, "Attendance" FLOAT)
| What was the attendance in week 8? | SELECT MAX("Attendance") FROM table_19635 WHERE "Week" = '8' | SELECT MAX("Attendance") FROM "table_19635" WHERE "Week" = '8' | 0.060547 |
CREATE TABLE table_72557 ("Rank" CLOB, "Common" CLOB, "Population" FLOAT, "Area ( km 2 ) " CLOB, "Density ( inhabitants/km 2 ) " CLOB, "Altitude ( mslm ) " FLOAT)
| Which common has an area (km2) of 38.38? | SELECT "Common" FROM table_72557 WHERE "Area (km 2 )" = '38.38' | SELECT "Common" FROM "table_72557" WHERE "Area (km 2 )" = '38.38' | 0.063477 |
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
| i want to fly UA from BOSTON to DENVER | 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 WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DENVER' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."to_airport" AND "flight"."airline_code" = 'UA' JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."from_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'BOSTON' | 0.514648 |
CREATE TABLE table_66862 ("Player" CLOB, "Years" CLOB, "Goals" FLOAT, "Assists" FLOAT, "Points" FLOAT)
| How many total points does Mike Hyndman have with more than 119 assists? | SELECT SUM("Points") FROM table_66862 WHERE "Player" = 'mike hyndman' AND "Assists" > '119' | SELECT SUM("Points") FROM "table_66862" WHERE "Assists" > '119' AND "Player" = 'mike hyndman' | 0.09082 |
CREATE TABLE table_name_64 (grid NUMBER, laps VARCHAR2, constructor VARCHAR2)
| What is the high grid total for maserati with under 35 laps? | SELECT MAX(grid) FROM table_name_64 WHERE laps < 35 AND constructor = "maserati" | SELECT MAX("grid") FROM "table_name_64" WHERE "constructor" = "maserati" AND "laps" < 35 | 0.085938 |
CREATE TABLE table_train_103 ("id" NUMBER, "systolic_blood_pressure_sbp" NUMBER, "epilepsy" BOOLEAN, "diastolic_blood_pressure_dbp" NUMBER, "heart_rate" NUMBER, "seizure_disorder" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
| age 35 to 69 | SELECT * FROM table_train_103 WHERE age > 35 AND age < 69 | SELECT * FROM "table_train_103" WHERE "age" < 69 AND "age" > 35 | 0.061523 |
CREATE TABLE table_name_62 (place VARCHAR2, score VARCHAR2)
| What place was the golfer with a score of 67-67-66-68=268 ranked in? | SELECT place FROM table_name_62 WHERE score = 67 - 67 - 66 - 68 = 268 | SELECT "place" FROM "table_name_62" WHERE "score" = FALSE | 0.055664 |
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
| For CS majors what BUDDHST prerequistes needed ? | SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'BUDDHST' | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "program_course" JOIN "course" ON "course"."course_id" = "program_course"."course_id" AND "course"."department" = 'BUDDHST' | 0.197266 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
| how many patients have been discharged from the hospital in just since 2100? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) >= '2100' | SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" WHERE NOT "patient"."hospitaldischargetime" IS NULL AND STRFTIME('%y', "patient"."hospitaldischargetime") >= '2100' | 0.170898 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| how many patients whose age is less than 58 and procedure short title is atrial cardioversion? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "58" AND procedures.short_title = "Atrial cardioversion" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Atrial cardioversion" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "58" > "demographic"."age" | 0.22168 |
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| what were the three most common medications that patients were prescribed within 2 months after receiving a therapeutic antibacterials - vancomycin in this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - vancomycin' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."drugstarttime" > "treatment"."treatmenttime" AND DATETIME("t2"."drugstarttime") <= DATETIME("treatment"."treatmenttime", '+2 month') AND DATETIME("t2"."drugstarttime") >= DATETIME("treatment"."treatmenttime") WHERE "treatment"."treatmentname" = 'therapeutic antibacterials - vancomycin' AND DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 3 | 1.030273 |
CREATE TABLE companies (id NUMBER, name CLOB, headquarters CLOB, industry CLOB, sales_billion NUMBER, profits_billion NUMBER, assets_billion NUMBER, market_value_billion CLOB)
CREATE TABLE office_locations (building_id NUMBER, company_id NUMBER, move_in_year NUMBER)
CREATE TABLE buildings (id NUMBER, name CLOB, city CLOB, height NUMBER, stories NUMBER, status CLOB)
| Which buildings do not have any company office? Give me the building names. | SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM office_locations) | SELECT "name" FROM "buildings" WHERE NOT "id" IN (SELECT "building_id" FROM "office_locations") | 0.092773 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| find out the preferred language and time of admission of the patient jesse ran. | SELECT demographic.language, demographic.admittime FROM demographic WHERE demographic.name = "Jesse Ran" | SELECT "demographic"."language", "demographic"."admittime" FROM "demographic" WHERE "Jesse Ran" = "demographic"."name" | 0.115234 |
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
| how many times does patient 85895 receive a ph test the last month? | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'ph' GROUP BY "itemid"), "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 85895 GROUP BY "hadm_id") SELECT COUNT(*) FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."hadm_id" WHERE DATETIME("labevents"."charttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL | 0.542969 |
CREATE TABLE table_name_85 (opponent VARCHAR2, week VARCHAR2)
| Who was the opponent at the week 4 game? | SELECT opponent FROM table_name_85 WHERE week = 4 | SELECT "opponent" FROM "table_name_85" WHERE "week" = 4 | 0.053711 |
CREATE TABLE table_204_659 (id NUMBER, "seat" CLOB, "state" CLOB, "majority" NUMBER, "member" CLOB, "party" CLOB)
| how many members in total ? | SELECT COUNT("member") FROM table_204_659 | SELECT COUNT("member") FROM "table_204_659" | 0.041992 |
CREATE TABLE table_33585 ("Member" CLOB, "Party" CLOB, "Electorate" CLOB, "State" CLOB, "In office" CLOB)
| In which state is the Petrie electorate? | SELECT "State" FROM table_33585 WHERE "Electorate" = 'petrie' | SELECT "State" FROM "table_33585" WHERE "Electorate" = 'petrie' | 0.061523 |
CREATE TABLE table_43771 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" FLOAT, "To par" CLOB)
| Which To par is scored at 70? | SELECT "To par" FROM table_43771 WHERE "Score" = '70' | SELECT "To par" FROM "table_43771" WHERE "Score" = '70' | 0.053711 |
CREATE TABLE table_12002388_1 (year NUMBER, reg_season VARCHAR2)
| What year did they finish 1st, southern? | SELECT MAX(year) FROM table_12002388_1 WHERE reg_season = "1st, Southern" | SELECT MAX("year") FROM "table_12002388_1" WHERE "1st, Southern" = "reg_season" | 0.077148 |
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| how many days have passed since patient 012-66291 had an admission to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '012-66291' AND patient.hospitaldischargetime IS NULL | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "patient"."hospitaladmittime")) FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '012-66291' | 0.189453 |
CREATE TABLE table_72209 ("Series #" FLOAT, "Season #" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" FLOAT)
| What is the title of the episode with the production code 624? | SELECT "Title" FROM table_72209 WHERE "Production code" = '624' | SELECT "Title" FROM "table_72209" WHERE "Production code" = '624' | 0.063477 |
CREATE TABLE table_53506 ("Rank" FLOAT, "Player" CLOB, "Country" CLOB, "Earnings ( $ ) " FLOAT, "Wins" FLOAT)
| Which country has a rank of 2? | SELECT "Country" FROM table_53506 WHERE "Rank" = '2' | SELECT "Country" FROM "table_53506" WHERE "Rank" = '2' | 0.052734 |
CREATE TABLE table_name_79 (closed VARCHAR2, name VARCHAR2)
| What year did the Caphouse Colliery railway close? | SELECT closed FROM table_name_79 WHERE name = "caphouse colliery" | SELECT "closed" FROM "table_name_79" WHERE "caphouse colliery" = "name" | 0.069336 |
CREATE TABLE table_22384 ("Contestant Name" CLOB, "Episode #" FLOAT, "Date Premiered ( 2009 ) " CLOB, "Winning Amount" CLOB, "Eliminated Contestant" CLOB)
| What contestant was premiered on July 25? | SELECT "Contestant Name" FROM table_22384 WHERE "Date Premiered (2009)" = 'July 25' | SELECT "Contestant Name" FROM "table_22384" WHERE "Date Premiered (2009)" = 'July 25' | 0.083008 |
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| when did patient 96842 first have a diagnosis of pleural effusion nos during the last hospital visit? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pleural effusion nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96842 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY diagnoses_icd.charttime LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 96842 AND NOT "admissions"."dischtime" IS NULL GROUP BY "hadm_id" ORDER BY "admissions"."admittime" DESC FETCH FIRST 1 ROWS ONLY) SELECT "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'pleural effusion nos' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL ORDER BY "diagnoses_icd"."charttime" FETCH FIRST 1 ROWS ONLY | 0.570313 |
CREATE TABLE table_name_6 (score VARCHAR2, leading_scorer VARCHAR2)
| What is Score, when Leading Scorer is Tyrone Hill , 20 Points? | SELECT score FROM table_name_6 WHERE leading_scorer = "tyrone hill , 20 points" | SELECT "score" FROM "table_name_6" WHERE "leading_scorer" = "tyrone hill , 20 points" | 0.083008 |
CREATE TABLE table_name_45 (date_of_birth__age_ VARCHAR2, player VARCHAR2)
| What is the date of birth of Kameli Ratuvou? | SELECT date_of_birth__age_ FROM table_name_45 WHERE player = "kameli ratuvou" | SELECT "date_of_birth__age_" FROM "table_name_45" WHERE "kameli ratuvou" = "player" | 0.081055 |
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
| Find the most voted answers for questions with specific Tag. | SELECT COUNT(Votes.PostId) AS "Vote count", Votes.PostId AS "post_link" FROM Votes INNER JOIN Posts AS answer ON answer.Id = Votes.PostId INNER JOIN PostTags AS PT ON PT.PostId = answer.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE answer.PostTypeId = 2 AND Votes.VoteTypeId = 2 AND answer.Id = Votes.PostId AND T.TagName = '##tagname##' GROUP BY Votes.PostId ORDER BY 'Vote count' DESC LIMIT 100 | SELECT COUNT("Votes"."PostId") AS "Vote count", "Votes"."PostId" AS "post_link" FROM "Votes" JOIN "Posts" "answer" ON "Votes"."PostId" = "answer"."Id" AND "answer"."PostTypeId" = 2 JOIN "PostTags" "PT" ON "PT"."PostId" = "answer"."ParentId" JOIN "Tags" "T" ON "PT"."TagId" = "T"."Id" AND "T"."TagName" = '##tagname##' WHERE "Votes"."VoteTypeId" = 2 GROUP BY "Votes"."PostId" ORDER BY 'Vote count' DESC FETCH FIRST 100 ROWS ONLY | 0.416992 |
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
| when did patient 010-29520 receive potassium lab test for the first time since 105 months ago? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-29520')) AND lab.labname = 'potassium' AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-105 month') ORDER BY lab.labresulttime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '010-29520' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "lab"."labresulttime" FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'potassium' AND DATETIME("lab"."labresulttime") >= DATETIME(CURRENT_TIME(), '-105 month') AND NOT "_u_1"."" IS NULL ORDER BY "lab"."labresulttime" FETCH FIRST 1 ROWS ONLY | 0.638672 |
CREATE TABLE table_name_98 (platform NUMBER, frequency__per_hour_ VARCHAR2, destination VARCHAR2)
| what is the platform when the frequency (per hour) is 4 and the destination is west croydon? | SELECT SUM(platform) FROM table_name_98 WHERE frequency__per_hour_ = 4 AND destination = "west croydon" | SELECT SUM("platform") FROM "table_name_98" WHERE "destination" = "west croydon" AND "frequency__per_hour_" = 4 | 0.108398 |
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| count the number of times patient 010-9767 was tested for albumin this year. | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-9767')) AND lab.labname = 'albumin' 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" = '010-9767' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'albumin' AND DATETIME("lab"."labresulttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL | 0.598633 |
CREATE TABLE table_71732 ("Hull No." FLOAT, "Year" FLOAT, "Project" CLOB, "Length overall in meters ( without bowsprit ) " FLOAT, "Name" CLOB, "Destination" CLOB)
| Name the sum of hull number for italy and year more than 1999 | SELECT SUM("Hull No.") FROM table_71732 WHERE "Destination" = 'italy' AND "Year" > '1999' | SELECT SUM("Hull No.") FROM "table_71732" WHERE "Destination" = 'italy' AND "Year" > '1999' | 0.088867 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
| For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart, and display in desc by the y-axis. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC | SELECT "HIRE_DATE", SUM("DEPARTMENT_ID") FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' ORDER BY SUM("DEPARTMENT_ID") DESC | 0.12207 |
CREATE TABLE table_204_246 (id NUMBER, "department" CLOB, "total deputies" NUMBER, "uninominal deputies" NUMBER, "plurinominal deputies" NUMBER, "special indigenous\ or campesino deputies" NUMBER, "senators" NUMBER)
| does oruro have more or less uninominal deputies than la paz ? | SELECT (SELECT "uninominal deputies" FROM table_204_246 WHERE "department" = 'oruro') > (SELECT "uninominal deputies" FROM table_204_246 WHERE "department" = 'la paz') | SELECT (SELECT "uninominal deputies" FROM "table_204_246" WHERE "department" = 'la paz') < (SELECT "uninominal deputies" FROM "table_204_246" WHERE "department" = 'oruro') | 0.166992 |
CREATE TABLE table_47867 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Result" CLOB, "Record" CLOB)
| WHAT SCORE WAS ON SEPTEMBER 21? | SELECT "Score" FROM table_47867 WHERE "Date" = 'september 21' | SELECT "Score" FROM "table_47867" WHERE "Date" = 'september 21' | 0.061523 |
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
| A bar chart shows the distribution of ACC_Road and Team_ID , and group by attribute All_Home, and I want to show by the names in descending. | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC | SELECT "ACC_Road", "Team_ID" FROM "basketball_match" GROUP BY "All_Home", "ACC_Road" ORDER BY "ACC_Road" DESC | 0.106445 |
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
| When were the top 500 tags created?. | SELECT Tags.TagName, wiki.CreationDate AS "wiki_date", excerpt.CreationDate AS "excerpt_date", MIN(Posts.CreationDate) AS "first_post", COUNT(Tags.TagName) AS Uses FROM (((PostTags INNER JOIN Posts ON PostTags.PostId = Posts.Id) INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts AS wiki ON Tags.WikiPostId = wiki.Id) INNER JOIN Posts AS excerpt ON Tags.ExcerptPostId = excerpt.Id GROUP BY Tags.TagName, wiki.CreationDate, excerpt.CreationDate ORDER BY Uses DESC LIMIT 5000 | SELECT "Tags"."TagName", "wiki"."CreationDate" AS "wiki_date", "excerpt"."CreationDate" AS "excerpt_date", MIN("Posts"."CreationDate") AS "first_post", COUNT("Tags"."TagName") AS "Uses" FROM ((("PostTags" JOIN "Posts" ON "PostTags"."PostId" = "Posts"."Id") JOIN "Tags" ON "PostTags"."TagId" = "Tags"."Id") JOIN "Posts" "wiki" ON "Tags"."WikiPostId" = "wiki"."Id") JOIN "Posts" "excerpt" ON "Tags"."ExcerptPostId" = "excerpt"."Id" GROUP BY "Tags"."TagName", "wiki"."CreationDate", "excerpt"."CreationDate" ORDER BY "Uses" DESC FETCH FIRST 5000 ROWS ONLY | 0.539063 |
CREATE TABLE table_65791 ("Rank" FLOAT, "Summit" CLOB, "Country" CLOB, "Island" CLOB, "Col ( m ) " FLOAT)
| What's the rank when the col (m) is less than 33 and has a summit of Haleakal ? | SELECT SUM("Rank") FROM table_65791 WHERE "Col (m)" < '33' AND "Summit" = 'haleakalā' | SELECT SUM("Rank") FROM "table_65791" WHERE "Col (m)" < '33' AND "Summit" = 'haleakalā' | 0.084961 |
CREATE TABLE table_203_648 (id NUMBER, "date" CLOB, "opposition" CLOB, "result" CLOB, "score" CLOB, "brazil scorers" CLOB, "competition" CLOB)
| what is the number of countries they have played ? | SELECT COUNT(DISTINCT "opposition") FROM table_203_648 | SELECT COUNT(DISTINCT "opposition") FROM "table_203_648" | 0.054688 |
CREATE TABLE table_1817852_1 (destroyed VARCHAR2, survived VARCHAR2)
| If there were 14 in 1990 and 6 survived how many were destroyed? | SELECT destroyed FROM table_1817852_1 WHERE 1990 = 14 AND survived = 6 | SELECT "destroyed" FROM "table_1817852_1" WHERE FALSE | 0.051758 |
CREATE TABLE table_name_35 (manufacturer VARCHAR2, time_retired VARCHAR2)
| Which manufacturer has a Time/Retired of +15.665? | SELECT manufacturer FROM table_name_35 WHERE time_retired = "+15.665" | SELECT "manufacturer" FROM "table_name_35" WHERE "+15.665" = "time_retired" | 0.073242 |
CREATE TABLE table_name_73 (cfl_team VARCHAR2, college VARCHAR2)
| Which team picked a player(s) from South Carolina? | SELECT cfl_team FROM table_name_73 WHERE college = "south carolina" | SELECT "cfl_team" FROM "table_name_73" WHERE "college" = "south carolina" | 0.071289 |
CREATE TABLE table_46450 ("Tournament" CLOB, "1984" CLOB, "1985" CLOB, "1986" CLOB, "1987" CLOB, "1988" CLOB, "1989" CLOB, "1990" CLOB, "1991" CLOB, "1992" CLOB, "1993" CLOB, "1994" CLOB, "1995" CLOB, "1996" CLOB, "1997" CLOB, "1998" CLOB, "1999" CLOB, "2000" CLOB)
| What is the 1989 value with F in 1990? | SELECT "1989" FROM table_46450 WHERE "1990" = 'f' | SELECT "1989" FROM "table_46450" WHERE "1990" = 'f' | 0.049805 |
CREATE TABLE table_39233 ("Nation" CLOB, "T Score" FLOAT, "A Score" FLOAT, "E Score" FLOAT, "Total" FLOAT)
| What is the total of the team with a T score greater than 8 and an E score less than 8.4? | SELECT SUM("Total") FROM table_39233 WHERE "T Score" > '8' AND "E Score" < '8.4' | SELECT SUM("Total") FROM "table_39233" WHERE "E Score" < '8.4' AND "T Score" > '8' | 0.080078 |
CREATE TABLE table_33405 ("Year" FLOAT, "Chassis" CLOB, "Engine" CLOB, "Start" CLOB, "Finish" CLOB, "Team" CLOB)
| What engine was used by the team the finished 2nd? | SELECT "Engine" FROM table_33405 WHERE "Finish" = '2nd' | SELECT "Engine" FROM "table_33405" WHERE "Finish" = '2nd' | 0.055664 |
CREATE TABLE table_15831 ("Tournament" CLOB, "Wins" FLOAT, "Top-5" FLOAT, "Top-25" FLOAT, "Events" FLOAT, "Cuts made" FLOAT)
| what is the top-5 when the tournament is totals and the top-25 is more than 4? | SELECT AVG("Top-5") FROM table_15831 WHERE "Tournament" = 'totals' AND "Top-25" > '4' | SELECT AVG("Top-5") FROM "table_15831" WHERE "Top-25" > '4' AND "Tournament" = 'totals' | 0.084961 |
CREATE TABLE table_52899 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| Which venue has an Away team score of 18.9 (117)? | SELECT "Venue" FROM table_52899 WHERE "Away team score" = '18.9 (117)' | SELECT "Venue" FROM "table_52899" WHERE "Away team score" = '18.9 (117)' | 0.070313 |
CREATE TABLE table_54875 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Decision" CLOB, "Record" CLOB)
| What was the decision when Tampa Bay was the visitor? | SELECT "Decision" FROM table_54875 WHERE "Visitor" = 'tampa bay' | SELECT "Decision" FROM "table_54875" WHERE "Visitor" = 'tampa bay' | 0.064453 |
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
| what are the four most commonly ordered procedures for patients who have received vitamin k during the same hospital visit previously since 2100? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'vitamin k' AND STRFTIME('%y', treatment.treatmenttime) >= '2100') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', treatment.treatmenttime) >= '2100') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.treatmenttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "treatment"."treatmentname", "treatment"."treatmenttime", "patient"."patienthealthsystemstayid" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE STRFTIME('%y', "treatment"."treatmenttime") >= '2100'), "t3" AS (SELECT "t2"."treatmentname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" "t2" ON "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" AND "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."treatmenttime" > "treatment"."treatmenttime" WHERE "treatment"."treatmentname" = 'vitamin k' AND STRFTIME('%y', "treatment"."treatmenttime") >= '2100' GROUP BY "t2"."treatmentname") SELECT "t3"."treatmentname" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.859375 |
CREATE TABLE table_64607 ("Rank" FLOAT, "Artist" CLOB, "Album" CLOB, "Peak position" CLOB, "Sales" FLOAT, "Certification" CLOB)
| What was the album Closer: The Best of Sarah Mclachlan certified as? | SELECT "Certification" FROM table_64607 WHERE "Album" = 'closer: the best of sarah mclachlan' | SELECT "Certification" FROM "table_64607" WHERE "Album" = 'closer: the best of sarah mclachlan' | 0.092773 |
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
| 483 is how large ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 483 | SELECT DISTINCT "num_enrolled" FROM "course" WHERE "department" = 'EECS' AND "number" = 483 | 0.088867 |
CREATE TABLE people (Name VARCHAR2, People_ID VARCHAR2)
CREATE TABLE body_builder (People_ID VARCHAR2)
| What are the names of body builders? | SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID | SELECT "T2"."Name" FROM "body_builder" "T1" JOIN "people" "T2" ON "T1"."People_ID" = "T2"."People_ID" | 0.098633 |
CREATE TABLE Dorm (dormid NUMBER, dorm_name VARCHAR2, student_capacity NUMBER, gender VARCHAR2)
CREATE TABLE Student (StuID NUMBER, LName VARCHAR2, Fname VARCHAR2, Age NUMBER, Sex VARCHAR2, Major NUMBER, Advisor NUMBER, city_code VARCHAR2)
CREATE TABLE Dorm_amenity (amenid NUMBER, amenity_name VARCHAR2)
CREATE TABLE Lives_in (stuid NUMBER, dormid NUMBER, room_number NUMBER)
CREATE TABLE Has_amenity (dormid NUMBER, amenid NUMBER)
| A bar chart about how many students are older than average for each gender?, and display X from low to high order. | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex | SELECT "Sex", COUNT(*) FROM "Student" WHERE "Age" > (SELECT AVG("Age") FROM "Student") GROUP BY "Sex" ORDER BY "Sex" | 0.113281 |
CREATE TABLE table_12983 ("Election" CLOB, "1st Member" CLOB, "1st Party" CLOB, "2nd Member" CLOB, "2nd Party" CLOB)
| Which 2nd Party has a Election of 1857? | SELECT "2nd Party" FROM table_12983 WHERE "Election" = '1857' | SELECT "2nd Party" FROM "table_12983" WHERE "Election" = '1857' | 0.061523 |
CREATE TABLE table_name_18 (rowers VARCHAR2, time VARCHAR2)
| Who were the rowers who had a time of 7:39.70? | SELECT rowers FROM table_name_18 WHERE time = "7:39.70" | SELECT "rowers" FROM "table_name_18" WHERE "7:39.70" = "time" | 0.05957 |
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| how many days have elapsed since the last time in their current hospital visit patient 42829 has been given a white blood cells lab test? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42829 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'white blood cells' GROUP BY "itemid"), "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 42829 GROUP BY "hadm_id") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "labevents"."charttime")) FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY | 0.612305 |
CREATE TABLE table_name_47 (pick VARCHAR2, school_club_team VARCHAR2)
| How many picks does Auburn have? | SELECT COUNT(pick) FROM table_name_47 WHERE school_club_team = "auburn" | SELECT COUNT("pick") FROM "table_name_47" WHERE "auburn" = "school_club_team" | 0.075195 |
CREATE TABLE Course_Authors_and_Tutors (author_id NUMBER, author_tutor_ATB VARCHAR2, login_name VARCHAR2, password VARCHAR2, personal_name VARCHAR2, middle_name VARCHAR2, family_name VARCHAR2, gender_mf VARCHAR2, address_line_1 VARCHAR2)
CREATE TABLE Subjects (subject_id NUMBER, subject_name VARCHAR2)
CREATE TABLE Courses (course_id NUMBER, author_id NUMBER, subject_id NUMBER, course_name VARCHAR2, course_description VARCHAR2)
CREATE TABLE Students (student_id NUMBER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR2, password VARCHAR2, personal_name VARCHAR2, middle_name VARCHAR2, family_name VARCHAR2)
CREATE TABLE Student_Tests_Taken (registration_id NUMBER, date_test_taken DATETIME, test_result VARCHAR2)
CREATE TABLE Student_Course_Enrolment (registration_id NUMBER, student_id NUMBER, course_id NUMBER, date_of_enrolment DATETIME, date_of_completion DATETIME)
| What is the relationship between author_id and author_tutor_ATB ? | SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | SELECT "author_id", "author_tutor_ATB" FROM "Course_Authors_and_Tutors" ORDER BY "personal_name" | 0.09375 |
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
| what is the average total hospital cost that includes the phenytoin, free lab test? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phenytoin, free')) GROUP BY cost.hadm_id) AS t1 | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'phenytoin, free' GROUP BY "itemid"), "_u_1" AS (SELECT "labevents"."hadm_id" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" WHERE NOT "_u_0"."" IS NULL GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."hadm_id" WHERE NOT "_u_1"."" IS NULL GROUP BY "cost"."hadm_id") SELECT AVG("t1"."c1") FROM "t1" "t1" | 0.486328 |
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
| how much was the total hospital bill of patient 018-47575 during the stay on the last hospital encounter? | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-47575' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '018-47575' AND NOT "patient"."hospitaldischargetime" IS NULL GROUP BY "patienthealthsystemstayid" ORDER BY "patient"."hospitaladmittime" DESC FETCH FIRST 1 ROWS ONLY) SELECT SUM("cost"."cost") FROM "cost" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "cost"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL | 0.40332 |
CREATE TABLE table_1341598_10 (result VARCHAR2, district VARCHAR2)
| What was the result of the election in the Florida 18 district? | SELECT result FROM table_1341598_10 WHERE district = "Florida 18" | SELECT "result" FROM "table_1341598_10" WHERE "Florida 18" = "district" | 0.069336 |
CREATE TABLE table_203_461 (id NUMBER, "dvd title" CLOB, "discs" NUMBER, "year" CLOB, "no. of ep." NUMBER, "dvd release\ region 2" CLOB, "dvd release\ region 4" CLOB)
| total number of episodes released in region 2 in 2007 | SELECT SUM("no. of ep.") FROM table_203_461 WHERE "dvd release\nregion 2" = 2007 | SELECT SUM("no. of ep.") FROM "table_203_461" WHERE "dvd release\nregion 2" = 2007 | 0.080078 |
CREATE TABLE prereq (course_id CLOB, prereq_id CLOB)
CREATE TABLE student (id CLOB, name CLOB, dept_name CLOB, tot_cred NUMBER)
CREATE TABLE course (course_id CLOB, title CLOB, dept_name CLOB, credits NUMBER)
CREATE TABLE teaches (id CLOB, course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER)
CREATE TABLE takes (id CLOB, course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER, grade CLOB)
CREATE TABLE department (dept_name CLOB, building CLOB, budget NUMBER)
CREATE TABLE classroom (building CLOB, room_number CLOB, capacity NUMBER)
CREATE TABLE advisor (s_id CLOB, i_id CLOB)
CREATE TABLE time_slot (time_slot_id CLOB, day CLOB, start_hr NUMBER, start_min NUMBER, end_hr NUMBER, end_min NUMBER)
CREATE TABLE instructor (id CLOB, name CLOB, dept_name CLOB, salary NUMBER)
CREATE TABLE section (course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER, building CLOB, room_number CLOB, time_slot_id CLOB)
| Find the names of all instructors in Comp. Sci. department with salary > 80000. | SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000 | SELECT "name" FROM "instructor" WHERE "dept_name" = 'Comp. Sci.' AND "salary" > 80000 | 0.083008 |
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
| what lab test in 12/this year was given to patient 99647 for the first time? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99647) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', labevents.charttime) = '12' ORDER BY labevents.charttime LIMIT 1) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 99647 GROUP BY "hadm_id"), "_u_1" AS (SELECT "labevents"."itemid" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."hadm_id" WHERE DATETIME("labevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL AND STRFTIME('%m', "labevents"."charttime") = '12' GROUP BY "itemid" ORDER BY "labevents"."charttime" FETCH FIRST 1 ROWS ONLY) SELECT "d_labitems"."label" FROM "d_labitems" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_labitems"."itemid" WHERE NOT "_u_1"."" IS NULL | 0.625977 |
CREATE TABLE table_40269 ("Year" CLOB, "Team" CLOB, "Comp" CLOB, "Long" CLOB, "Rate" CLOB, "RAtt" CLOB, "RYds" CLOB, "RAvg" CLOB, "Lost" CLOB)
| What is the RAtt when the comp is 48? | SELECT "RAtt" FROM table_40269 WHERE "Comp" = '48' | SELECT "RAtt" FROM "table_40269" WHERE "Comp" = '48' | 0.050781 |
CREATE TABLE table_13644 ("Team 1" CLOB, "Agg." CLOB, "Team 2" CLOB, "1st leg" CLOB, "2nd leg" CLOB)
| Who is team 1 with an agg of 2-5? | SELECT "Team 1" FROM table_13644 WHERE "Agg." = '2-5' | SELECT "Team 1" FROM "table_13644" WHERE "Agg." = '2-5' | 0.053711 |
CREATE TABLE table_203_853 (id NUMBER, "date" CLOB, "opponent" CLOB, "home/away" CLOB, "field" CLOB, "result" CLOB)
| what was the difference in score between the barrage and the lizards on june 2 . | SELECT ABS("result" - "result") FROM table_203_853 WHERE "date" = 'june 2' | SELECT ABS("result" - "result") FROM "table_203_853" WHERE "date" = 'june 2' | 0.074219 |
CREATE TABLE table_64399 ("Season" FLOAT, "Series" CLOB, "Team" CLOB, "Races" CLOB, "Wins" CLOB, "Poles" CLOB, "F/Laps" CLOB, "Podiums" CLOB, "Points" CLOB, "Position" CLOB)
| What Podiums listing has a World Rally Championship series entry? | SELECT "Podiums" FROM table_64399 WHERE "Series" = 'world rally championship' | SELECT "Podiums" FROM "table_64399" WHERE "Series" = 'world rally championship' | 0.077148 |
CREATE TABLE table_36972 ("Club" CLOB, "Played" CLOB, "Drawn" CLOB, "Lost" CLOB, "Points for" CLOB, "Points against" CLOB, "Tries for" CLOB, "Tries against" CLOB, "Try bonus" CLOB, "Losing bonus" CLOB, "Points" CLOB)
| Which Drawn has a Lost of 19? | SELECT "Drawn" FROM table_36972 WHERE "Lost" = '19' | SELECT "Drawn" FROM "table_36972" WHERE "Lost" = '19' | 0.051758 |
CREATE TABLE endowment (amount VARCHAR2, donator_name VARCHAR2)
| List the amount and donor name for the largest amount of donation. | SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1 | SELECT "amount", "donator_name" FROM "endowment" ORDER BY "amount" DESC FETCH FIRST 1 ROWS ONLY | 0.092773 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| how many times does patient 017-7283 get a mchc test during the last hospital visit? | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-7283' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND lab.labname = 'mchc' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '017-7283' AND NOT "patient"."hospitaldischargetime" IS NULL GROUP BY "patienthealthsystemstayid" ORDER BY "patient"."hospitaladmittime" DESC FETCH FIRST 1 ROWS ONLY), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'mchc' AND NOT "_u_1"."" IS NULL | 0.605469 |
CREATE TABLE table_18303274_1 (fastest_lap VARCHAR2, grand_prix VARCHAR2)
| Who had the fastest lap in the Dutch TT Grand Prix? | SELECT fastest_lap FROM table_18303274_1 WHERE grand_prix = "Dutch TT" | SELECT "fastest_lap" FROM "table_18303274_1" WHERE "Dutch TT" = "grand_prix" | 0.074219 |
CREATE TABLE table_12677 ("Tries" FLOAT, "Player" CLOB, "Opponent" CLOB, "Score" CLOB, "Venue" CLOB, "Round" CLOB)
| What round is player phil graham in? | SELECT "Round" FROM table_12677 WHERE "Player" = 'phil graham' | SELECT "Round" FROM "table_12677" WHERE "Player" = 'phil graham' | 0.0625 |
CREATE TABLE table_20304 ("#" FLOAT, "Advocate # 1" CLOB, "Advocate # 2" CLOB, "Root of All Evil" CLOB, "Poll winner" CLOB, "Original air date" CLOB)
| How many times did drinking games win the poll? | SELECT COUNT("#") FROM table_20304 WHERE "Poll winner" = 'Drinking Games' | SELECT COUNT("#") FROM "table_20304" WHERE "Poll winner" = 'Drinking Games' | 0.073242 |
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
| Ljudi iz bosne na SO. | SELECT u.DisplayName, u.Location FROM Users AS u WHERE u.Location LIKE '%Bosnia%' ORDER BY u.Location | SELECT "u"."DisplayName", "u"."Location" FROM "Users" "u" WHERE "u"."Location" LIKE '%Bosnia%' ORDER BY "u"."Location" | 0.115234 |
CREATE TABLE weather (date CLOB, max_temperature_f NUMBER, mean_temperature_f NUMBER, min_temperature_f NUMBER, max_dew_point_f NUMBER, mean_dew_point_f NUMBER, min_dew_point_f NUMBER, max_humidity NUMBER, mean_humidity NUMBER, min_humidity NUMBER, max_sea_level_pressure_inches NUMBER, mean_sea_level_pressure_inches NUMBER, min_sea_level_pressure_inches NUMBER, max_visibility_miles NUMBER, mean_visibility_miles NUMBER, min_visibility_miles NUMBER, max_wind_Speed_mph NUMBER, mean_wind_speed_mph NUMBER, max_gust_speed_mph NUMBER, precipitation_inches NUMBER, cloud_cover NUMBER, events CLOB, wind_dir_degrees NUMBER, zip_code NUMBER)
CREATE TABLE trip (id NUMBER, duration NUMBER, start_date CLOB, start_station_name CLOB, start_station_id NUMBER, end_date CLOB, end_station_name CLOB, end_station_id NUMBER, bike_id NUMBER, subscription_type CLOB, zip_code NUMBER)
CREATE TABLE status (station_id NUMBER, bikes_available NUMBER, docks_available NUMBER, time CLOB)
CREATE TABLE station (id NUMBER, name CLOB, lat NUMBER, long NUMBER, dock_count NUMBER, city CLOB, installation_date CLOB)
| What are the number of the dates with a maximum temperature higher than 85?, and order by the X from low to high. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date | SELECT "date", COUNT("date") FROM "weather" WHERE "max_temperature_f" > 85 GROUP BY "date" ORDER BY "date" | 0.103516 |
CREATE TABLE table_79553 ("Title" CLOB, "Series" CLOB, "Director" CLOB, "Production Number" FLOAT, "Release date" CLOB)
| What is the production number for the episode directed by Robert McKimson named Mice Follies? | SELECT COUNT("Production Number") FROM table_79553 WHERE "Director" = 'robert mckimson' AND "Title" = 'mice follies' | SELECT COUNT("Production Number") FROM "table_79553" WHERE "Director" = 'robert mckimson' AND "Title" = 'mice follies' | 0.115234 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| for patients id 83678, specify the time and type of admission | SELECT demographic.admission_type, demographic.admittime FROM demographic WHERE demographic.subject_id = "83678" | SELECT "demographic"."admission_type", "demographic"."admittime" FROM "demographic" WHERE "83678" = "demographic"."subject_id" | 0.123047 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| what is the number of patients whose religion is jewish and diagnoses long title is diabetes with ophthalmic manifestations, type ii or unspecified type, not stated as uncontrolled? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "JEWISH" AND diagnoses.long_title = "Diabetes with ophthalmic manifestations, type II or unspecified type, not stated as uncontrolled" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Diabetes with ophthalmic manifestations, type II or unspecified type, not stated as uncontrolled" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "JEWISH" = "demographic"."religion" | 0.300781 |
CREATE TABLE table_train_85 ("id" NUMBER, "mini_mental_state_examination_mmse" NUMBER, "elevated_serum_phenylalanine" NUMBER, "elevated_creatinine" FLOAT, "renal_disease" BOOLEAN, "geriatric_depression_scale_gds" NUMBER, "NOUSE" FLOAT)
| mini _ mental status exam score < 25 . | SELECT * FROM table_train_85 WHERE mini_mental_state_examination_mmse < 25 | SELECT * FROM "table_train_85" WHERE "mini_mental_state_examination_mmse" < 25 | 0.076172 |
CREATE TABLE table_25344 ("Series #" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Prod. code" FLOAT)
| Who wrote the episode titled 'Christmas'? | SELECT "Written by" FROM table_25344 WHERE "Title" = 'Christmas' | SELECT "Written by" FROM "table_25344" WHERE "Title" = 'Christmas' | 0.064453 |
CREATE TABLE table_11734041_16 (player VARCHAR2, school_club_team_country VARCHAR2)
| What are the players that attented long beach state? | SELECT player FROM table_11734041_16 WHERE school_club_team_country = "Long Beach State" | SELECT "player" FROM "table_11734041_16" WHERE "Long Beach State" = "school_club_team_country" | 0.091797 |
CREATE TABLE table_67247 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Decision" CLOB, "Attendance" FLOAT, "Record" CLOB)
| Who was the visitor on January 24? | SELECT "Visitor" FROM table_67247 WHERE "Date" = 'january 24' | SELECT "Visitor" FROM "table_67247" WHERE "Date" = 'january 24' | 0.061523 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.