schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE has_amenity (dormid DECIMAL, amenid DECIMAL)
CREATE TABLE dorm_amenity (amenid DECIMAL, amenity_name TEXT)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE lives_in (stuid DECIMAL, dormid DECIMAL, room_number DECIMAL)
CREATE TABLE dorm (dormid DECIMAL, dorm_name TEXT, student_capacity DECIMAL, gender TEXT)
| Find the name of amenities Smith Hall dorm have. ordered the results by amenity names. | SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name | SELECT "T3"."amenity_name" FROM "dorm" AS "T1" JOIN "has_amenity" AS "T2" ON "T1"."dormid" = "T2"."dormid" JOIN "dorm_amenity" AS "T3" ON "T2"."amenid" = "T3"."amenid" WHERE "T1"."dorm_name" = 'Smith Hall' ORDER BY "T3"."amenity_name" NULLS FIRST | 0.240234 |
CREATE TABLE table_203_393 (id DECIMAL, "year" DECIMAL, "film" TEXT, "director" TEXT, "cast" TEXT, "details" TEXT)
| which film came directly after aaha ? | SELECT "film" FROM table_203_393 WHERE id = (SELECT id FROM table_203_393 WHERE "film" = 'aaha') - 1 | SELECT "film" FROM "table_203_393" WHERE "id" = (SELECT "id" FROM "table_203_393" WHERE "film" = 'aaha') - 1 | 0.105469 |
CREATE TABLE table_name_83 (month VARCHAR, year VARCHAR, album VARCHAR)
| What month before 1973 is listed for the album united we stand? | SELECT month FROM table_name_83 WHERE year < 1973 AND album = "united we stand" | SELECT "month" FROM "table_name_83" WHERE "album" = "united we stand" AND "year" < 1973 | 0.084961 |
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
| how many hours has it been since the last time sodium bicarbonate was prescribed to patient 10811 during their current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'sodium bicarbonate' ORDER BY prescriptions.startdate DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 10811 GROUP BY "hadm_id") SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "prescriptions"."startdate")) FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'sodium bicarbonate' AND NOT "_u_0"."" IS NULL ORDER BY "prescriptions"."startdate" DESC NULLS LAST LIMIT 1 | 0.467773 |
CREATE TABLE table_43146 ("Year" FLOAT, "Men's singles" TEXT, "Women's singles" TEXT, "Men's doubles" TEXT, "Women's doubles" TEXT, "Mixed doubles" TEXT)
| What is the mean year when the women's doubles team was helena turcinkov / buresov ? | SELECT AVG("Year") FROM table_43146 WHERE "Women's doubles" = 'helena turcinková / buresová' | SELECT AVG("Year") FROM "table_43146" WHERE "Women's doubles" = 'helena turcinková / buresová' | 0.091797 |
CREATE TABLE Staff (staff_id INT, staff_address_id INT, nickname VARCHAR, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_of_birth DATETIME, date_joined_staff DATETIME, date_left_staff DATETIME)
CREATE TABLE Customer_Payments (customer_id INT, datetime_payment DATETIME, payment_method_code VARCHAR, amount_payment DOUBLE)
CREATE TABLE Customers (customer_id INT, customer_address_id INT, customer_status_code VARCHAR, date_became_customer DATETIME, date_of_birth DATETIME, first_name VARCHAR, last_name VARCHAR, amount_outstanding DOUBLE, email_address VARCHAR, phone_number VARCHAR, cell_mobile_phone_number VARCHAR)
CREATE TABLE Vehicles (vehicle_id INT, vehicle_details VARCHAR)
CREATE TABLE Lessons (lesson_id INT, customer_id INT, lesson_status_code VARCHAR, staff_id INT, vehicle_id INT, lesson_date DATETIME, lesson_time VARCHAR, price DOUBLE)
CREATE TABLE Addresses (address_id INT, line_1_number_building VARCHAR, city VARCHAR, zip_postcode VARCHAR, state_province_county VARCHAR, country VARCHAR)
| List all payment methods and number of payments using each payment methods Plot them as bar chart, sort by the Y in descending. | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY COUNT(*) DESC | SELECT "payment_method_code", COUNT(*) FROM "Customer_Payments" GROUP BY "payment_method_code" ORDER BY COUNT(*) DESC NULLS LAST | 0.125 |
CREATE TABLE table_79695 ("Tournament" TEXT, "Wins" FLOAT, "Top-10" FLOAT, "Top-25" FLOAT, "Events" FLOAT, "Cuts made" FLOAT)
| What is the total number of cuts made for events played more than 3 times and under 2 top-25s? | SELECT COUNT("Cuts made") FROM table_79695 WHERE "Events" > '3' AND "Top-25" < '2' | SELECT COUNT("Cuts made") FROM "table_79695" WHERE "Events" > '3' AND "Top-25" < '2' | 0.082031 |
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
| How many 10 -credit classes are upper-level classes ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 10 AND program_course.category LIKE 'ULCS' | SELECT COUNT(DISTINCT "course"."course_id") FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE 'ULCS' WHERE "course"."credits" = 10 | 0.203125 |
CREATE TABLE table_name_53 (ranking INT, nationality VARCHAR, years VARCHAR)
| What was the average ranking of Saudi Arabia in the years of 2000 ? | SELECT AVG(ranking) FROM table_name_53 WHERE nationality = "saudi arabia" AND years = "2000–" | SELECT AVG("ranking") FROM "table_name_53" WHERE "2000–" = "years" AND "nationality" = "saudi arabia" | 0.098633 |
CREATE TABLE table_62248 ("Tie no" TEXT, "Home team" TEXT, "Score" TEXT, "Away team" TEXT, "Date" TEXT)
| What is Date, when Tie no is '37'? | SELECT "Date" FROM table_62248 WHERE "Tie no" = '37' | SELECT "Date" FROM "table_62248" WHERE "Tie no" = '37' | 0.052734 |
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
| For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute name, order in ascending by the Y. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code | SELECT "T1"."Name", "T1"."Code" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name", "T1"."Name" ORDER BY "T1"."Code" NULLS FIRST | 0.183594 |
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
| Find answer based on given keyword.. | SELECT p.Id AS "post_link", p.Body FROM Posts AS p WHERE p.Body LIKE '%##keyword##%' AND PostTypeId = 2 AND LENGTH(Body) <= 150 AND p.Id > (SELECT MAX(p2.Id) - 4000000 FROM Posts AS p2) LIMIT 100 | WITH "_u_0" AS (SELECT MAX("p2"."Id") - 4000000 FROM "Posts" AS "p2") SELECT "p"."Id" AS "post_link", "p"."Body" FROM "Posts" AS "p" JOIN "_u_0" AS "_u_0" ON "_u_0"."" < "p"."Id" WHERE "PostTypeId" = 2 AND "p"."Body" LIKE '%##keyword##%' AND LENGTH("Body") <= 150 LIMIT 100 | 0.266602 |
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
| okay and then from PITTSBURGH i'd like to travel to ATLANTA on 9 4 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND date_day.day_number = 4 AND date_day.month_number = 9 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 4 AND "date_day"."month_number" = 9 AND "date_day"."year" = 1991 JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'PITTSBURGH' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'ATLANTA' | 0.707031 |
CREATE TABLE table_57206 ("Rank" FLOAT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| What is the average total of Italy and has a bronze larger than 1? | SELECT AVG("Total") FROM table_57206 WHERE "Nation" = 'italy' AND "Bronze" > '1' | SELECT AVG("Total") FROM "table_57206" WHERE "Bronze" > '1' AND "Nation" = 'italy' | 0.080078 |
CREATE TABLE table_64947 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
| What country is Larry Mize from? | SELECT "Country" FROM table_64947 WHERE "Player" = 'larry mize' | SELECT "Country" FROM "table_64947" WHERE "Player" = 'larry mize' | 0.063477 |
CREATE TABLE table_59691 ("Tournament" TEXT, "1990" TEXT, "1991" TEXT, "1992" TEXT, "1993" TEXT, "1994" TEXT, "1995" TEXT, "1996" TEXT, "1997" TEXT, "1998" TEXT, "Career SR" TEXT, "Career Win-Loss" TEXT)
| Madrid (Stuttgart) tournament with a 1996 of A has this for a Career SR? | SELECT "Career SR" FROM table_59691 WHERE "1996" = 'a' AND "Tournament" = 'madrid (stuttgart)' | SELECT "Career SR" FROM "table_59691" WHERE "1996" = 'a' AND "Tournament" = 'madrid (stuttgart)' | 0.09375 |
CREATE TABLE table_name_16 (score VARCHAR, opponent VARCHAR, date VARCHAR)
| What Score has an Opponent of @ Blue Jays with a Date of June 7? | SELECT score FROM table_name_16 WHERE opponent = "@ blue jays" AND date = "june 7" | SELECT "score" FROM "table_name_16" WHERE "@ blue jays" = "opponent" AND "date" = "june 7" | 0.087891 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is minimum days of hospital stay of patients whose admission year is greater than or equal to 2179? | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2179" | SELECT MIN("demographic"."days_stay") FROM "demographic" WHERE "2179" <= "demographic"."admityear" | 0.095703 |
CREATE TABLE table_15749 ("Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Prod. code" FLOAT)
| Who wrote the episode that was directed by dan lerner? | SELECT "Written by" FROM table_15749 WHERE "Directed by" = 'dan lerner' | SELECT "Written by" FROM "table_15749" WHERE "Directed by" = 'dan lerner' | 0.071289 |
CREATE TABLE table_name_8 (rank VARCHAR, nation VARCHAR, silver VARCHAR)
| What is the total rank for the Netherlands when more than 2 silver medals were won? | SELECT COUNT(rank) FROM table_name_8 WHERE nation = "netherlands" AND silver > 2 | SELECT COUNT("rank") FROM "table_name_8" WHERE "nation" = "netherlands" AND "silver" > 2 | 0.085938 |
CREATE TABLE table_39987 ("Television service" TEXT, "Language" TEXT, "Content" TEXT, "HDTV" TEXT, "Package/Option" TEXT)
| What package/option has documentaries as the content, yes as the HDTV, and a television service of history hd? | SELECT "Package/Option" FROM table_39987 WHERE "Content" = 'documentaries' AND "HDTV" = 'yes' AND "Television service" = 'history hd' | SELECT "Package/Option" FROM "table_39987" WHERE "Content" = 'documentaries' AND "HDTV" = 'yes' AND "Television service" = 'history hd' | 0.131836 |
CREATE TABLE Customer_Orders (order_id INT, customer_id INT, order_status_code VARCHAR, shipping_method_code VARCHAR, order_placed_datetime DATETIME, order_delivered_datetime DATETIME, order_shipping_charges VARCHAR)
CREATE TABLE Premises (premise_id INT, premises_type VARCHAR, premise_details VARCHAR)
CREATE TABLE Order_Items (item_id INT, order_item_status_code VARCHAR, order_id INT, product_id INT, item_status_code VARCHAR, item_delivered_datetime DATETIME, item_order_quantity VARCHAR)
CREATE TABLE Products (product_id INT, product_category VARCHAR, product_name VARCHAR)
CREATE TABLE Mailshot_Customers (mailshot_id INT, customer_id INT, outcome_code VARCHAR, mailshot_customer_date DATETIME)
CREATE TABLE Mailshot_Campaigns (mailshot_id INT, product_category VARCHAR, mailshot_name VARCHAR, mailshot_start_date DATETIME, mailshot_end_date DATETIME)
CREATE TABLE Customer_Addresses (customer_id INT, premise_id INT, date_address_from DATETIME, address_type_code VARCHAR, date_address_to DATETIME)
CREATE TABLE Customers (customer_id INT, payment_method VARCHAR, customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_address VARCHAR, customer_login VARCHAR, customer_password VARCHAR)
| Show the of customer addresses and group by premises type and address type code in a stacked bar chart. The x-axis is premises type. | SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY address_type_code, premises_type | SELECT "premises_type", COUNT("premises_type") FROM "Customer_Addresses" AS "T1" JOIN "Premises" AS "T2" ON "T1"."premise_id" = "T2"."premise_id" GROUP BY "address_type_code", "premises_type" | 0.186523 |
CREATE TABLE table_name_19 (sixth_place VARCHAR, fifth_place VARCHAR)
| Who was sixth place when Hugo Salazar was fifth place? | SELECT sixth_place FROM table_name_19 WHERE fifth_place = "hugo salazar" | SELECT "sixth_place" FROM "table_name_19" WHERE "fifth_place" = "hugo salazar" | 0.076172 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| which ethnic background does the patient with patient id 6983 belong to? | SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = "6983" | SELECT "demographic"."ethnicity" FROM "demographic" WHERE "6983" = "demographic"."subject_id" | 0.09082 |
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| how many days has it been since patient 15447 first stayed during this hospital encounter in the ward 23? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL)) AND transfers.wardid = 23 ORDER BY transfers.intime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 15447 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "transfers"."intime")) FROM "transfers" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "transfers"."icustay_id" WHERE "transfers"."wardid" = 23 AND NOT "_u_1"."" IS NULL ORDER BY "transfers"."intime" NULLS FIRST LIMIT 1 | 0.59375 |
CREATE TABLE table_5582 ("Round" FLOAT, "Pick #" FLOAT, "Overall" FLOAT, "Name" TEXT, "Position" TEXT, "College" TEXT)
| Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5? | SELECT MAX("Pick #") FROM table_5582 WHERE "Name" = 'william middleton' AND "Round" > '5' | SELECT MAX("Pick #") FROM "table_5582" WHERE "Name" = 'william middleton' AND "Round" > '5' | 0.088867 |
CREATE TABLE table_name_31 (played VARCHAR, points_for VARCHAR)
| How many matches were played by the team that has 473 points for? | SELECT played FROM table_name_31 WHERE points_for = "473" | SELECT "played" FROM "table_name_31" WHERE "473" = "points_for" | 0.061523 |
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
| patient 80858 until 2104 has been admitted to the hospital? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 80858 AND STRFTIME('%y', admissions.admittime) <= '2104' | SELECT COUNT(*) > 0 FROM "admissions" WHERE "admissions"."subject_id" = 80858 AND STRFTIME('%y', "admissions"."admittime") <= '2104' | 0.128906 |
CREATE TABLE wedding (Church_ID INT, Male_ID INT, Female_ID INT, Year INT)
CREATE TABLE church (Church_ID INT, Name TEXT, Organized_by TEXT, Open_Date INT, Continuation_of TEXT)
CREATE TABLE people (People_ID INT, Name TEXT, Country TEXT, Is_Male TEXT, Age INT)
| Show me a line chart of how the number of open date change over the open date, list by the Open_Date in desc please. | SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date ORDER BY Open_Date DESC | SELECT "Open_Date", COUNT("Open_Date") FROM "church" GROUP BY "Open_Date" ORDER BY "Open_Date" DESC NULLS LAST | 0.107422 |
CREATE TABLE table_66113 ("Japanese Title" TEXT, "Romaji Title" TEXT, "TV Station" TEXT, "Episodes" FLOAT, "Average Ratings" TEXT)
| What is the episode on NHK with average ratings of 9.2%? | SELECT COUNT("Episodes") FROM table_66113 WHERE "TV Station" = 'nhk' AND "Average Ratings" = '9.2%' | SELECT COUNT("Episodes") FROM "table_66113" WHERE "Average Ratings" = '9.2%' AND "TV Station" = 'nhk' | 0.098633 |
CREATE TABLE table_name_18 (event VARCHAR, record VARCHAR)
| Which event had the record of 18 5 (1)? | SELECT event FROM table_name_18 WHERE record = "18–5 (1)" | SELECT "event" FROM "table_name_18" WHERE "18–5 (1)" = "record" | 0.061523 |
CREATE TABLE table_name_71 (date VARCHAR, new_entries_this_round VARCHAR)
| What is the date for the row with a new entries this round of 44? | SELECT date FROM table_name_71 WHERE new_entries_this_round = "44" | SELECT "date" FROM "table_name_71" WHERE "44" = "new_entries_this_round" | 0.070313 |
CREATE TABLE table_name_38 (tournament VARCHAR)
| what is the tournament when in 2012 the performance was 2r? | SELECT tournament FROM table_name_38 WHERE 2012 = "2r" | SELECT "tournament" FROM "table_name_38" WHERE "2r" = 2012 | 0.056641 |
CREATE TABLE table_name_87 (lost INT, goals_scored VARCHAR, place VARCHAR)
| What the lost in place less than 3 and having more than 63 goals scored? | SELECT SUM(lost) FROM table_name_87 WHERE goals_scored > 63 AND place < 3 | SELECT SUM("lost") FROM "table_name_87" WHERE "goals_scored" > 63 AND "place" < 3 | 0.079102 |
CREATE TABLE table_204_302 (id DECIMAL, "rank" DECIMAL, "nation" TEXT, "gold" DECIMAL, "silver" DECIMAL, "bronze" DECIMAL, "total" DECIMAL)
| which ranking is mexico ? | SELECT "rank" FROM table_204_302 WHERE "nation" = 'mexico' | SELECT "rank" FROM "table_204_302" WHERE "nation" = 'mexico' | 0.058594 |
CREATE TABLE assets (asset_id DECIMAL, other_details TEXT)
CREATE TABLE products_in_events (product_in_event_id DECIMAL, event_id DECIMAL, product_id DECIMAL)
CREATE TABLE agreements (document_id DECIMAL, event_id DECIMAL)
CREATE TABLE events (event_id DECIMAL, address_id DECIMAL, channel_id DECIMAL, event_type_code TEXT, finance_id DECIMAL, location_id DECIMAL)
CREATE TABLE parties (party_id DECIMAL, party_details TEXT)
CREATE TABLE products (product_id DECIMAL, product_type_code TEXT, product_name TEXT, product_price DECIMAL)
CREATE TABLE channels (channel_id DECIMAL, other_details TEXT)
CREATE TABLE assets_in_events (asset_id DECIMAL, event_id DECIMAL)
CREATE TABLE parties_in_events (party_id DECIMAL, event_id DECIMAL, role_code TEXT)
CREATE TABLE addresses (address_id DECIMAL, address_details TEXT)
CREATE TABLE locations (location_id DECIMAL, other_details TEXT)
CREATE TABLE finances (finance_id DECIMAL, other_details TEXT)
| What are the names and type codes of products? | SELECT product_name, product_type_code FROM products | SELECT "product_name", "product_type_code" FROM "products" | 0.056641 |
CREATE TABLE table_name_86 (score VARCHAR, time VARCHAR)
| What was the score when the time was 14:00? | SELECT score FROM table_name_86 WHERE time = "14:00" | SELECT "score" FROM "table_name_86" WHERE "14:00" = "time" | 0.056641 |
CREATE TABLE College (cName VARCHAR, state VARCHAR, enr DECIMAL)
CREATE TABLE Player (pID DECIMAL, pName VARCHAR, yCard VARCHAR, HS DECIMAL)
CREATE TABLE Tryout (pID DECIMAL, cName VARCHAR, pPos VARCHAR, decision VARCHAR)
| what is the state and enrollment of the colleges where have any students who got accepted in the tryout decision. | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' | SELECT "state", "enr" FROM "College" AS "T1" JOIN "Tryout" AS "T2" ON "T1"."cName" = "T2"."cName" AND "T2"."decision" = 'yes' | 0.12207 |
CREATE TABLE table_train_263 ("id" INT, "breast_cancer" BOOLEAN, "fasting_blood_glucose_fbg" FLOAT, "prostate_cancer" BOOLEAN, "hba1c" FLOAT, "body_mass_index_bmi" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
| a fasting blood sugar of 180 mg / dl | SELECT * FROM table_train_263 WHERE fasting_blood_glucose_fbg = 180 | SELECT * FROM "table_train_263" WHERE "fasting_blood_glucose_fbg" = 180 | 0.069336 |
CREATE TABLE table_14812 ("Office" TEXT, "Representative" TEXT, "Party" TEXT, "Residence" TEXT, "First Elected" TEXT)
| Which Party has a Representative of brian bosma? | SELECT "Party" FROM table_14812 WHERE "Representative" = 'brian bosma' | SELECT "Party" FROM "table_14812" WHERE "Representative" = 'brian bosma' | 0.070313 |
CREATE TABLE table_10021158_3 (scoring_average VARCHAR, money_list_rank VARCHAR)
| When the money list rank was n/a, what was the scoring average? | SELECT scoring_average FROM table_10021158_3 WHERE money_list_rank = "n/a" | SELECT "scoring_average" FROM "table_10021158_3" WHERE "money_list_rank" = "n/a" | 0.078125 |
CREATE TABLE table_name_44 (time VARCHAR, show_name VARCHAR)
| What Time has a Show Name of mornings with neil mitchell? | SELECT time FROM table_name_44 WHERE show_name = "mornings with neil mitchell" | SELECT "time" FROM "table_name_44" WHERE "mornings with neil mitchell" = "show_name" | 0.082031 |
CREATE TABLE table_72262 ("Year" FLOAT, "Premier One" TEXT, "Premier Two" TEXT, "Bristol & Somerset" TEXT, "Glos & Wilts" TEXT, "Bristol & N. Som" TEXT, "Somerset" TEXT, "Gloucestershire" TEXT, "Wiltshire" TEXT)
| who many times is gloucestershire is painswick? | SELECT COUNT("Premier Two") FROM table_72262 WHERE "Gloucestershire" = 'Painswick' | SELECT COUNT("Premier Two") FROM "table_72262" WHERE "Gloucestershire" = 'Painswick' | 0.082031 |
CREATE TABLE table_77953 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Which away team has a Home team score of 12.14 (86)? | SELECT "Away team score" FROM table_77953 WHERE "Home team score" = '12.14 (86)' | SELECT "Away team score" FROM "table_77953" WHERE "Home team score" = '12.14 (86)' | 0.080078 |
CREATE TABLE game (stadium_id INT, id INT, Season INT, Date TEXT, Home_team TEXT, Away_team TEXT, Score TEXT, Competition TEXT)
CREATE TABLE injury_accident (game_id INT, id INT, Player TEXT, Injury TEXT, Number_of_matches TEXT, Source TEXT)
CREATE TABLE stadium (id INT, name TEXT, Home_Games INT, Average_Attendance FLOAT, Total_Attendance FLOAT, Capacity_Percentage FLOAT)
| Show the number of games for each home team in a bar chart, and display by the total number in asc. | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team) | SELECT "Home_team", COUNT("Home_team") FROM "game" GROUP BY "Home_team" ORDER BY COUNT("Home_team") NULLS FIRST | 0.108398 |
CREATE TABLE table_name_30 (drawn INT, difference VARCHAR, lost VARCHAR)
| What is the average drawn of the team with a difference of 4 and more than 13 losses? | SELECT AVG(drawn) FROM table_name_30 WHERE difference = "4" AND lost > 13 | SELECT AVG("drawn") FROM "table_name_30" WHERE "4" = "difference" AND "lost" > 13 | 0.079102 |
CREATE TABLE table_test_20 ("id" INT, "ejection_fraction_ef" INT, "anemia" BOOLEAN, "gender" TEXT, "bleeding" INT, "systolic_blood_pressure_sbp" INT, "left_main_coronary_artery_stenosis" INT, "hemoglobin_a1c_hba1c" FLOAT, "renal_disease" BOOLEAN, "creatinine_clearance_cl" FLOAT, "prior_creatinine" FLOAT, "diastolic_blood_pressure_dbp" INT, "hypertension" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
| history of bleeding disorder | SELECT * FROM table_test_20 WHERE bleeding = 1 | SELECT * FROM "table_test_20" WHERE "bleeding" = 1 | 0.048828 |
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
| Can I leave at 5:00 P.M. every day if I take 370 and 489 ? | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 370 OR course.number = 489) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = 2016 | SELECT COUNT(*) = 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" AND "course_offering"."end_time" > '17:00:00' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'WN' AND "semester"."year" = 2016 WHERE "course"."number" = 370 OR "course"."number" = 489 | 0.34375 |
CREATE TABLE table_1193568_1 (province VARCHAR, member VARCHAR)
| what's the province where member is dingley brittin category:articles with hcards | SELECT province FROM table_1193568_1 WHERE member = "Dingley Brittin Category:Articles with hCards" | SELECT "province" FROM "table_1193568_1" WHERE "Dingley Brittin Category:Articles with hCards" = "member" | 0.102539 |
CREATE TABLE table_66758 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What is the to par of the player from the United States with a score of 69-68-65=202? | SELECT "To par" FROM table_66758 WHERE "Country" = 'united states' AND "Score" = '69-68-65=202' | SELECT "To par" FROM "table_66758" WHERE "Country" = 'united states' AND "Score" = '69-68-65=202' | 0.094727 |
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
| is patient 035-13344's sao2 measured at 2103-01-14 00:35:00 less than it was measured at 2103-01-14 00:30:00? | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-13344')) AND NOT vitalperiodic.sao2 IS NULL AND vitalperiodic.observationtime = '2103-01-14 00:35:00') < (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-13344')) AND NOT vitalperiodic.sao2 IS NULL AND vitalperiodic.observationtime = '2103-01-14 00:30:00') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '035-13344' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT "vitalperiodic"."sao2" FROM "vitalperiodic" LEFT JOIN "_u_4" AS "_u_4" ON "_u_4"."" = "vitalperiodic"."patientunitstayid" WHERE "vitalperiodic"."observationtime" = '2103-01-14 00:30:00' AND NOT "_u_4"."" IS NULL AND NOT "vitalperiodic"."sao2" IS NULL) > (SELECT "vitalperiodic"."sao2" FROM "vitalperiodic" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "vitalperiodic"."patientunitstayid" WHERE "vitalperiodic"."observationtime" = '2103-01-14 00:35:00' AND NOT "_u_1"."" IS NULL AND NOT "vitalperiodic"."sao2" IS NULL) | 1.0625 |
CREATE TABLE assessment_notes (notes_id DECIMAL, student_id DECIMAL, teacher_id DECIMAL, date_of_notes TIME, text_of_notes TEXT, other_details TEXT)
CREATE TABLE student_addresses (student_id DECIMAL, address_id DECIMAL, date_address_from TIME, date_address_to TIME, monthly_rental DECIMAL, other_details TEXT)
CREATE TABLE detention (detention_id DECIMAL, detention_type_code TEXT, teacher_id DECIMAL, datetime_detention_start TIME, datetime_detention_end TIME, detention_summary TEXT, other_details TEXT)
CREATE TABLE students_in_detention (student_id DECIMAL, detention_id DECIMAL, incident_id DECIMAL)
CREATE TABLE teachers (teacher_id DECIMAL, address_id DECIMAL, first_name TEXT, middle_name TEXT, last_name TEXT, gender TEXT, cell_mobile_number TEXT, email_address TEXT, other_details TEXT)
CREATE TABLE ref_address_types (address_type_code TEXT, address_type_description TEXT)
CREATE TABLE behavior_incident (incident_id DECIMAL, incident_type_code TEXT, student_id DECIMAL, date_incident_start TIME, date_incident_end TIME, incident_summary TEXT, recommendations TEXT, other_details TEXT)
CREATE TABLE students (student_id DECIMAL, address_id DECIMAL, first_name TEXT, middle_name TEXT, last_name TEXT, cell_mobile_number TEXT, email_address TEXT, date_first_rental TIME, date_left_university TIME, other_student_details TEXT)
CREATE TABLE ref_detention_type (detention_type_code TEXT, detention_type_description TEXT)
CREATE TABLE addresses (address_id DECIMAL, line_1 TEXT, line_2 TEXT, line_3 TEXT, city TEXT, zip_postcode TEXT, state_province_county TEXT, country TEXT, other_address_details TEXT)
CREATE TABLE ref_incident_type (incident_type_code TEXT, incident_type_description TEXT)
| Find the ids and first names of the 3 teachers that have the most number of assessment notes? | SELECT T1.teacher_id, T2.first_name FROM assessment_notes AS T1 JOIN teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 3 | SELECT "T1"."teacher_id", "T2"."first_name" FROM "assessment_notes" AS "T1" JOIN "teachers" AS "T2" ON "T1"."teacher_id" = "T2"."teacher_id" GROUP BY "T1"."teacher_id" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3 | 0.204102 |
CREATE TABLE table_name_67 (original_title VARCHAR, film_title_used_in_nomination VARCHAR)
| What is the original title of the Gypsy Magic film title used in nomination? | SELECT original_title FROM table_name_67 WHERE film_title_used_in_nomination = "gypsy magic" | SELECT "original_title" FROM "table_name_67" WHERE "film_title_used_in_nomination" = "gypsy magic" | 0.095703 |
CREATE TABLE table_15917 ("School" TEXT, "Location" TEXT, "Founded" FLOAT, "Affiliation" TEXT, "Enrollment" FLOAT, "Team Nickname" TEXT, "Primary conference" TEXT)
| How many of the schools listed are in Ames, IA? | SELECT COUNT("Primary conference") FROM table_15917 WHERE "Location" = 'Ames, IA' | SELECT COUNT("Primary conference") FROM "table_15917" WHERE "Location" = 'Ames, IA' | 0.081055 |
CREATE TABLE table_34630 ("Spacecraft" TEXT, "Destination" TEXT, "Launched" TEXT, "Closest approach" TEXT, "Time elapsed" TEXT)
| What Time elapsed has 14 February 2011 as the Closest approach? | SELECT "Time elapsed" FROM table_34630 WHERE "Closest approach" = '14 february 2011' | SELECT "Time elapsed" FROM "table_34630" WHERE "Closest approach" = '14 february 2011' | 0.083984 |
CREATE TABLE table_203_298 (id DECIMAL, "rank" DECIMAL, "name" TEXT, "nation ( s ) " TEXT, "born" TEXT, "ascended" TEXT, "years reigned" TEXT)
| which monarchs reined for more than 50 years ? | SELECT "name" FROM table_203_298 WHERE "years reigned" > 50 | SELECT "name" FROM "table_203_298" WHERE "years reigned" > 50 | 0.05957 |
CREATE TABLE table_204_123 (id DECIMAL, "week" DECIMAL, "date" TEXT, "kickoff" TEXT, "opponent" TEXT, "results\ final score" TEXT, "results\ team record" TEXT, "game site" TEXT, "attendance" DECIMAL)
| which week has the same kickoff time as week 6 ? | SELECT "week" FROM table_204_123 WHERE "week" <> 6 AND "kickoff" = (SELECT "kickoff" FROM table_204_123 WHERE "week" = 6) | SELECT "week" FROM "table_204_123" WHERE "kickoff" = (SELECT "kickoff" FROM "table_204_123" WHERE "week" = 6) AND "week" <> 6 | 0.12207 |
CREATE TABLE table_66014 ("Title" TEXT, "Time" TEXT, "Writer ( s ) " TEXT, "Performer ( s ) " TEXT, "Producer ( s ) " TEXT, "Recorded at" TEXT)
| Who wrote the album recorded at funhouse studios with a time of 3:27? | SELECT "Writer(s)" FROM table_66014 WHERE "Recorded at" = 'funhouse studios' AND "Time" = '3:27' | SELECT "Writer(s)" FROM "table_66014" WHERE "Recorded at" = 'funhouse studios' AND "Time" = '3:27' | 0.095703 |
CREATE TABLE table_41403 ("Date" TEXT, "Tournament" TEXT, "Winning score" TEXT, "Margin of victory" TEXT, "Runner ( s ) -up" TEXT)
| Who was the runner-up on Jan 19, 1964? | SELECT "Runner(s)-up" FROM table_41403 WHERE "Date" = 'jan 19, 1964' | SELECT "Runner(s)-up" FROM "table_41403" WHERE "Date" = 'jan 19, 1964' | 0.068359 |
CREATE TABLE WINE (YEAR VARCHAR, Price INT)
| What are the average prices of wines for different years? | SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR | SELECT AVG("Price"), "YEAR" FROM "WINE" GROUP BY "YEAR" | 0.053711 |
CREATE TABLE resultsdata15 (sample_pk DECIMAL, commod TEXT, commtype TEXT, lab TEXT, pestcode TEXT, testclass TEXT, concen DECIMAL, lod DECIMAL, conunit TEXT, confmethod TEXT, confmethod2 TEXT, annotate TEXT, quantitate TEXT, mean TEXT, extract TEXT, determin TEXT)
CREATE TABLE sampledata15 (sample_pk DECIMAL, state TEXT, year TEXT, month TEXT, day TEXT, site TEXT, commod TEXT, source_id TEXT, variety TEXT, origin TEXT, country TEXT, disttype TEXT, commtype TEXT, claim TEXT, quantity DECIMAL, growst TEXT, packst TEXT, distst TEXT)
| Where do the US import the most food ? | SELECT MAX(country) FROM sampledata15 | SELECT MAX("country") FROM "sampledata15" | 0.040039 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| give me the number of patients whose ethnicity is asian and age is less than 48? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "48" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "48" > "demographic"."age" AND "ASIAN" = "demographic"."ethnicity" | 0.137695 |
CREATE TABLE table_name_93 (ship_type VARCHAR, tonnage VARCHAR)
| With a tonnage of 225 what is the ship type? | SELECT ship_type FROM table_name_93 WHERE tonnage = "225" | SELECT "ship_type" FROM "table_name_93" WHERE "225" = "tonnage" | 0.061523 |
CREATE TABLE table_52272 ("Name" TEXT, "Years" TEXT, "Area" TEXT, "Authority" TEXT, "Decile" TEXT, "Roll" FLOAT)
| What is the name of the school with a decile of 1, a state authority, and located in Otahuhu? | SELECT "Name" FROM table_52272 WHERE "Decile" = '1' AND "Authority" = 'state' AND "Area" = 'otahuhu' | SELECT "Name" FROM "table_52272" WHERE "Area" = 'otahuhu' AND "Authority" = 'state' AND "Decile" = '1' | 0.099609 |
CREATE TABLE table_74949 ("Rank" TEXT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| Which Silver is the lowest one that has a Gold larger than 0, and a Rank of total, and a Bronze smaller than 32? | SELECT MIN("Silver") FROM table_74949 WHERE "Gold" > '0' AND "Rank" = 'total' AND "Bronze" < '32' | SELECT MIN("Silver") FROM "table_74949" WHERE "Bronze" < '32' AND "Gold" > '0' AND "Rank" = 'total' | 0.09668 |
CREATE TABLE table_name_37 (entrant VARCHAR, year VARCHAR, chassis VARCHAR)
| What entrant drove a car with a Moore chassis prior to 1953? | SELECT entrant FROM table_name_37 WHERE year < 1953 AND chassis = "moore" | SELECT "entrant" FROM "table_name_37" WHERE "chassis" = "moore" AND "year" < 1953 | 0.079102 |
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
| on 10/09/last year', what was minimum arterial bp mean of patient 28343? | SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28343)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', chartevents.charttime) = '10-09' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 28343 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp mean' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT MIN("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE DATETIME("chartevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%m-%d', "chartevents"."charttime") = '10-09' | 0.847656 |
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| tell me the amount of .9% normal saline that patient 25696 has received on 02/11/last year. | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25696)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.9% normal saline' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '02-11' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25696 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = '.9% normal saline' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid") SELECT SUM("inputevents_cv"."amount") FROM "inputevents_cv" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "inputevents_cv"."itemid" WHERE DATETIME("inputevents_cv"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%m-%d', "inputevents_cv"."charttime") = '02-11' | 0.867188 |
CREATE TABLE table_name_8 (opponent VARCHAR, event VARCHAR)
| Which Opponent has an Event of king of the cage: shock and awe? | SELECT opponent FROM table_name_8 WHERE event = "king of the cage: shock and awe" | SELECT "opponent" FROM "table_name_8" WHERE "event" = "king of the cage: shock and awe" | 0.084961 |
CREATE TABLE table_name_17 (against INT, draws VARCHAR, losses VARCHAR)
| How much Against has Draws of 2, and Losses smaller than 4? | SELECT SUM(against) FROM table_name_17 WHERE draws = 2 AND losses < 4 | SELECT SUM("against") FROM "table_name_17" WHERE "draws" = 2 AND "losses" < 4 | 0.075195 |
CREATE TABLE table_name_93 (model VARCHAR)
| Name the 2011 which has a 2002 of , and a Model of seat marbella? | SELECT 2011 FROM table_name_93 WHERE 2002 = "—" AND model = "seat marbella" | SELECT 2011 FROM "table_name_93" WHERE "model" = "seat marbella" AND "—" = 2002 | 0.077148 |
CREATE TABLE table_name_80 (home_team VARCHAR, tie_no VARCHAR)
| Who was the Home team in Tie #23? | SELECT home_team FROM table_name_80 WHERE tie_no = 23 | SELECT "home_team" FROM "table_name_80" WHERE "tie_no" = 23 | 0.057617 |
CREATE TABLE table_19789597_6 (opponent VARCHAR, date VARCHAR)
| Who was the game on July 7 played against? | SELECT opponent FROM table_19789597_6 WHERE date = "July 7" | SELECT "opponent" FROM "table_19789597_6" WHERE "July 7" = "date" | 0.063477 |
CREATE TABLE table_17464 ("Pick #" FLOAT, "Player" TEXT, "Position" TEXT, "Nationality" TEXT, "NHL team" TEXT, "College/junior/club team" TEXT)
| what is the total number of pick # where nhl team is philadelphia flyers | SELECT COUNT("Pick #") FROM table_17464 WHERE "NHL team" = 'Philadelphia Flyers' | SELECT COUNT("Pick #") FROM "table_17464" WHERE "NHL team" = 'Philadelphia Flyers' | 0.080078 |
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
| Find New Users Answering Each Other's Questions. | SELECT Users.Id, Posts.OwnerUserId FROM Users INNER JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE Users.CreationDate BETWEEN '09/01/2018 00:00:00' AND '09/30/2018 00:00:00' | SELECT "Users"."Id", "Posts"."OwnerUserId" FROM "Users" JOIN "Posts" ON "Posts"."OwnerUserId" = "Users"."Id" WHERE "Users"."CreationDate" <= '09/30/2018 00:00:00' AND "Users"."CreationDate" >= '09/01/2018 00:00:00' | 0.208984 |
CREATE TABLE table_54919 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Which venue hosted South Melbourne as an away team? | SELECT "Venue" FROM table_54919 WHERE "Away team" = 'south melbourne' | SELECT "Venue" FROM "table_54919" WHERE "Away team" = 'south melbourne' | 0.069336 |
CREATE TABLE table_33631 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Who was the home team that scored 8.7 (55)? | SELECT "Home team" FROM table_33631 WHERE "Home team score" = '8.7 (55)' | SELECT "Home team" FROM "table_33631" WHERE "Home team score" = '8.7 (55)' | 0.072266 |
CREATE TABLE candidate (Candidate_ID INT, People_ID INT, Poll_Source TEXT, Date TEXT, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT)
CREATE TABLE people (People_ID INT, Sex TEXT, Name TEXT, Date_of_Birth TEXT, Height FLOAT, Weight FLOAT)
| Bar chart x axis sex y axis how many sex, sort by the x axis in asc. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex | SELECT "Sex", COUNT("Sex") FROM "people" GROUP BY "Sex" ORDER BY "Sex" NULLS FIRST | 0.080078 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| count the number of patients whose admission type is emergency and diagnoses long title is other malignant lymphomas, unspecified site, extranodal and solid organ sites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other malignant lymphomas, unspecified site, extranodal and solid organ sites" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Other malignant lymphomas, unspecified site, extranodal and solid organ sites" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type" | 0.291016 |
CREATE TABLE station (Station_ID INT, Name TEXT, Annual_entry_exit FLOAT, Annual_interchanges FLOAT, Total_Passengers FLOAT, Location TEXT, Main_Services TEXT, Number_of_Platforms INT)
CREATE TABLE train_station (Train_ID INT, Station_ID INT)
CREATE TABLE train (Train_ID INT, Name TEXT, Time TEXT, Service TEXT)
| Create a bar chart showing total number of number of platforms across location, rank from low to high by the X-axis. | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location | SELECT "Location", SUM("Number_of_Platforms") FROM "station" GROUP BY "Location" ORDER BY "Location" NULLS FIRST | 0.109375 |
CREATE TABLE table_name_34 (verb VARCHAR)
| What is the 2nd verb for Khola? | SELECT 2 AS __f_ FROM table_name_34 WHERE verb = "khola" | SELECT 2 AS "__f_" FROM "table_name_34" WHERE "khola" = "verb" | 0.060547 |
CREATE TABLE table_27139 ("Round" FLOAT, "Circuit" TEXT, "Date" TEXT, "Class A Winner" TEXT, "Class B Winner" TEXT, "Class C Winner" TEXT, "Class D Winner" TEXT)
| When did Alan Hutcheson won Class B on round 1? | SELECT "Date" FROM table_27139 WHERE "Class B Winner" = 'Alan Hutcheson' AND "Round" = '1' | SELECT "Date" FROM "table_27139" WHERE "Class B Winner" = 'Alan Hutcheson' AND "Round" = '1' | 0.089844 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| provide the number of patients whose diagnoses short title is dmi keto nt st uncntrld and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "DMI keto nt st uncntrld" AND lab."CATEGORY" = "Blood Gas" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "DMI keto nt st uncntrld" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "Blood Gas" = "lab"."CATEGORY" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.27832 |
CREATE TABLE table_40626 ("Japanese name" TEXT, "Kana" TEXT, "Hanja / Kanji" TEXT, "Korean name" TEXT, "Hangul" TEXT)
| What is the Hangul of the Province with a Kana of ? | SELECT "Hangul" FROM table_40626 WHERE "Kana" = 'へいあんなんどう' | SELECT "Hangul" FROM "table_40626" WHERE "Kana" = 'へいあんなんどう' | 0.058594 |
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
| when was the last time when patient 006-83264 had the minimum value of respiration? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-83264')) AND NOT vitalperiodic.respiration IS NULL ORDER BY vitalperiodic.respiration, vitalperiodic.observationtime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-83264' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "vitalperiodic"."observationtime" FROM "vitalperiodic" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND NOT "vitalperiodic"."respiration" IS NULL ORDER BY "vitalperiodic"."respiration" NULLS FIRST, "vitalperiodic"."observationtime" DESC NULLS LAST LIMIT 1 | 0.665039 |
CREATE TABLE table_name_65 (lineup VARCHAR, competition VARCHAR, match VARCHAR)
| What was the lineup for match 12 that had a competition of Group Stage? | SELECT lineup FROM table_name_65 WHERE competition = "group stage" AND match = "12" | SELECT "lineup" FROM "table_name_65" WHERE "12" = "match" AND "competition" = "group stage" | 0.088867 |
CREATE TABLE table_name_24 (european_cup VARCHAR, national_league VARCHAR)
| What European Cup is in Israeli Premier League? | SELECT european_cup FROM table_name_24 WHERE national_league = "israeli premier league" | SELECT "european_cup" FROM "table_name_24" WHERE "israeli premier league" = "national_league" | 0.09082 |
CREATE TABLE table_31603 ("Year" FLOAT, "Competition" TEXT, "Venue" TEXT, "Position" TEXT, "Event" TEXT, "Notes" TEXT)
| Tell me the venue for year less than 2003 | SELECT "Venue" FROM table_31603 WHERE "Year" < '2003' | SELECT "Venue" FROM "table_31603" WHERE "Year" < '2003' | 0.053711 |
CREATE TABLE table_35119 ("Call sign" TEXT, "Frequency MHz" FLOAT, "City of license" TEXT, "ERP W" FLOAT, "Class" TEXT, "FCC info" TEXT)
| What is the call sign of the MHz Frequency less than 94.9 and an ERP W of 170? | SELECT "Call sign" FROM table_35119 WHERE "Frequency MHz" < '94.9' AND "ERP W" = '170' | SELECT "Call sign" FROM "table_35119" WHERE "ERP W" = '170' AND "Frequency MHz" < '94.9' | 0.085938 |
CREATE TABLE table_5924 ("Games" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Points difference" TEXT, "Points" FLOAT)
| Name the most games with drawn more than 1 | SELECT MAX("Games") FROM table_5924 WHERE "Drawn" > '1' | SELECT MAX("Games") FROM "table_5924" WHERE "Drawn" > '1' | 0.055664 |
CREATE TABLE table_53931 ("Res." TEXT, "Record" TEXT, "Opponent" TEXT, "Method" TEXT, "Round" FLOAT, "Time" TEXT, "Location" TEXT)
| What is the lowest round for Fort Lauderdale, Florida, United States, with a win and a time of 3:38? | SELECT MIN("Round") FROM table_53931 WHERE "Res." = 'win' AND "Location" = 'fort lauderdale, florida, united states' AND "Time" = '3:38' | SELECT MIN("Round") FROM "table_53931" WHERE "Location" = 'fort lauderdale, florida, united states' AND "Res." = 'win' AND "Time" = '3:38' | 0.134766 |
CREATE TABLE table_33249 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" TEXT)
| How many people attended the Rams game against the Kansas City Chiefs? | SELECT "Attendance" FROM table_33249 WHERE "Opponent" = 'kansas city chiefs' | SELECT "Attendance" FROM "table_33249" WHERE "Opponent" = 'kansas city chiefs' | 0.076172 |
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
| Q's from users with 10k+ reputation without an accepted answer. | SELECT * FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND u.Reputation > 10000 LIMIT 1000 | SELECT * FROM "Posts" AS "p" JOIN "Users" AS "u" ON "p"."OwnerUserId" = "u"."Id" AND "u"."Reputation" > 10000 WHERE "AcceptedAnswerId" IS NULL AND "PostTypeId" = 1 LIMIT 1000 | 0.169922 |
CREATE TABLE table_name_49 (year VARCHAR, laps VARCHAR)
| How many years was the number of laps 71? | SELECT COUNT(year) FROM table_name_49 WHERE laps = 71 | SELECT COUNT("year") FROM "table_name_49" WHERE "laps" = 71 | 0.057617 |
CREATE TABLE table_26267607_2 (winning_driver VARCHAR, fastest_lap VARCHAR)
| Where the fastest lap is Mike Rockenfeller, who is the winning driver? | SELECT winning_driver FROM table_26267607_2 WHERE fastest_lap = "Mike Rockenfeller" | SELECT "winning_driver" FROM "table_26267607_2" WHERE "Mike Rockenfeller" = "fastest_lap" | 0.086914 |
CREATE TABLE table_39649 ("Date" FLOAT, "Opponent" TEXT, "Venue" TEXT, "Result" TEXT, "Attendance" TEXT, "Competition" TEXT)
| What was the home Competition with Attendance of 1,268? | SELECT "Competition" FROM table_39649 WHERE "Venue" = 'home' AND "Attendance" = '1,268' | SELECT "Competition" FROM "table_39649" WHERE "Attendance" = '1,268' AND "Venue" = 'home' | 0.086914 |
CREATE TABLE table_name_31 (rank INT, matches VARCHAR, total VARCHAR, county VARCHAR)
| what is the rank when the total is 39 in the county of dublin and the matches is less than 4? | SELECT AVG(rank) FROM table_name_31 WHERE total = 39 AND county = "dublin" AND matches < 4 | SELECT AVG("rank") FROM "table_name_31" WHERE "county" = "dublin" AND "matches" < 4 AND "total" = 39 | 0.097656 |
CREATE TABLE table_name_37 (to_par VARCHAR, total VARCHAR, finish VARCHAR)
| What is To par, when Total is less than 297, and when Finish is '1'? | SELECT to_par FROM table_name_37 WHERE total < 297 AND finish = "1" | SELECT "to_par" FROM "table_name_37" WHERE "1" = "finish" AND "total" < 297 | 0.073242 |
CREATE TABLE table_65856 ("Year ( Ceremony ) " TEXT, "Actor/Actress" TEXT, "Category" TEXT, "Film title used in nomination" TEXT, "Result" TEXT)
| What is the year when sigourney weaver was nominated for best actress? | SELECT "Year (Ceremony)" FROM table_65856 WHERE "Category" = 'best actress' AND "Actor/Actress" = 'sigourney weaver' | SELECT "Year (Ceremony)" FROM "table_65856" WHERE "Actor/Actress" = 'sigourney weaver' AND "Category" = 'best actress' | 0.115234 |
CREATE TABLE table_75005 ("Medal" TEXT, "Name" TEXT, "Games" TEXT, "Sport" TEXT, "Event" TEXT)
| Which Name had a Games of 2008 beijing, and a Medal of gold? | SELECT "Name" FROM table_75005 WHERE "Games" = '2008 beijing' AND "Medal" = 'gold' | SELECT "Name" FROM "table_75005" WHERE "Games" = '2008 beijing' AND "Medal" = 'gold' | 0.082031 |
Subsets and Splits